aboutsummaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-03-17 13:51:48 +0100
committerRay <raysan5@gmail.com>2016-03-17 13:51:48 +0100
commite2ba22ec596757d62f8b22cf8b722d68040f23d3 (patch)
tree28b9e0ddfe60534b167dd659e27c4fa10288d329 /src/core.c
parent49df957058b2f602c7e6873fec0007fcd7a4dc4c (diff)
downloadraylib-e2ba22ec596757d62f8b22cf8b722d68040f23d3.tar.gz
raylib-e2ba22ec596757d62f8b22cf8b722d68040f23d3.zip
Improved 2D-3D drawing
Depth test disabled for 2D and only used on 3D; consequently LINES vs TRIANGLES vs QUADS buffers drawing order maters... but blending also works ok.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 7d229324..d27a031b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -643,6 +643,8 @@ void Begin3dMode(Camera camera)
// Setup Camera view
Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up);
rlMultMatrixf(MatrixToFloat(matView)); // Multiply MODELVIEW matrix by view matrix (camera)
+
+ rlEnableDepthTest(); // Enable DEPTH_TEST for 3D
}
// Ends 3D mode and returns to default 2D orthographic mode
@@ -657,6 +659,8 @@ void End3dMode(void)
rlLoadIdentity(); // Reset current matrix (MODELVIEW)
//rlTranslatef(0.375, 0.375, 0); // HACK to ensure pixel-perfect drawing on OpenGL (after exiting 3D mode)
+
+ rlDisableDepthTest(); // Disable DEPTH_TEST for 2D
}
// Set target FPS for the game