src/video/ataricommon/SDL_atarigl_c.h
author Edgar Simo <bobbens@gmail.com>
Sun, 06 Jul 2008 17:06:37 +0000
branchgsoc2008_force_feedback
changeset 2498 ab567bd667bf
parent 2033 b657f0bc72c2
child 2859 99210400e8b9
permissions -rw-r--r--
Fixed various mistakes in the doxygen.
     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 #include "SDL_config.h"
    23 
    24 /* Atari OSMesa.ldg implementation of SDL OpenGL support */
    25 
    26 #ifndef _SDL_ATARIGL_H_
    27 #define _SDL_ATARIGL_H_
    28 
    29 #if SDL_VIDEO_OPENGL
    30 #include <GL/osmesa.h>
    31 #endif
    32 
    33 #include "../SDL_sysvideo.h"
    34 
    35 struct SDL_GLDriverData
    36 {
    37 
    38     int gl_active;              /* to stop switching drivers while we have a valid context */
    39 
    40     int gl_oldmesa;             /* Old OpenGL support ? */
    41 
    42     int gl_pixelsize;           /* for CopyShadow functions */
    43 
    44     SDL_bool gl_upsidedown;     /* Some implementations draw upside down */
    45 
    46     Uint8 *gl_shadow;           /* Shadow buffer for old implementations */
    47 
    48     /* for unsupported OSMesa buffer formats */
    49     void (*ConvertSurface) (_THIS, SDL_Surface * surface);
    50 
    51     /* to convert the shadow buffer to the screen format */
    52     void (*CopyShadow) (_THIS, SDL_Surface * surface);
    53 
    54 #if SDL_VIDEO_OPENGL
    55     OSMesaContext ctx;
    56 
    57     /* OpenGL functions */
    58     void (*glGetIntegerv) (GLenum pname, GLint * value);
    59     void (*glFinish) (void);
    60     void (*glFlush) (void);
    61 
    62     /* osmesa.ldg */
    63       OSMesaContext(*OSMesaCreateContextExt) (GLenum format, GLint depthBits,
    64                                               GLint stencilBits,
    65                                               GLint accumBits,
    66                                               OSMesaContext sharelist);
    67     void (*OSMesaDestroyContext) (OSMesaContext ctx);
    68       GLboolean(*OSMesaMakeCurrent) (OSMesaContext ctx, void *buffer,
    69                                      GLenum type, GLsizei width,
    70                                      GLsizei height);
    71     void (*OSMesaPixelStore) (GLint pname, GLint value);
    72     void *(*OSMesaGetProcAddress) (const char *funcName);
    73 
    74     /* mesa_gl.ldg, tiny_gl.ldg */
    75     void *(*OSMesaCreateLDG) (long format, long type, long width,
    76                               long height);
    77     void (*OSMesaDestroyLDG) (void);
    78 
    79     /* Info needed to compare existing context with new asked one */
    80     int width, height;
    81     GLenum format;
    82     GLint depth, stencil, accum;
    83 #endif
    84 };
    85 
    86 /* Variable names */
    87 #define gl_active		(_this->gl_data->gl_active)
    88 #define gl_ctx			(_this->gl_data->ctx)
    89 #define gl_oldmesa		(_this->gl_data->gl_oldmesa)
    90 #define gl_pixelsize	(_this->gl_data->gl_pixelsize)
    91 #define gl_upsidedown	(_this->gl_data->gl_upsidedown)
    92 #define gl_shadow		(_this->gl_data->gl_shadow)
    93 #define gl_convert		(_this->gl_data->ConvertSurface)
    94 #define gl_copyshadow	(_this->gl_data->CopyShadow)
    95 #define gl_curformat	(_this->gl_data->format)
    96 #define gl_curdepth		(_this->gl_data->depth)
    97 #define gl_curstencil	(_this->gl_data->stencil)
    98 #define gl_curaccum		(_this->gl_data->accum)
    99 #define gl_curwidth		(_this->gl_data->width)
   100 #define gl_curheight	(_this->gl_data->height)
   101 
   102 /* OpenGL functions */
   103 extern int SDL_AtariGL_Init(_THIS, SDL_Surface * current);
   104 extern void SDL_AtariGL_Quit(_THIS, SDL_bool unload);
   105 extern void SDL_AtariGL_InitPointers(_THIS);
   106 
   107 extern int SDL_AtariGL_LoadLibrary(_THIS, const char *path);
   108 extern void *SDL_AtariGL_GetProcAddress(_THIS, const char *proc);
   109 extern int SDL_AtariGL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
   110 extern int SDL_AtariGL_MakeCurrent(_THIS);
   111 extern void SDL_AtariGL_SwapBuffers(_THIS);
   112 
   113 #endif /* _SDL_ATARIGL_H_ */
   114 /* vi: set ts=4 sw=4 expandtab: */