Opengl Code Generator

Screen width:
Screen height:
Name:
Width:
Height:
Texture Z:
Texture 0:
Texture 1:
Texture 2:
Texture 3:
Texture 4:
Texture 5:
Texture 6:
Texture 7:
Texture 8:
Texture 9:
Texture 10:
Texture 11:
Texture 12:
Texture 13:
Texture 14:
Texture 15:
Texture 16:
Texture 17:
Texture 18:
Texture 19:
Texture 20:
Texture 21:
Texture 22:
Texture 23:
Texture 24:
Texture 25:
Texture 26:
Texture 27:
Texture 28:
Texture 29:
Texture 30:
Texture 31:

GLuint framebuffer1;
extern GLuint textureZ;

// ...

/// init
glGenFramebuffers( 1, &framebuffer1 );
glBindFramebuffer( GL_FRAMEBUFFER, framebuffer1 );
glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, textureZ );

// ...

/// render
glBindFramebuffer( GL_FRAMEBUFFER, framebuffer1 );
glViewport( 0, 0, 1024, 1024 );
///@todo ... render your stuff ...
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
glViewport( 0, 0, 1920, 1080 );

// ...

/// shutdown
glDeleteFramebuffers( 1, &framebuffer1 );
framebuffer1= 0;