src/video/ataricommon/SDL_atarigl_c.h
author Patrice Mandin <patmandin@gmail.com>
Thu, 25 Nov 2004 15:47:49 +0000
changeset 989 475166d13b44
child 991 12b13601a544
permissions -rw-r--r--
Factorize OSMesa OpenGL code for Atari drivers
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2004 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Library General Public
     7     License as published by the Free Software Foundation; either
     8     version 2 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Library General Public License for more details.
    14 
    15     You should have received a copy of the GNU Library General Public
    16     License along with this library; if not, write to the Free
    17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 /* Atari OSMesa.ldg implementation of SDL OpenGL support */
    24 
    25 #ifndef _SDL_ATARIGL_H_
    26 #define _SDL_ATARIGL_H_
    27 
    28 #ifdef HAVE_OPENGL
    29 #include <GL/osmesa.h>
    30 #endif
    31 
    32 #include "SDL_sysvideo.h"
    33 #define _THIS   SDL_VideoDevice *this
    34 
    35 struct SDL_PrivateGLData {
    36 	/* to stop switching drivers while we have a valid context */
    37     int gl_active; 
    38 
    39 	/* for unsupported OSMesa buffer formats */
    40 	void (*ConvertSurface)(SDL_Surface *surface);	
    41 
    42 #ifdef HAVE_OPENGL
    43 	OSMesaContext	ctx;
    44 #endif
    45 };
    46 
    47 /* Old variable names */
    48 #define gl_active	(this->gl_data->gl_active)
    49 #define gl_ctx		(this->gl_data->ctx)
    50 #define gl_convert	(this->gl_data->ConvertSurface)
    51 
    52 /* OpenGL functions */
    53 extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current);
    54 extern void SDL_AtariGL_Quit(_THIS);
    55 
    56 extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
    57 extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
    58 extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
    59 extern int SDL_AtariGL_MakeCurrent(_THIS);
    60 extern void SDL_AtariGL_SwapBuffers(_THIS);
    61 
    62 #endif /* _SDL_ATARIGL_H_ */