Changeset 157 for trunk


Ignore:
Timestamp:
07/08/13 19:59:07 (12 years ago)
Author:
epyon
Message:
  • context now stores device pointer
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/gl/gl_context.hh

    r121 r157  
    2020        {
    2121        public:
    22                 gl_context();
     22                gl_context( device* a_device );
    2323                virtual void clear( const clear_state& cs );
    2424                // temporary
  • trunk/nv/interface/context.hh

    r121 r157  
    3232        };
    3333
     34        class device;
    3435        class context
    3536        {
    3637        public:
     38                context( device* a_device ) { m_device = a_device; }
    3739                virtual void clear( const clear_state& cs ) = 0;
    3840                // temporary
     
    4143                virtual const ivec4& get_viewport() = 0;
    4244                virtual void set_viewport( const ivec4& viewport ) = 0;
     45                virtual device* get_device() { return m_device; }
    4346                virtual ~context() {}
    4447        protected:
     48                device*      m_device;
    4549                clear_state  m_clear_state;
    4650                render_state m_render_state;
  • trunk/src/gl/gl_context.cc

    r121 r157  
    349349
    350350
    351 gl_context::gl_context()
     351gl_context::gl_context( device* a_device )
     352        : context( a_device )
    352353{
    353354        // TODO: do we really need this?
  • trunk/src/gl/gl_window.cc

    r121 r157  
    167167        NV_LOG( LOG_INFO, "OpenGL GLSL Version : " << glGetString(GL_SHADING_LANGUAGE_VERSION) );
    168168
    169         m_context = new gl_context();
     169        m_context = new gl_context( m_device );
    170170        m_context->set_viewport( nv::ivec4( 0, 0, m_width, m_height ) );
    171171}
Note: See TracChangeset for help on using the changeset viewer.