Mercurial > sdl-ios-xcode
comparison src/video/cybergfx/SDL_cgxgl.c @ 1361:19418e4422cb
New configure-based build system. Still work in progress, but much improved
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 16 Feb 2006 10:11:48 +0000 |
parents | c71e05b4dc2e |
children | d910939febfa |
comparison
equal
deleted
inserted
replaced
1360:70a9cfb4cf1b | 1361:19418e4422cb |
---|---|
23 /* StormMesa implementation of SDL OpenGL support */ | 23 /* StormMesa implementation of SDL OpenGL support */ |
24 | 24 |
25 #include "SDL_cgxgl_c.h" | 25 #include "SDL_cgxgl_c.h" |
26 #include "SDL_cgxvideo.h" | 26 #include "SDL_cgxvideo.h" |
27 | 27 |
28 #ifdef HAVE_OPENGL | 28 #if SDL_VIDEO_OPENGL |
29 AmigaMesaContext glcont=NULL; | 29 AmigaMesaContext glcont=NULL; |
30 #endif | 30 #endif |
31 | 31 |
32 /* Init OpenGL */ | 32 /* Init OpenGL */ |
33 int CGX_GL_Init(_THIS) | 33 int CGX_GL_Init(_THIS) |
34 { | 34 { |
35 #ifdef HAVE_OPENGL | 35 #if SDL_VIDEO_OPENGL |
36 int i = 0; | 36 int i = 0; |
37 struct TagItem attributes [ 14 ]; /* 14 should be more than enough :) */ | 37 struct TagItem attributes [ 14 ]; /* 14 should be more than enough :) */ |
38 struct Window *win = (struct Window *)SDL_Window; | 38 struct Window *win = (struct Window *)SDL_Window; |
39 | 39 |
40 // default config. Always used... | 40 // default config. Always used... |
99 } | 99 } |
100 | 100 |
101 /* Quit OpenGL */ | 101 /* Quit OpenGL */ |
102 void CGX_GL_Quit(_THIS) | 102 void CGX_GL_Quit(_THIS) |
103 { | 103 { |
104 #ifdef HAVE_OPENGL | 104 #if SDL_VIDEO_OPENGL |
105 if ( glcont != NULL ) { | 105 if ( glcont != NULL ) { |
106 AmigaMesaDestroyContext(glcont); | 106 AmigaMesaDestroyContext(glcont); |
107 glcont = NULL; | 107 glcont = NULL; |
108 this->gl_data->gl_active = 0; | 108 this->gl_data->gl_active = 0; |
109 this->gl_config.driver_loaded = 0; | 109 this->gl_config.driver_loaded = 0; |
112 } | 112 } |
113 | 113 |
114 /* Attach context to another window */ | 114 /* Attach context to another window */ |
115 int CGX_GL_Update(_THIS) | 115 int CGX_GL_Update(_THIS) |
116 { | 116 { |
117 #ifdef HAVE_OPENGL | 117 #if SDL_VIDEO_OPENGL |
118 struct TagItem tags[2]; | 118 struct TagItem tags[2]; |
119 struct Window *win = (struct Window*)SDL_Window; | 119 struct Window *win = (struct Window*)SDL_Window; |
120 if(glcont == NULL) { | 120 if(glcont == NULL) { |
121 return -1; //should never happen | 121 return -1; //should never happen |
122 } | 122 } |
130 SDL_SetError("OpenGL support not configured"); | 130 SDL_SetError("OpenGL support not configured"); |
131 return -1; | 131 return -1; |
132 #endif | 132 #endif |
133 } | 133 } |
134 | 134 |
135 #ifdef HAVE_OPENGL | 135 #if SDL_VIDEO_OPENGL |
136 | 136 |
137 /* Make the current context active */ | 137 /* Make the current context active */ |
138 int CGX_GL_MakeCurrent(_THIS) | 138 int CGX_GL_MakeCurrent(_THIS) |
139 { | 139 { |
140 if(glcont == NULL) | 140 if(glcont == NULL) |
205 this->gl_config.driver_loaded = 1; | 205 this->gl_config.driver_loaded = 1; |
206 | 206 |
207 return 0; | 207 return 0; |
208 } | 208 } |
209 | 209 |
210 #endif /* HAVE_OPENGL */ | 210 #endif /* SDL_VIDEO_OPENGL */ |
211 | 211 |