summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-09-15 11:30:20 +0200
committerraysan5 <[email protected]>2020-09-15 11:30:20 +0200
commit0983d7b45c14abb54b70551f17c69a287e9d6e40 (patch)
treec08e056f0cb132ac055513276d693bd752c7720e /src
parent8cf0be4b6ce3a3cd04bdbc44ecfa3c2a304a891a (diff)
downloadraylib-0983d7b45c14abb54b70551f17c69a287e9d6e40.tar.gz
raylib-0983d7b45c14abb54b70551f17c69a287e9d6e40.zip
Solved issues when compiled for OpenGL 1.1
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index ce4be292..a2c81a6c 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1765,11 +1765,7 @@ void rlglInit(int width, int height)
glShadeModel(GL_SMOOTH); // Smooth shading between vertex (vertex colors interpolation)
#endif
- // Init state: Color/Depth buffers clear
- glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black)
- glClearDepth(1.0f); // Set clear depth value (default)
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D)
-
+#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
// Store screen size into global variables
RLGL.State.framebufferWidth = width;
RLGL.State.framebufferHeight = height;
@@ -1779,6 +1775,12 @@ void rlglInit(int width, int height)
RLGL.State.shapesTextureRec = (Rectangle){ 0.0f, 0.0f, 1.0f, 1.0f };
TRACELOG(LOG_INFO, "RLGL: Default state initialized successfully");
+#endif
+
+ // Init state: Color/Depth buffers clear
+ glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set clear color (black)
+ glClearDepth(1.0f); // Set clear depth value (default)
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear color and depth buffers (depth buffer required for 3D)
}
// Vertex Buffer Object deinitialization (memory free)
@@ -1880,9 +1882,11 @@ void rlSetDebugMarker(const char *text)
// Set blending mode factor and equation
void rlSetBlendMode(int glSrcFactor, int glDstFactor, int glEquation)
{
+#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
RLGL.State.glBlendSrcFactor = glSrcFactor;
RLGL.State.glBlendDstFactor = glDstFactor;
RLGL.State.glBlendEquation = glEquation;
+#endif
}
// Load OpenGL extensions
@@ -3604,6 +3608,7 @@ Texture2D GenTextureBRDF(Shader shader, int size)
// NOTE: Only 3 blending modes supported, default blend mode is alpha
void BeginBlendMode(int mode)
{
+#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
if (RLGL.State.currentBlendMode != mode)
{
rlglDraw();
@@ -3621,6 +3626,7 @@ void BeginBlendMode(int mode)
RLGL.State.currentBlendMode = mode;
}
+#endif
}
// End blending mode (reset to default: alpha blending)