2 * $Source: /cvs/cvsroot/d2x/video/ogl_sdl.c,v $
5 * $Date: 2001-01-29 13:47:52 $
7 * Graphics functions for SDL-GL.
9 * $Log: not supported by cvs2svn $
26 static int gl_initialized = 0;
28 void ogl_do_fullscreen_internal(void){
33 screen = SDL_GetVideoSurface();
34 SDL_WM_ToggleFullScreen(screen);
39 inline void ogl_swap_buffers_internal(void){
42 int ogl_init_window(int x, int y){
48 if (SDL_Init(SDL_INIT_VIDEO) < 0)
50 Error("SDL library video initialisation failed: %s.",SDL_GetError());
52 video_flags = SDL_OPENGL;
54 if (ogl_fullscreen) video_flags |= SDL_FULLSCREEN;
56 SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
57 SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
58 SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
59 // SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
60 SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, bpp );
61 SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
63 if ( SDL_SetVideoMode( x, y, bpp, video_flags ) == NULL ) {
64 fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
70 printf( "Vendor : %s\n", glGetString( GL_VENDOR ) );
71 printf( "Renderer : %s\n", glGetString( GL_RENDERER ) );
72 printf( "Version : %s\n", glGetString( GL_VERSION ) );
73 printf( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) );
79 void ogl_destroy_window(void){