summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJett <[email protected]>2023-10-31 03:43:32 -0400
committerGitHub <[email protected]>2023-10-31 08:43:32 +0100
commitff04d52f12c95b0b25faaffc4e68abed9ba2b474 (patch)
treee1055f6da462f214ee4e05bf79ef13d952ba82dd /src
parent7677e4b92842a317f883c91ce9ad0cd6963d9341 (diff)
downloadraylib-ff04d52f12c95b0b25faaffc4e68abed9ba2b474.tar.gz
raylib-ff04d52f12c95b0b25faaffc4e68abed9ba2b474.zip
Added rlEnablePointMode (#3490)
for rendering meshes with points. similar to wire mode. (NOTE) they still backface cull, so disable that if you want to show the entire mesh.
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 7c93bf92..707555dd 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -632,7 +632,8 @@ RLAPI void rlEnableScissorTest(void); // Enable scissor test
RLAPI void rlDisableScissorTest(void); // Disable scissor test
RLAPI void rlScissor(int x, int y, int width, int height); // Scissor test
RLAPI void rlEnableWireMode(void); // Enable wire mode
-RLAPI void rlDisableWireMode(void); // Disable wire mode
+RLAPI void rlEnablePointMode(void); // Enable point mode
+RLAPI void rlDisableWireMode(void); // Disable wire mode ( and point ) maybe rename
RLAPI void rlSetLineWidth(float width); // Set the line drawing width
RLAPI float rlGetLineWidth(void); // Get the line drawing width
RLAPI void rlEnableSmoothLines(void); // Enable line aliasing
@@ -1817,6 +1818,14 @@ void rlEnableWireMode(void)
#endif
}
+void rlEnablePointMode(void)
+{
+#if defined(GRAPHICS_API_OPENGL_11) || defined(GRAPHICS_API_OPENGL_33)
+ // NOTE: glPolygonMode() not available on OpenGL ES
+ glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
+ glEnable(GL_PROGRAM_POINT_SIZE);
+#endif
+}
// Disable wire mode
void rlDisableWireMode(void)
{