Changeset 303 for trunk/src/gfx


Ignore:
Timestamp:
08/08/14 13:18:41 (11 years ago)
Author:
epyon
Message:
  • program is now handle-based
  • all device constructs are now handle-based and do not dynamically allocate
Location:
trunk/src/gfx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gfx/debug_draw.cc

    r302 r303  
    2929
    3030nv::debug_data::debug_data( device* a_device )
    31         : m_device( a_device ), m_program( nullptr ), m_va()
     31        : m_device( a_device ), m_program(), m_va()
    3232{
    3333        m_program = m_device->create_program( nv_debug_draw_vertex_shader, nv_debug_draw_fragment_shader );
     
    7676{
    7777        m_device->release( m_va );
    78         delete m_program;
     78        m_device->release( m_program );
    7979}
  • trunk/src/gfx/keyframed_mesh.cc

    r302 r303  
    9898
    9999
    100 void nv::keyframed_mesh::update( program* a_program )
    101 {
    102         a_program->set_opt_uniform( "nv_interpolate", m_interpolation );
     100void nv::keyframed_mesh::update( program a_program )
     101{
     102        m_context->get_device()->set_opt_uniform( a_program, "nv_interpolate", m_interpolation );
    103103}
    104104
     
    165165}
    166166
    167 void nv::keyframed_mesh_gpu::update( program* a_program )
     167void nv::keyframed_mesh_gpu::update( program a_program )
    168168{
    169169        if ( m_loc_next_position == -1 )
    170170        {
    171                 m_loc_next_position = a_program->get_attribute( "nv_next_position" )->get_location();
    172                 m_loc_next_normal   = a_program->get_attribute( "nv_next_normal" )->get_location();
     171                device* dev = m_context->get_device();
     172                m_loc_next_position = dev->get_attribute_location( a_program, "nv_next_position" );
     173                m_loc_next_normal   = dev->get_attribute_location( a_program, "nv_next_normal" );
    173174                if ( m_has_tangent )
    174                         m_loc_next_tangent  = a_program->get_attribute( "nv_next_tangent" )->get_location();
    175 
    176                 device* dev = m_context->get_device();
     175                        m_loc_next_tangent  = dev->get_attribute_location( a_program, "nv_next_tangent" );
     176
    177177                dev->add_vertex_buffer( m_va, (slot)m_loc_next_position, m_pbuffer, FLOAT, 3, 0, m_vsize, false );
    178178                dev->add_vertex_buffer( m_va, (slot)m_loc_next_normal,   m_pbuffer, FLOAT, 3, sizeof( vec3 ), m_vsize, false );
  • trunk/src/gfx/skeletal_mesh.cc

    r302 r303  
    213213}
    214214
    215 void nv::skeletal_mesh_gpu::update( program* a_program )
     215void nv::skeletal_mesh_gpu::update( program a_program )
    216216{
    217217        if ( m_bone_data )
    218                 a_program->set_opt_uniform_array( "nv_m_bones", m_transform, m_bone_data->get_count() );
     218                m_context->get_device()->set_opt_uniform_array( a_program, "nv_m_bones", m_transform, m_bone_data->get_count() );
    219219}
    220220
Note: See TracChangeset for help on using the changeset viewer.