src/video/ataricommon/SDL_atarigl_c.h
changeset 1895 c121d94672cb
parent 1402 d910939febfa
child 2033 b657f0bc72c2
equal deleted inserted replaced
1894:c69cee13dd76 1895:c121d94672cb
    33 #include "../SDL_sysvideo.h"
    33 #include "../SDL_sysvideo.h"
    34 
    34 
    35 /* Hidden "this" pointer for the video functions */
    35 /* Hidden "this" pointer for the video functions */
    36 #define _THIS   SDL_VideoDevice *this
    36 #define _THIS   SDL_VideoDevice *this
    37 
    37 
    38 struct SDL_PrivateGLData {
    38 struct SDL_PrivateGLData
       
    39 {
    39 
    40 
    40     int gl_active; 	/* to stop switching drivers while we have a valid context */
    41     int gl_active;              /* to stop switching drivers while we have a valid context */
    41 	
       
    42 	int gl_oldmesa;	/* Old OpenGL support ? */
       
    43 
    42 
    44 	int	gl_pixelsize;	/* for CopyShadow functions */
    43     int gl_oldmesa;             /* Old OpenGL support ? */
    45 
    44 
    46 	SDL_bool gl_upsidedown; /* Some implementations draw upside down */
    45     int gl_pixelsize;           /* for CopyShadow functions */
    47 
    46 
    48 	Uint8 *gl_shadow;	/* Shadow buffer for old implementations */
    47     SDL_bool gl_upsidedown;     /* Some implementations draw upside down */
    49 
    48 
    50 	/* for unsupported OSMesa buffer formats */
    49     Uint8 *gl_shadow;           /* Shadow buffer for old implementations */
    51 	void (*ConvertSurface)(_THIS, SDL_Surface *surface);	
       
    52 
    50 
    53 	/* to convert the shadow buffer to the screen format */
    51     /* for unsupported OSMesa buffer formats */
    54 	void (*CopyShadow)(_THIS, SDL_Surface *surface);	
    52     void (*ConvertSurface) (_THIS, SDL_Surface * surface);
       
    53 
       
    54     /* to convert the shadow buffer to the screen format */
       
    55     void (*CopyShadow) (_THIS, SDL_Surface * surface);
    55 
    56 
    56 #if SDL_VIDEO_OPENGL
    57 #if SDL_VIDEO_OPENGL
    57 	OSMesaContext	ctx;
    58     OSMesaContext ctx;
    58 
    59 
    59 	/* OpenGL functions */
    60     /* OpenGL functions */
    60 	void (*glGetIntegerv)( GLenum pname, GLint *value );
    61     void (*glGetIntegerv) (GLenum pname, GLint * value);
    61 	void (*glFinish)(void);
    62     void (*glFinish) (void);
    62 	void (*glFlush)(void);
    63     void (*glFlush) (void);
    63 
    64 
    64 	/* osmesa.ldg */
    65     /* osmesa.ldg */
    65 	OSMesaContext (*OSMesaCreateContextExt)( GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, OSMesaContext sharelist);
    66       OSMesaContext(*OSMesaCreateContextExt) (GLenum format, GLint depthBits,
    66 	void (*OSMesaDestroyContext)( OSMesaContext ctx );
    67                                               GLint stencilBits,
    67 	GLboolean (*OSMesaMakeCurrent)( OSMesaContext ctx, void *buffer, GLenum type, GLsizei width, GLsizei height );
    68                                               GLint accumBits,
    68 	void (*OSMesaPixelStore)( GLint pname, GLint value );
    69                                               OSMesaContext sharelist);
    69 	void * (*OSMesaGetProcAddress)( const char *funcName );
    70     void (*OSMesaDestroyContext) (OSMesaContext ctx);
       
    71       GLboolean(*OSMesaMakeCurrent) (OSMesaContext ctx, void *buffer,
       
    72                                      GLenum type, GLsizei width,
       
    73                                      GLsizei height);
       
    74     void (*OSMesaPixelStore) (GLint pname, GLint value);
       
    75     void *(*OSMesaGetProcAddress) (const char *funcName);
    70 
    76 
    71 	/* mesa_gl.ldg, tiny_gl.ldg */
    77     /* mesa_gl.ldg, tiny_gl.ldg */
    72 	void *(*OSMesaCreateLDG)( long format, long type, long width, long height );
    78     void *(*OSMesaCreateLDG) (long format, long type, long width,
    73 	void (*OSMesaDestroyLDG)(void);
    79                               long height);
       
    80     void (*OSMesaDestroyLDG) (void);
    74 
    81 
    75 	/* Info needed to compare existing context with new asked one */
    82     /* Info needed to compare existing context with new asked one */
    76 	int width, height;
    83     int width, height;
    77 	GLenum format;
    84     GLenum format;
    78 	GLint depth,stencil,accum;
    85     GLint depth, stencil, accum;
    79 #endif
    86 #endif
    80 };
    87 };
    81 
    88 
    82 /* Variable names */
    89 /* Variable names */
    83 #define gl_active		(this->gl_data->gl_active)
    90 #define gl_active		(this->gl_data->gl_active)
    94 #define gl_curaccum		(this->gl_data->accum)
   101 #define gl_curaccum		(this->gl_data->accum)
    95 #define gl_curwidth		(this->gl_data->width)
   102 #define gl_curwidth		(this->gl_data->width)
    96 #define gl_curheight	(this->gl_data->height)
   103 #define gl_curheight	(this->gl_data->height)
    97 
   104 
    98 /* OpenGL functions */
   105 /* OpenGL functions */
    99 extern int SDL_AtariGL_Init(_THIS, SDL_Surface *current);
   106 extern int SDL_AtariGL_Init(_THIS, SDL_Surface * current);
   100 extern void SDL_AtariGL_Quit(_THIS, SDL_bool unload);
   107 extern void SDL_AtariGL_Quit(_THIS, SDL_bool unload);
   101 extern void SDL_AtariGL_InitPointers(_THIS);
   108 extern void SDL_AtariGL_InitPointers(_THIS);
   102 
   109 
   103 extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
   110 extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
   104 extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
   111 extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
   105 extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
   112 extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
   106 extern int SDL_AtariGL_MakeCurrent(_THIS);
   113 extern int SDL_AtariGL_MakeCurrent(_THIS);
   107 extern void SDL_AtariGL_SwapBuffers(_THIS);
   114 extern void SDL_AtariGL_SwapBuffers(_THIS);
   108 
   115 
   109 #endif /* _SDL_ATARIGL_H_ */
   116 #endif /* _SDL_ATARIGL_H_ */
       
   117 /* vi: set ts=4 sw=4 expandtab: */