3 #include <ivorium_config.hpp>
27 this->_texture_ids.fill( 0 );
33 this->ClearDepthBuffer();
37 glActiveTexture( GL_TEXTURE0 );
38 this->_texture_unit = 0;
39 this->_texture_ids.fill( 0 );
40 this->_program_id = 0;
54 return this->_geometry;
62 if( this->_texture_unit != texture_unit )
64 this->_texture_unit = texture_unit;
65 glActiveTexture( GL_TEXTURE0 + texture_unit );
68 if( this->_texture_ids[ texture_unit ] != texture_id )
70 this->_texture_ids[ texture_unit ] = texture_id;
71 glBindTexture( GL_TEXTURE_2D, texture_id );
77 if( this->_program_id != program_id )
78 this->_program_id = program_id,
79 glUseProgram( program_id );
84 #if IV_GLPLATFORM_GLFW
85 glClearDepth( value );
86 #elif IV_GLPLATFORM_GLFM
87 glClearDepthf( value );
89 #error "Unknown OpenGL platform."
91 glClear( GL_DEPTH_BUFFER_BIT );
96 if( test_condition == GL_ALWAYS && !write_enabled )
98 glDisable( GL_DEPTH_TEST );
102 glEnable( GL_DEPTH_TEST );
104 glDepthFunc( test_condition );
107 glDepthMask( GL_TRUE );
109 glDepthMask( GL_FALSE );
116 glEnable( GL_BLEND );
118 glDisable( GL_BLEND );
121 void RenderTarget::ClearDepthBuffer()
123 glClear( GL_DEPTH_BUFFER_BIT );