Changeset 299 for trunk/src/gui


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/gui/gui_renderer.cc

    r281 r299  
    6565{
    6666public:
    67         screen_render_data( device* dev, size_t initial_size )
    68                 : buffer( dev, nv::DYNAMIC_DRAW, initial_size ), varray( nullptr ), shader(nullptr), texture(nullptr)
     67        screen_render_data( context* ctx, size_t initial_size )
     68                : buffer( ctx, nv::DYNAMIC_DRAW, initial_size ), varray( nullptr ), shader(nullptr), texture(nullptr)
    6969        {
    7070
     
    9898        , m_reupload( true )
    9999{
     100        m_context = w->get_context();
    100101        m_area.dim( dimension( w->get_width(), w->get_height() ) );
    101102        region white = m_atlas.get_region( ivec2(3,3) );
     
    107108        delete[] wfill;
    108109
    109         screen_render_data* sr = new screen_render_data( w->get_device(), 1024 );
     110        screen_render_data* sr = new screen_render_data( w->get_context(), 1024 );
    110111        m_render_data = sr;
    111112        // ** EXTREMELY TEMPORARY!
     
    261262        if ( m_reupload )
    262263        {
    263                 sr->texture->assign( (void*)m_atlas.get_data() );
     264                m_context->update( sr->texture, (void*)m_atlas.get_data() );
    264265                m_reupload = false;
    265266        }
     
    272273                sr->varray->update_vertex_buffer( nv::slot::COLOR,    vb, false );
    273274        }
    274         sr->texture->bind( nv::TEX_DIFFUSE );
    275         m_window->get_context()->draw( TRIANGLES, m_render_state, m_scene_state, sr->shader, sr->varray, sr->buffer.get_size() * 6 );
     275        m_context->bind( sr->texture, TEX_DIFFUSE );
     276        m_context->draw( TRIANGLES, m_render_state, m_scene_state, sr->shader, sr->varray, sr->buffer.get_size() * 6 );
    276277}
    277278
Note: See TracChangeset for help on using the changeset viewer.