From 1b39b2e2612dfd7613e3bfb6948e8d27472ab8c1 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 14 Dec 2015 23:30:27 +0100 Subject: [PATCH] Added BeginDrawingEx() BeginDrawing() function with extended parameters --- src/core.c | 13 ++++++++++++- src/raylib.h | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/core.c b/src/core.c index b2d945063..3fc8b47d4 100644 --- a/src/core.c +++ b/src/core.c @@ -510,6 +510,17 @@ void BeginDrawing(void) // NOTE: Not required with OpenGL 3.3+ } +// Setup drawing canvas with extended parameters +void BeginDrawingEx(int blendMode, Shader shader, Matrix transform) +{ + BeginDrawing(); + + SetBlendMode(blendMode); + SetPostproShader(shader); + + rlMultMatrixf(GetMatrixVector(transform)); +} + // End canvas drawing and Swap Buffers (Double Buffering) void EndDrawing(void) { @@ -1097,7 +1108,7 @@ static void InitDisplay(int width, int height) if (fullscreen) { // At this point we need to manage render size vs screen size - // NOTE: This function use and modify global module variables: screenWidth/screenHeight and renderWidth/renderHeight and downscaleView + // NOTE: This function uses and modifies global module variables: screenWidth/screenHeight and renderWidth/renderHeight and downscaleView SetupFramebufferSize(displayWidth, displayHeight); window = glfwCreateWindow(renderWidth, renderHeight, windowTitle, glfwGetPrimaryMonitor(), NULL); diff --git a/src/raylib.h b/src/raylib.h index d86554517..daf8133ca 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -442,6 +442,7 @@ int GetScreenHeight(void); // Get current scree void ClearBackground(Color color); // Sets Background Color void BeginDrawing(void); // Setup drawing canvas to start drawing +void BeginDrawingEx(int blendMode, Shader shader, Matrix transform); // Setup drawing canvas with extended parameters void EndDrawing(void); // End canvas drawing and Swap Buffers (Double Buffering) void Begin3dMode(Camera cam); // Initializes 3D mode for drawing (Camera setup) @@ -508,7 +509,7 @@ Vector2 GetTouchPosition(void); // Returns touch positio //------------------------------------------------------------------------------------ // Gestures and Touch Handling Functions (Module: gestures) //------------------------------------------------------------------------------------ -Vector2 GetRawTouchPosition(void); // Gewt touch position (raw) +Vector2 GetRawTouchPosition(void); // Get touch position (raw) #if defined(PLATFORM_WEB) void InitGesturesSystem(void); // Init gestures system (web) #elif defined(PLATFORM_ANDROID)