annotate src/video/ataricommon/SDL_atarigl_c.h @ 989:475166d13b44

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