mirror of
https://github.com/raysan5/raylib.git
synced 2025-10-01 15:38:30 +00:00
Updated to new rlgl
This commit is contained in:
@@ -96,11 +96,19 @@ int main(void)
|
|||||||
|
|
||||||
// Initialize rlgl internal buffers and OpenGL state
|
// Initialize rlgl internal buffers and OpenGL state
|
||||||
rlglInit();
|
rlglInit();
|
||||||
rlglInitGraphics(0, 0, screenWidth, screenHeight);
|
|
||||||
|
// 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
|
rlClearColor(245, 245, 245, 255); // Define clear color
|
||||||
rlEnableDepthTest(); // Enable DEPTH_TEST for 3D
|
rlEnableDepthTest(); // Enable DEPTH_TEST for 3D
|
||||||
|
|
||||||
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f };
|
Vector3 cubePosition = { 0.0f, 0.0f, 0.0f }; // Cube default position (center)
|
||||||
|
|
||||||
Camera camera;
|
Camera camera;
|
||||||
camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position
|
camera.position = (Vector3){ 5.0f, 5.0f, 5.0f }; // Camera position
|
||||||
|
Reference in New Issue
Block a user