Changeset 98 for trunk


Ignore:
Timestamp:
06/03/13 16:06:51 (12 years ago)
Author:
epyon
Message:
  • window stores and can return it's device
Location:
trunk
Files:
4 edited

Legend:

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

    r93 r98  
    2222        {
    2323        public:
    24                 gl_window( uint16 width, uint16 height );
     24                gl_window( device* dev, uint16 width, uint16 height );
    2525                uint16 get_width() const;
    2626                uint16 get_height() const;
     
    3030                virtual bool poll_event( io_event& event );
    3131                virtual context* get_context() { return m_context; }
     32                virtual device* get_device() { return m_device; };
     33
    3234                virtual void swap_buffers();
    3335                virtual ~gl_window();
    3436        private:
     37                device*     m_device;
    3538                uint16      m_width;
    3639                uint16      m_height;
  • trunk/nv/interface/window.hh

    r93 r98  
    2020{
    2121        class context;
     22        class device;
    2223        class window
    2324        {
     
    3132                virtual bool poll_event( io_event& event ) = 0;
    3233                virtual void swap_buffers() = 0;
     34                virtual device* get_device() = 0;
    3335                virtual ~window() = 0 {};
    3436        };
  • trunk/src/gl/gl_device.cc

    r92 r98  
    1717window* gl_device::create_window( uint16 width, uint16 height )
    1818{
    19         return new gl_window( width, height );
     19        return new gl_window( this, width, height );
    2020}
    2121
  • trunk/src/gl/gl_window.cc

    r93 r98  
    148148
    149149
    150 gl_window::gl_window( uint16 width, uint16 height )
    151         : m_width( width ), m_height( height ), m_title("NV Engine"), m_screen( nullptr )
     150gl_window::gl_window( device* dev, uint16 width, uint16 height )
     151        : m_device( dev ), m_width( width ), m_height( height ), m_title("NV Engine"), m_screen( nullptr )
    152152{
    153153        int flags = SDL_OPENGL;
Note: See TracChangeset for help on using the changeset viewer.