Changeset 343


Ignore:
Timestamp:
10/09/14 18:05:29 (11 years ago)
Author:
epyon
Message:
  • temporary functions for swap control, will be substituted with a proper configuration later
Location:
trunk
Files:
4 edited

Legend:

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

    r326 r343  
    3131                virtual uint16 get_height() const { return m_height; }
    3232                virtual string get_title() const  { return std::string(); }
     33                // TODO : implement?
     34                virtual void set_swap_control( bool ) {};
     35
    3336                virtual bool is_event_pending()            { return m_input->is_event_pending(); }
    3437                virtual bool poll_event( io_event& event ) { return m_input->poll_event( event ); }
  • trunk/nv/interface/window.hh

    r326 r343  
    3131                virtual context* get_context() = 0;
    3232                virtual bool is_event_pending() = 0;
     33                // TODO: there should be a general options mechanism
     34                virtual void set_swap_control( bool ) = 0;
    3335                virtual bool poll_event( io_event& event ) = 0;
    3436                virtual void swap_buffers() = 0;
  • trunk/nv/sdl/sdl_window.hh

    r326 r343  
    3434                        virtual uint16 get_height() const { return m_height; }
    3535                        virtual string get_title() const  { return m_title; }
     36                        virtual void set_swap_control( bool enabled );
    3637                        virtual bool is_event_pending()            { return m_input->is_event_pending(); }
    3738                        virtual bool poll_event( io_event& event ) { return m_input->poll_event( event ); }
  • trunk/src/sdl/sdl_window.cc

    r340 r343  
    6565        NV_LOG( LOG_INFO, "OpenGL Version      : " << glGetString(GL_VERSION) );
    6666        NV_LOG( LOG_INFO, "OpenGL GLSL Version : " << glGetString(GL_SHADING_LANGUAGE_VERSION) );
    67         //SDL_GL_SetSwapInterval(0);
     67        SDL_GL_SetSwapInterval(1);
    6868
    6969        // TODO: do we really need this?
     
    9797        SDL_DestroyWindow( static_cast<SDL_Window*>( m_handle ) );
    9898}
     99
     100void nv::sdl::window::set_swap_control( bool enabled )
     101{
     102        SDL_GL_SetSwapInterval( enabled ? 1 : 0 );
     103}
Note: See TracChangeset for help on using the changeset viewer.