14 static int gl_initialized = 0;
16 void ogl_do_fullscreen_internal(void){
21 screen = SDL_GetVideoSurface();
22 SDL_WM_ToggleFullScreen(screen);
27 inline void ogl_swap_buffers_internal(void){
30 int ogl_init_window(int x, int y){
36 if (SDL_Init(SDL_INIT_VIDEO) < 0)
38 Error("SDL library video initialisation failed: %s.",SDL_GetError());
40 video_flags = SDL_OPENGL;
42 if (ogl_fullscreen) video_flags |= SDL_FULLSCREEN;
44 SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
45 SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
46 SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
47 // SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
48 SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, bpp );
49 SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
51 if ( SDL_SetVideoMode( x, y, bpp, video_flags ) == NULL ) {
52 fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
58 printf( "Vendor : %s\n", glGetString( GL_VENDOR ) );
59 printf( "Renderer : %s\n", glGetString( GL_RENDERER ) );
60 printf( "Version : %s\n", glGetString( GL_VERSION ) );
61 printf( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) );
67 void ogl_destroy_window(void){
77 #endif // SDL_GL_VIDEO