aboutsummaryrefslogtreecommitdiff
path: root/src/rlgl.c
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-05-29 11:49:13 +0200
committerraysan5 <raysan5@gmail.com>2016-05-29 11:49:13 +0200
commitea5b00528b0cb1e5cc1e7169a195b75915c8607a (patch)
tree293f5c6132973e211c0cdefc006097b67a02774d /src/rlgl.c
parent27df983ee0ab72917756b95b49fb31319a6d813f (diff)
downloadraylib-ea5b00528b0cb1e5cc1e7169a195b75915c8607a.tar.gz
raylib-ea5b00528b0cb1e5cc1e7169a195b75915c8607a.zip
Improved render to texture
Support render texture size different than screen size
Diffstat (limited to 'src/rlgl.c')
-rw-r--r--src/rlgl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index d319119f..cc4c4c2f 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -404,6 +404,12 @@ void rlOrtho(double left, double right, double bottom, double top, double near,
#endif
+// Set the viewport area (trasnformation from normalized device coordinates to window coordinates)
+void rlViewport(int x, int y, int width, int height)
+{
+ glViewport(x, y, width, height);
+}
+
//----------------------------------------------------------------------------------
// Module Functions Definition - Vertex level operations
//----------------------------------------------------------------------------------
@@ -725,17 +731,25 @@ void rlDisableTexture(void)
#endif
}
+// Enable rendering to texture (fbo)
void rlEnableRenderTexture(unsigned int id)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glBindFramebuffer(GL_FRAMEBUFFER, id);
+
+ //glDisable(GL_CULL_FACE); // Allow double side drawing for texture flipping
+ //glCullFace(GL_FRONT);
#endif
}
+// Disable rendering to texture
void rlDisableRenderTexture(void)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
glBindFramebuffer(GL_FRAMEBUFFER, 0);
+
+ //glEnable(GL_CULL_FACE);
+ //glCullFace(GL_BACK);
#endif
}