Mercurial > sdl-ios-xcode
comparison src/video/cybergfx/SDL_cgxgl_c.h @ 255:dcb5e869f8b5
Updated Amiga port by Gabriele Greco
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 16 Dec 2001 20:00:27 +0000 |
parents | e8157fcb3114 |
children | f6ffac90895c |
comparison
equal
deleted
inserted
replaced
254:4fc12b8edf74 | 255:dcb5e869f8b5 |
---|---|
23 #ifdef SAVE_RCSID | 23 #ifdef SAVE_RCSID |
24 static char rcsid = | 24 static char rcsid = |
25 "@(#) $Id$"; | 25 "@(#) $Id$"; |
26 #endif | 26 #endif |
27 | 27 |
28 #include <stdio.h> | 28 /* StormMesa implementation of SDL OpenGL support */ |
29 | |
30 #include "SDL_sysvideo.h" | |
31 #define _THIS SDL_VideoDevice *_this | |
29 | 32 |
30 #ifdef HAVE_OPENGL | 33 #ifdef HAVE_OPENGL |
31 #include <GL/glx.h> | 34 #include <GL/Amigamesa.h> |
32 #include <dlfcn.h> | 35 extern void *AmiGetGLProc(const char *proc); |
33 #endif | 36 #endif /* HAVE_OPENGL */ |
34 #include "SDL_sysvideo.h" | |
35 | 37 |
36 struct SDL_PrivateGLData { | 38 struct SDL_PrivateGLData { |
37 int gl_active; /* to stop switching drivers while we have a valid context */ | 39 int gl_active; |
38 | |
39 #ifdef HAVE_OPENGL | |
40 GLXContext glx_context; /* Current GL context */ | |
41 XVisualInfo* glx_visualinfo; /* XVisualInfo* returned by glXChooseVisual */ | |
42 | |
43 XVisualInfo* (*glXChooseVisual) | |
44 ( Display* dpy, | |
45 int screen, | |
46 int* attribList ); | |
47 | |
48 GLXContext (*glXCreateContext) | |
49 ( Display* dpy, | |
50 XVisualInfo* vis, | |
51 GLXContext shareList, | |
52 Bool direct ); | |
53 | |
54 void (*glXDestroyContext) | |
55 ( Display* dpy, | |
56 GLXContext ctx ); | |
57 | |
58 Bool (*glXMakeCurrent) | |
59 ( Display* dpy, | |
60 GLXDrawable drawable, | |
61 GLXContext ctx ); | |
62 | |
63 void (*glXSwapBuffers) | |
64 ( Display* dpy, | |
65 GLXDrawable drawable ); | |
66 | |
67 int (*glXGetConfig) | |
68 ( Display* dpy, | |
69 XVisualInfo* visual_info, | |
70 int attrib, | |
71 int* value ); | |
72 | |
73 void (*glXReleaseBuffersMESA) | |
74 ( Display* dpy, | |
75 GLXDrawable drawable ); | |
76 | |
77 #endif /* HAVE_OPENGL */ | |
78 }; | 40 }; |
79 | 41 |
80 /* Old variable names */ | |
81 #define gl_active (this->gl_data->gl_active) | |
82 #define glx_context (this->gl_data->glx_context) | |
83 #define glx_visualinfo (this->gl_data->glx_visualinfo) | |
84 | |
85 /* OpenGL functions */ | 42 /* OpenGL functions */ |
86 extern void *CGX_GL_GetVisual(_THIS); | 43 extern int CGX_GL_Init(_THIS); |
87 extern int CGX_GL_CreateWindow(_THIS, int w, int h); | 44 extern void CGX_GL_Quit(_THIS); |
88 extern int CGX_GL_CreateContext(_THIS); | 45 extern int CGX_GL_Update(_THIS); |
89 extern void CGX_GL_Shutdown(_THIS); | |
90 #ifdef HAVE_OPENGL | 46 #ifdef HAVE_OPENGL |
91 extern int CGX_GL_MakeCurrent(_THIS); | 47 extern int CGX_GL_MakeCurrent(_THIS); |
92 extern int CGX_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); | 48 extern int CGX_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); |
93 extern void CGX_GL_SwapBuffers(_THIS); | 49 extern void CGX_GL_SwapBuffers(_THIS); |
94 extern int CGX_GL_LoadLibrary(_THIS, const char* path); | 50 extern void *CGX_GL_GetProcAddress(_THIS, const char *proc); |
95 extern void *CGX_GL_GetProcAddress(_THIS, const char* proc); | 51 extern int CGX_GL_LoadLibrary(_THIS, const char *path); |
96 #endif | 52 #endif |
97 extern void CGX_GL_UnloadLibrary(_THIS); | |
98 | 53 |
54 #undef _THIS |