Changeset 326 for trunk/src/gl/gl_device.cc
- Timestamp:
- 08/26/14 18:39:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r323 r326 7 7 #include "nv/gl/gl_window.hh" 8 8 #include "nv/core/logging.hh" 9 #include "nv/lib/sdl.hh"10 9 #include "nv/lib/sdl_image.hh" 11 10 #include "nv/gl/gl_enum.hh" … … 14 13 using namespace nv; 15 14 16 window* gl_device::create_window( uint16 width, uint16 height, bool fullscreen )17 {18 return new gl_window( this, width, height, fullscreen );19 }20 21 window* nv::gl_device::adopt_window( void* sys_w_handle, void* sys_dc )22 {23 return new gl_window( this, sys_w_handle, sys_dc );24 }25 26 27 28 15 gl_device::gl_device() 29 16 { 30 nv::load_sdl_library();31 m_info = NULL;32 33 if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_JOYSTICK ) < 0 )34 {35 NV_LOG( LOG_CRITICAL, "Video initialization failed: " << SDL_GetError( ) );36 return; // TODO: Error report37 }38 39 #if NV_SDL_VERSION == NV_SDL_1240 m_info = SDL_GetVideoInfo( );41 42 if ( !m_info )43 {44 NV_LOG( LOG_CRITICAL, "Video query failed: " << SDL_GetError( ) );45 return; // TODO: Error report46 }47 #endif48 49 17 m_shader_header = "#version 120\n"; 50 18 for ( auto& i : get_uniform_factory() ) … … 67 35 // this is a temporary function that will be removed once we find a way to 68 36 // pass binary file data around 69 image_data* nv::gl_device::create_image_data( const std::string& filename )37 image_data* gl_device::create_image_data( const std::string& filename ) 70 38 { 71 39 load_sdl_image_library(); … … 83 51 } 84 52 85 uint32 gl_device::get_ticks()86 {87 return SDL_GetTicks();88 }89 90 void gl_device::delay( uint32 ms )91 {92 return SDL_Delay( ms );93 }94 53 95 54 gl_device::~gl_device() … … 101 60 while ( m_programs.size() > 0 ) 102 61 release( m_programs.get_handle(0) ); 103 SDL_Quit();104 62 } 105 63
Note: See TracChangeset
for help on using the changeset viewer.