Changeset 520 for trunk/src/gl


Ignore:
Timestamp:
10/03/16 17:45:46 (9 years ago)
Author:
epyon
Message:
  • ecs updates
  • animation updates
  • ragdoll manager
  • lua has own random engine
  • several minor fixes
  • particle engine/particle group
  • shitload of other stuff
  • bullet world
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_context.cc

    r515 r520  
    125125        }
    126126}
     127
     128nv::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
    127139
    128140const framebuffer_info* nv::gl_context::get_framebuffer_info( framebuffer f ) const
Note: See TracChangeset for help on using the changeset viewer.