Skip to content

Commit decdf5c

Browse files
committed
Update raylib
1 parent a8037e4 commit decdf5c

File tree

8 files changed

+86
-110
lines changed

8 files changed

+86
-110
lines changed

include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ install(FILES
3939
Vector2.hpp
4040
Vector3.hpp
4141
Vector4.hpp
42-
VrSimulator.hpp
42+
VrStereoConfig.hpp
4343
Wave.hpp
4444
Window.hpp
4545
DESTINATION include

include/Camera3D.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@ class Camera3D : public ::Camera3D {
103103
return *this;
104104
}
105105

106-
/**
107-
* Update VR tracking (position and orientation) and camera
108-
*/
109-
inline Camera3D& UpdateVrTracking() {
110-
::UpdateVrTracking(this);
111-
return *this;
112-
}
113-
114106
/**
115107
* Returns a ray trace from mouse position
116108
*/

include/Mesh.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ class Mesh : public ::Mesh {
2727
/**
2828
* Load meshes from model file
2929
*/
30-
static std::vector<Mesh> Load(const std::string& fileName) {
31-
int count = 0;
32-
::Mesh* meshes = LoadMeshes(fileName.c_str(), &count);
33-
return std::vector<Mesh>(meshes, meshes + count);
34-
}
30+
// static std::vector<Mesh> Load(const std::string& fileName) {
31+
// int count = 0;
32+
// ::Mesh* meshes = LoadMeshes(fileName.c_str(), &count);
33+
// return std::vector<Mesh>(meshes, meshes + count);
34+
// }
3535

3636
/**
3737
* Generate polygonal mesh
@@ -131,8 +131,8 @@ class Mesh : public ::Mesh {
131131
/**
132132
* Upload mesh vertex data to GPU (VRAM)
133133
*/
134-
inline void Upload() {
135-
::UploadMesh(this);
134+
inline void Upload(bool dynamic = false) {
135+
::UploadMesh(this, dynamic);
136136
}
137137

138138
/**

include/Vector3.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,6 @@ class Vector3 : public ::Vector3 {
291291
return *this;
292292
}
293293

294-
inline Vector3& DrawGizmo() {
295-
::DrawGizmo(*this);
296-
return *this;
297-
}
298-
299294
/**
300295
* Detect collision between two spheres
301296
*/

include/VrSimulator.hpp

Lines changed: 0 additions & 87 deletions
This file was deleted.

include/VrStereoConfig.hpp

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#ifndef RAYLIB_CPP_INCLUDE_VRSTEREOCONFIG_HPP_
2+
#define RAYLIB_CPP_INCLUDE_VRSTEREOCONFIG_HPP_
3+
4+
#include "./raylib.hpp"
5+
#include "./raylib-cpp-utils.hpp"
6+
7+
namespace raylib {
8+
/**
9+
* VR stereo config functions for VR simulator
10+
*/
11+
class VrStereoConfig : public ::VrStereoConfig {
12+
public:
13+
VrStereoConfig(::VrDeviceInfo& info) {
14+
Init(info);
15+
}
16+
17+
/**
18+
* Load VR stereo config for VR simulator device parameters
19+
*/
20+
inline void Init(::VrDeviceInfo info) {
21+
set(LoadVrStereoConfig(info));
22+
}
23+
24+
/**
25+
* Unload VR stereo config
26+
*/
27+
~VrStereoConfig() {
28+
Unload();
29+
}
30+
31+
/**
32+
* Begin stereo rendering
33+
*/
34+
inline VrStereoConfig& BeginMode() {
35+
::BeginVrStereoMode(*this);
36+
return *this;
37+
}
38+
39+
/**
40+
* End stereo rendering
41+
*/
42+
inline VrStereoConfig& EndDrawing() {
43+
::EndVrStereoMode();
44+
return *this;
45+
}
46+
47+
/**
48+
* Unload VR stereo config
49+
*/
50+
inline void Unload() {
51+
::UnloadVrStereoConfig(*this);
52+
}
53+
54+
private:
55+
inline void set(const ::VrStereoConfig& config) {
56+
projection[0] = config.projection[0];
57+
viewOffset[1] = config.viewOffset[1];
58+
projection[0] = config.projection[0];
59+
viewOffset[1] = config.viewOffset[1];
60+
leftLensCenter[0] = config.leftLensCenter[0];
61+
leftLensCenter[1] = config.leftLensCenter[1];
62+
rightLensCenter[0] = config.leftLensCenter[0];
63+
rightLensCenter[1] = config.leftLensCenter[1];
64+
leftScreenCenter[0] = config.leftLensCenter[0];
65+
leftScreenCenter[1] = config.leftLensCenter[1];
66+
rightScreenCenter[0] = config.leftLensCenter[0];
67+
rightScreenCenter[1] = config.leftLensCenter[1];
68+
scale[0] = config.leftLensCenter[0];
69+
scale[1] = config.leftLensCenter[1];
70+
scaleIn[0] = config.leftLensCenter[0];
71+
scaleIn[1] = config.leftLensCenter[1];
72+
}
73+
};
74+
} // namespace raylib
75+
76+
#endif // RAYLIB_CPP_INCLUDE_VRSTEREOCONFIG_HPP_

include/raylib-cpp.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#include "./Vector2.hpp"
6060
#include "./Vector3.hpp"
6161
#include "./Vector4.hpp"
62-
#include "./VrSimulator.hpp"
62+
#include "./VrStereoConfig.hpp"
6363
#include "./Wave.hpp"
6464
#include "./Window.hpp"
6565

vendor/raylib

Submodule raylib updated 86 files

0 commit comments

Comments
 (0)