comparison src/video/ataricommon/SDL_atarigl_c.h @ 991:12b13601a544

Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
author Patrice Mandin <patmandin@gmail.com>
date Fri, 26 Nov 2004 16:16:50 +0000
parents 475166d13b44
children 0324ce32b2d9
comparison
equal deleted inserted replaced
990:8e20c48a9c13 991:12b13601a544
31 31
32 #include "SDL_sysvideo.h" 32 #include "SDL_sysvideo.h"
33 #define _THIS SDL_VideoDevice *this 33 #define _THIS SDL_VideoDevice *this
34 34
35 struct SDL_PrivateGLData { 35 struct SDL_PrivateGLData {
36 /* to stop switching drivers while we have a valid context */ 36
37 int gl_active; 37 int gl_active; /* to stop switching drivers while we have a valid context */
38
39 int gl_oldmesa; /* Old OpenGL support ? */
40
41 int gl_pixelsize; /* for CopyShadow functions */
42
43 Uint8 *gl_shadow; /* Shadow buffer for old implementations */
38 44
39 /* for unsupported OSMesa buffer formats */ 45 /* for unsupported OSMesa buffer formats */
40 void (*ConvertSurface)(SDL_Surface *surface); 46 void (*ConvertSurface)(_THIS, SDL_Surface *surface);
41 47
42 #ifdef HAVE_OPENGL 48 /* to convert the shadow buffer to the screen format */
49 void (*CopyShadow)(_THIS, SDL_Surface *surface);
50
43 OSMesaContext ctx; 51 OSMesaContext ctx;
44 #endif 52
53 /* osmesa.ldg */
54 OSMesaContext (*OSMesaCreateContextExt)( GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist);
55 void (*OSMesaDestroyContext)( OSMesaContext ctx );
56 GLboolean (*OSMesaMakeCurrent)( OSMesaContext ctx, void *buffer, GLenum type, GLsizei width, GLsizei height );
57 void (*OSMesaPixelStore)( GLint pname, GLint value );
58 void * (*OSMesaGetProcAddress)( const char *funcName );
59 void (*glGetIntegerv)( GLenum pname, GLint *value );
60
61 /* mesa_gl.ldg, tiny_gl.ldg */
62 void *(*OSMesaCreateLDG)( long format, long type, long width, long height );
63 void (*OSMesaDestroyLDG)(void);
45 }; 64 };
46 65
47 /* Old variable names */ 66 /* Variable names */
48 #define gl_active (this->gl_data->gl_active) 67 #define gl_active (this->gl_data->gl_active)
49 #define gl_ctx (this->gl_data->ctx) 68 #define gl_ctx (this->gl_data->ctx)
69 #define gl_oldmesa (this->gl_data->gl_oldmesa)
70 #define gl_pixelsize (this->gl_data->gl_pixelsize)
71 #define gl_shadow (this->gl_data->gl_shadow)
50 #define gl_convert (this->gl_data->ConvertSurface) 72 #define gl_convert (this->gl_data->ConvertSurface)
73 #define gl_copyshadow (this->gl_data->CopyShadow)
51 74
52 /* OpenGL functions */ 75 /* OpenGL functions */
53 extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current); 76 extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current);
54 extern void SDL_AtariGL_Quit(_THIS); 77 extern void SDL_AtariGL_Quit(_THIS);
78 extern void SDL_AtariGL_InitPointers(_THIS);
55 79
56 extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path); 80 extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
57 extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc); 81 extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
58 extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); 82 extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
59 extern int SDL_AtariGL_MakeCurrent(_THIS); 83 extern int SDL_AtariGL_MakeCurrent(_THIS);