Changeset 520 for trunk/src/gl
- Timestamp:
- 10/03/16 17:45:46 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_context.cc
r515 r520 125 125 } 126 126 } 127 128 nv::image_data* nv::gl_context::dump_image( image_format f, image_data* reuse ) 129 { 130 NV_ASSERT_ALWAYS( f.type == nv::UBYTE, "Bad format passed to dump" ); 131 NV_ASSERT_ALWAYS( f.format == nv::RGB || f.format == nv::RGBA, "Bad format passed to dump" ); 132 glPixelStorei( GL_PACK_ALIGNMENT, 1 ); 133 image_data* result = reuse; 134 if ( !result ) result = new image_data( f, ivec2( m_viewport.z, m_viewport.w ) ); 135 glReadPixels( 0, 0, m_viewport.z, m_viewport.w, f.format == nv::RGB ? GL_RGB : GL_RGBA, datatype_to_gl_enum( f.type ), const_cast< uint8* >( result->get_data() ) ); 136 return result; 137 } 138 127 139 128 140 const framebuffer_info* nv::gl_context::get_framebuffer_info( framebuffer f ) const
Note: See TracChangeset
for help on using the changeset viewer.