aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-06-25 23:29:03 +0200
committerraysan5 <raysan5@gmail.com>2016-06-25 23:29:03 +0200
commit8fb84d9e638dea9b4eaaee52b61e1a7ea6681005 (patch)
tree40b6607318054202df23668501e5dfb3335b7cb7
parent71ab20229564a4c519ab46ee34ec785846bdbe83 (diff)
downloadraylib-8fb84d9e638dea9b4eaaee52b61e1a7ea6681005.tar.gz
raylib-8fb84d9e638dea9b4eaaee52b61e1a7ea6681005.zip
Updated to new rlgl
-rw-r--r--examples/oculus_glfw_sample/rlgl_standalone.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/examples/oculus_glfw_sample/rlgl_standalone.c b/examples/oculus_glfw_sample/rlgl_standalone.c
index 4728160a..33e91631 100644
--- a/examples/oculus_glfw_sample/rlgl_standalone.c
+++ b/examples/oculus_glfw_sample/rlgl_standalone.c
@@ -96,11 +96,19 @@ int main(void)
// Initialize rlgl internal buffers and OpenGL state
rlglInit();
- rlglInitGraphics(0, 0, screenWidth, screenHeight);
- rlClearColor(245, 245, 245, 255); // Define clear color
- rlEnableDepthTest(); // Enable DEPTH_TEST for 3D
- Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
+ // Initialize viewport and internal projection/modelview matrices
+ rlViewport(0, 0, screenWidth, screenHeight);
+ rlMatrixMode(RL_PROJECTION); // Switch to PROJECTION matrix
+ rlLoadIdentity(); // Reset current matrix (PROJECTION)
+ rlOrtho(0, screenWidth, screenHeight, 0, 0.0f, 1.0f); // Orthographic projection with top-left corner at (0,0)
+ rlMatrixMode(RL_MODELVIEW); // Switch back to MODELVIEW matrix
+ rlLoadIdentity(); // Reset current matrix (MODELVIEW)
+
+ rlClearColor(245, 245, 245, 255); // Define clear color
+ rlEnableDepthTest(); // Enable DEPTH_TEST for 3D
+
+ Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; // Cube default position (center)
Camera camera;
camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position