summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJeffery Myers <[email protected]>2020-12-13 01:58:24 -0800
committerGitHub <[email protected]>2020-12-13 10:58:24 +0100
commit342d4faf14fd428d7797285b3727f0e440879cf3 (patch)
treea6739c668dcc40192d59da86510bf072042ff3a4 /src
parente6ae4879f68f0ec5e4e6cb3841efc8ff110a0e43 (diff)
downloadraylib-342d4faf14fd428d7797285b3727f0e440879cf3.tar.gz
raylib-342d4faf14fd428d7797285b3727f0e440879cf3.zip
Add options to set line width and aliasing to rlGL layer. (#1457)
* Add options to set line width and aliasing to rlGL layer. * Don't do line smoothing in OpenGLES
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 5985c825..f5634a54 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -522,6 +522,10 @@ RLAPI void rlDisableScissorTest(void); // Disable scissor
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 rlSetLineWidth(float width); // Set the line drawing width
+RLAPI float rlGetLineWidth(void); // Get the line drawing width
+RLAPI void rlEnableSmoothLines(void); // Enable line aliasing
+RLAPI void rlDisableSmoothLines(void); // Disable line aliasing
RLAPI void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Clear color buffer with color
RLAPI void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth)
@@ -1479,6 +1483,35 @@ void rlDisableWireMode(void)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
#endif
}
+// Set the line drawing width
+void rlSetLineWidth(float width)
+{
+ glLineWidth(width);
+}
+
+// Get the line drawing width
+float rlGetLineWidth(void)
+{
+ float width = 0;
+ glGetFloatv(GL_LINE_WIDTH, &width);
+ return width;
+}
+
+// Enable line aliasing
+void rlEnableSmoothLines(void)
+{
+#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_11)
+ glEnable(GL_LINE_SMOOTH);
+#endif
+}
+
+// Disable line aliasing
+void rlDisableSmoothLines(void)
+{
+#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_21) || defined(GRAPHICS_API_OPENGL_11)
+ glDisable(GL_LINE_SMOOTH);
+#endif
+}
// Unload framebuffer from GPU memory
// NOTE: All attached textures/cubemaps/renderbuffers are also deleted