aboutsummaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2015-07-13 18:20:16 +0200
committerraysan5 <raysan5@gmail.com>2015-07-13 18:20:16 +0200
commit552033da27ddeac2c8e9dd6b8ad33b7058963ef6 (patch)
treed9e7f1a07e66d986e43a5f7c099810614b9e9c64 /src/core.c
parent66556b8b479e998dc022fa9c884eb39fae1479f7 (diff)
downloadraylib-552033da27ddeac2c8e9dd6b8ad33b7058963ef6.tar.gz
raylib-552033da27ddeac2c8e9dd6b8ad33b7058963ef6.zip
Move shaders functions to module rlgl
Shader functionality owns to rlgl, not core module
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/src/core.c b/src/core.c
index 301d9e6e..1cdcd679 100644
--- a/src/core.c
+++ b/src/core.c
@@ -192,9 +192,6 @@ static double targetTime = 0.0; // Desired time for one frame, if 0
static char configFlags = 0;
static bool showLogo = false;
-// Shaders variables
-static bool enabledPostpro = false;
-
//----------------------------------------------------------------------------------
// Other Modules Functions Declaration (required by core)
//----------------------------------------------------------------------------------
@@ -468,7 +465,7 @@ int GetScreenHeight(void)
// Sets Background Color
void ClearBackground(Color color)
{
- // TODO: Review "clearing area", full framebuffer vs render area
+ // Clear full framebuffer (not only render area) to color
rlClearColor(color.r, color.g, color.b, color.a);
}
@@ -479,7 +476,7 @@ void BeginDrawing(void)
updateTime = currentTime - previousTime;
previousTime = currentTime;
- if (enabledPostpro) rlEnableFBO();
+ if (IsPosproShaderEnabled()) rlEnableFBO();
rlClearScreenBuffers();
@@ -496,7 +493,7 @@ void EndDrawing(void)
{
rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2)
- if (enabledPostpro) rlglDrawPostpro(); // Draw postprocessing effect (shader)
+ if (IsPosproShaderEnabled()) rlglDrawPostpro(); // Draw postprocessing effect (shader)
SwapBuffers(); // Copy back buffer to front buffer
@@ -970,39 +967,6 @@ Vector2 GetTouchPosition(void)
}
#endif
-// Set postprocessing shader
-void SetPostproShader(Shader shader)
-{
- if (rlGetVersion() == OPENGL_11) TraceLog(WARNING, "Postprocessing shaders not supported on OpenGL 1.1");
- else
- {
- if (!enabledPostpro)
- {
- enabledPostpro = true;
- rlglInitPostpro();
- rlglSetPostproShader(shader);
- }
- else
- {
- rlglSetPostproShader(shader);
- }
- }
-}
-
-// Set custom shader to be used in batch draw
-void SetCustomShader(Shader shader)
-{
- rlglSetCustomShader(shader);
-}
-
-// Set default shader to be used in batch draw
-void SetDefaultShader(void)
-{
- rlglSetDefaultShader();
-
- enabledPostpro = false;
-}
-
//----------------------------------------------------------------------------------
// Module specific Functions Definition
//----------------------------------------------------------------------------------
@@ -1579,7 +1543,7 @@ static void PollInputEvents(void)
// Poll Events (registered events)
// TODO: Enable/disable activityMinimized to block activity if minimized
//while ((ident = ALooper_pollAll(activityMinimized ? 0 : -1, NULL, &events,(void**)&source)) >= 0)
- while ((ident = ALooper_pollAll(0, NULL, &events,(void**)&source)) >= 0)
+ while ((ident = ALooper_pollAll(0, NULL, &events, (void**)&source)) >= 0)
{
// Process this event
if (source != NULL) source->process(app, source);