diff options
| author | Ray <raysan5@gmail.com> | 2015-07-28 17:38:37 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2015-07-28 17:38:37 +0200 |
| commit | 8b3a82688e82922819d24494c08e24570c03bdc4 (patch) | |
| tree | 1df1379dfc4948477b664023d2ce0100d83d1783 /src/core.c | |
| parent | a59433e7a3b22d5ded7505689fb44f1927194077 (diff) | |
| parent | 067b884f395b7b6d4c179cb3d58b0d17a02950ec (diff) | |
| download | raylib-8b3a82688e82922819d24494c08e24570c03bdc4.tar.gz raylib-8b3a82688e82922819d24494c08e24570c03bdc4.zip | |
Merge pull request #24 from raysan5/develop
Integrate Develop branch
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 46 |
1 files changed, 5 insertions, 41 deletions
@@ -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 @@ -606,7 +603,7 @@ Color GetColor(int hexValue) // Returns hexadecimal value for a Color int GetHexValue(Color color) { - return ((color.a << 24) + (color.r << 16) + (color.g << 8) + color.b); + return (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a); } // Returns a random value between min and max (both included) @@ -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); |
