Ignore:
Timestamp:
08/07/14 10:10:24 (11 years ago)
Author:
epyon
Message:
  • all bind and update function for graphics objects are done via context (will simplify directx device, and allow for handles instead of objects)
File:
1 edited

Legend:

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

    r296 r299  
    1111
    1212
    13 nv::skeletal_mesh_cpu::skeletal_mesh_cpu( device* a_device, const mesh_data* a_mesh_data, const mesh_nodes_data* bones )
     13nv::skeletal_mesh_cpu::skeletal_mesh_cpu( context* a_context, const mesh_data* a_mesh_data, const mesh_nodes_data* bones )
    1414        : skeletal_mesh()
     15        , m_context( a_context )
    1516        , m_data( a_mesh_data )
    1617{
     
    2627        m_vtx_data  = a_mesh_data->get_channel_data<md5_vtx_pntiw>();
    2728        m_indices   = a_mesh_data->get_count();
    28         m_va        = a_device->create_vertex_array( a_mesh_data, nv::STREAM_DRAW );
     29        m_va        = a_context->get_device()->create_vertex_array( a_mesh_data, nv::STREAM_DRAW );
    2930}
    3031
     
    6364
    6465                vertex_buffer* vb = m_va->find_buffer( nv::slot::POSITION );
    65                 vb->bind();
    66                 vb->update( m_pntdata.data(), 0, m_pntdata.raw_size() );
    67                 vb->unbind();
     66                m_context->update( vb, m_pntdata.data(), 0, m_pntdata.raw_size() );
    6867        }
    6968}
     
    200199}
    201200
    202 nv::skeletal_mesh_gpu::skeletal_mesh_gpu( device* a_device, const mesh_data* a_mesh, const mesh_nodes_data* a_bone_data )
     201nv::skeletal_mesh_gpu::skeletal_mesh_gpu( context* a_context, const mesh_data* a_mesh, const mesh_nodes_data* a_bone_data )
    203202        : skeletal_mesh(), m_bone_data( a_bone_data ), m_transform( nullptr )
    204203{
    205         m_va          = a_device->create_vertex_array( a_mesh, nv::STATIC_DRAW );
     204        m_va          = a_context->get_device()->create_vertex_array( a_mesh, nv::STATIC_DRAW );
    206205        m_index_count = a_mesh->get_count();
    207206        if ( m_bone_data )
Note: See TracChangeset for help on using the changeset viewer.