2 * $Source: /cvs/cvsroot/d2x/arch/ogl/sdlgl.c,v $
5 * $Date: 2001-10-25 08:25:34 $
7 * Graphics functions for SDL-GL.
9 * $Log: not supported by cvs2svn $
10 * Revision 1.4 2001/10/09 08:17:07 bradleyb
11 * changed window caption to include version info
13 * Revision 1.3 2001/10/09 02:58:20 bradleyb
14 * Added window caption, hide mouse cursor
16 * Revision 1.2 2001/01/29 13:47:52 bradleyb
17 * Fixed build, some minor cleanups.
35 static int gl_initialized = 0;
37 void ogl_do_fullscreen_internal(void){
42 screen = SDL_GetVideoSurface();
43 SDL_WM_ToggleFullScreen(screen);
48 inline void ogl_swap_buffers_internal(void){
51 int ogl_init_window(int x, int y){
57 if (SDL_Init(SDL_INIT_VIDEO) < 0)
59 Error("SDL library video initialisation failed: %s.",SDL_GetError());
61 video_flags = SDL_OPENGL;
63 if (ogl_fullscreen) video_flags |= SDL_FULLSCREEN;
65 SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
66 SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
67 SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
68 // SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 1 );
69 SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, bpp );
70 SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
72 SDL_WM_SetCaption(DESCENT_VERSION, "Descent II");
74 if ( SDL_SetVideoMode( x, y, bpp, video_flags ) == NULL ) {
75 fprintf(stderr, "Couldn't set GL mode: %s\n", SDL_GetError());
82 printf( "Vendor : %s\n", glGetString( GL_VENDOR ) );
83 printf( "Renderer : %s\n", glGetString( GL_RENDERER ) );
84 printf( "Version : %s\n", glGetString( GL_VERSION ) );
85 printf( "Extensions : %s\n", glGetString( GL_EXTENSIONS ) );
91 void ogl_destroy_window(void){