Changeset 534 for trunk/src/gl


Ignore:
Timestamp:
01/12/17 14:41:17 (8 years ago)
Author:
epyon
Message:

CONTINUED:

  • getting rid of size_t
  • datatypes now restricted to uint32 size
  • 64-bit compatibility
  • copyright updates where modified
Location:
trunk/src/gl
Files:
2 edited

Legend:

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

    r523 r534  
    1 // Copyright (C) 2012-2015 ChaosForge Ltd
     1// Copyright (C) 2012-2017 ChaosForge Ltd
    22// http://chaosforge.org/
    33//
     
    311311}
    312312
    313 void nv::gl_context::bind( buffer b, uint32 index, size_t offset /*= 0*/, size_t size /*= 0 */ )
     313void nv::gl_context::bind( buffer b, uint32 index, uint32 offset /*= 0*/, uint32 size /*= 0 */ )
    314314{
    315315        const gl_buffer_info* info = static_cast< const gl_buffer_info* >( m_device->get_buffer_info( b ) );
     
    465465}
    466466
    467 void* nv::gl_context::map_buffer( buffer b, buffer_access ba, size_t offset, size_t length )
     467void* nv::gl_context::map_buffer( buffer b, buffer_access ba, uint32 offset, uint32 length )
    468468{
    469469        const gl_buffer_info* info = static_cast<const gl_buffer_info*>( m_device->get_buffer_info( b ) );
     
    492492}
    493493
    494 // void nv::gl_context::update( buffer b, uint32 index, const void* data, size_t offset, size_t size )
     494// void nv::gl_context::update( buffer b, uint32 index, const void* data, uint32 offset, uint32 size )
    495495// {
    496496//      const gl_buffer_info* info = static_cast<const gl_buffer_info*>( m_device->get_buffer_info( b ) );
     
    506506// }
    507507
    508 void gl_context::update( buffer b, const void* data, nv::size_t offset, nv::size_t size )
     508void gl_context::update( buffer b, const void* data, nv::uint32 offset, nv::uint32 size )
    509509{
    510510        const gl_buffer_info* info = static_cast< const gl_buffer_info* >( m_device->get_buffer_info( b ) );
     
    10201020}
    10211021
    1022 nv::buffer nv::gl_context::create_buffer( buffer_type type, buffer_hint hint, size_t size, const void* source /*= nullptr */ )
     1022nv::buffer nv::gl_context::create_buffer( buffer_type type, buffer_hint hint, uint32 size, const void* source /*= nullptr */ )
    10231023{
    10241024        buffer result = static_cast<gl_device*>( m_device )->create_buffer( type, hint );
     
    10271027}
    10281028
    1029 void nv::gl_context::create_buffer( buffer b, size_t size, const void* source /*= nullptr */ )
     1029void nv::gl_context::create_buffer( buffer b, uint32 size, const void* source /*= nullptr */ )
    10301030{
    10311031        gl_buffer_info* info = static_cast<gl_device*>( m_device )->get_full_buffer_info( b );
     
    10671067}
    10681068
    1069 void gl_context::draw( primitive prim, const render_state& rs, program p, vertex_array va, nv::size_t count, nv::size_t first )
     1069void gl_context::draw( primitive prim, const render_state& rs, program p, vertex_array va, nv::uint32 count, nv::uint32 first )
    10701070{
    10711071        apply_render_state( rs );
     
    10771077                if ( info->index.is_valid() )
    10781078                {
    1079                         glDrawElements( primitive_to_enum(prim), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast< const void* >( get_datatype_info( info->index_type ).size * first ) );
     1079                        glDrawElements( primitive_to_enum(prim), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast< const void* >( size_t( get_datatype_info( info->index_type ).size * first ) ) );
    10801080                }
    10811081                else
     
    10881088}
    10891089
    1090 void nv::gl_context::draw_instanced( primitive prim, const render_state& rs, program p, size_t instances, vertex_array va, size_t count, size_t first /*= 0 */ )
     1090void nv::gl_context::draw_instanced( primitive prim, const render_state& rs, program p, uint32 instances, vertex_array va, uint32 count, uint32 first /*= 0 */ )
    10911091{
    10921092        apply_render_state( rs );
     
    10981098                if ( info->index.is_valid() )
    10991099                {
    1100                         glDrawElementsInstanced( primitive_to_enum( prim ), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast<const void*>( get_datatype_info( info->index_type ).size * first ), instances );
     1100                        glDrawElementsInstanced( primitive_to_enum( prim ), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast<const void*>( size_t( get_datatype_info( info->index_type ).size * first ) ), instances );
    11011101                }
    11021102                else
  • trunk/src/gl/gl_device.cc

    r533 r534  
    1 // Copyright (C) 2012-2015 ChaosForge Ltd
     1// Copyright (C) 2012-2017 ChaosForge Ltd
    22// http://chaosforge.org/
    33//
Note: See TracChangeset for help on using the changeset viewer.