- Timestamp:
- 08/25/15 18:47:28 (10 years ago)
- Location:
- trunk/src/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_context.cc
r406 r462 121 121 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 122 122 unsigned gl_type = texture_type_to_enum( tinfo->type ); 123 124 123 if ( tinfo ) 125 124 { … … 141 140 { 142 141 glBindFramebuffer( GL_FRAMEBUFFER, info->glid ); 143 if ( info->depth_rb_glid ) glDeleteRenderbuffers( 1, &(info->depth_rb_glid) ); 142 if ( info->depth_rb_glid ) 143 glDeleteRenderbuffers( 1, &(info->depth_rb_glid) ); 144 144 glGenRenderbuffers( 1, &(info->depth_rb_glid) ); 145 145 glBindRenderbuffer( GL_RENDERBUFFER, info->depth_rb_glid ); … … 165 165 bool nv::gl_context::check( framebuffer_slot ft ) 166 166 { 167 glDrawBuffer( 0 ); 168 glReadBuffer( 0 ); 167 169 if ( is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_OBJECT ) && is_gl_extension_loaded( GL_EXT_FRAMEBUFFER_BLIT ) ) 168 170 { … … 185 187 NV_LOG_ERROR( "gl_context::check : Framebuffer extensions not loaded!" ); 186 188 } 189 glDrawBuffer( GL_BACK ); 190 glReadBuffer( GL_BACK ); 187 191 return false; 188 192 } … … 592 596 if ( m_render_state.culling.face != cull.face ) 593 597 { 594 glCullFace( culling_face_type_to_enum( cull.face) );598 glCullFace( culling_face_type_to_enum( cull.face ) ); 595 599 m_render_state.culling.face = cull.face; 596 600 } 597 598 if ( m_render_state.culling.order != cull.order ) 599 {600 glFrontFace( culling_order_type_to_enum( cull.order ) );601 m_render_state.culling.order = cull.order;602 }601 } 602 603 if ( m_render_state.culling.order != cull.order ) 604 { 605 glFrontFace( culling_order_type_to_enum( cull.order ) ); 606 m_render_state.culling.order = cull.order; 603 607 } 604 608 } … … 688 692 load_gl_extensions( GL_EXT_FRAMEBUFFER_BLIT | GL_EXT_FRAMEBUFFER_OBJECT ); 689 693 force_apply_render_state( m_render_state ); 694 690 695 } 691 696 -
trunk/src/gl/gl_enum.cc
r461 r462 185 185 case BGRA : return GL_BGRA; 186 186 case RED : return GL_RED; 187 case DEPTH16 : return GL_DEPTH_COMPONENT; 188 case DEPTH24 : return GL_DEPTH_COMPONENT; 189 case DEPTH32 : return GL_DEPTH_COMPONENT; 187 190 NV_RETURN_COVERED_DEFAULT( 0 ); 188 191 } … … 202 205 case BGRA : return GL_RGBA8; 203 206 case RED : return 0x8040; // GL_LUMINANCE8; // TODO: change to GL_R8! 204 207 case DEPTH16 : return GL_DEPTH_COMPONENT16; 208 case DEPTH24 : return GL_DEPTH_COMPONENT24; 209 case DEPTH32: return GL_DEPTH_COMPONENT32; 205 210 NV_RETURN_COVERED_DEFAULT( 0 ); 206 211 }
Note: See TracChangeset
for help on using the changeset viewer.