diff options
| author | raysan5 <raysan5@gmail.com> | 2016-05-29 11:49:13 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-05-29 11:49:13 +0200 |
| commit | ea5b00528b0cb1e5cc1e7169a195b75915c8607a (patch) | |
| tree | 293f5c6132973e211c0cdefc006097b67a02774d /src/rlgl.c | |
| parent | 27df983ee0ab72917756b95b49fb31319a6d813f (diff) | |
| download | raylib-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.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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 } |
