comparison src/video/SDL_renderer_gles.c @ 3688:6512cba48440

Fixed Cocoa and OpenGL builds
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 07:28:01 +0000
parents 64ce267332c6
children f7b03b6838cb
comparison
equal deleted inserted replaced
3687:8e5186a99af4 3688:6512cba48440
253 renderer->RenderCopy = GLES_RenderCopy; 253 renderer->RenderCopy = GLES_RenderCopy;
254 renderer->RenderPresent = GLES_RenderPresent; 254 renderer->RenderPresent = GLES_RenderPresent;
255 renderer->DestroyTexture = GLES_DestroyTexture; 255 renderer->DestroyTexture = GLES_DestroyTexture;
256 renderer->DestroyRenderer = GLES_DestroyRenderer; 256 renderer->DestroyRenderer = GLES_DestroyRenderer;
257 renderer->info = GL_ES_RenderDriver.info; 257 renderer->info = GL_ES_RenderDriver.info;
258 renderer->window = window->id; 258 renderer->window = window;
259 renderer->driverdata = data; 259 renderer->driverdata = data;
260 260
261 renderer->info.flags = 261 renderer->info.flags =
262 (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED); 262 (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
263 263
274 if (GLES_LoadFunctions(data) < 0) { 274 if (GLES_LoadFunctions(data) < 0) {
275 GLES_DestroyRenderer(renderer); 275 GLES_DestroyRenderer(renderer);
276 return NULL; 276 return NULL;
277 } 277 }
278 278
279 data->context = SDL_GL_CreateContext(window->id); 279 data->context = SDL_GL_CreateContext(window);
280 if (!data->context) { 280 if (!data->context) {
281 GLES_DestroyRenderer(renderer); 281 GLES_DestroyRenderer(renderer);
282 return NULL; 282 return NULL;
283 } 283 }
284 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) { 284 if (SDL_GL_MakeCurrent(window, data->context) < 0) {
285 GLES_DestroyRenderer(renderer); 285 GLES_DestroyRenderer(renderer);
286 return NULL; 286 return NULL;
287 } 287 }
288 288
289 if (flags & SDL_RENDERER_PRESENTVSYNC) { 289 if (flags & SDL_RENDERER_PRESENTVSYNC) {
332 { 332 {
333 333
334 GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata; 334 GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
335 SDL_Window *window = renderer->window; 335 SDL_Window *window = renderer->window;
336 336
337 if (SDL_GL_MakeCurrent(window->id, data->context) < 0) { 337 if (SDL_GL_MakeCurrent(window, data->context) < 0) {
338 return -1; 338 return -1;
339 } 339 }
340 if (data->updateSize) { 340 if (data->updateSize) {
341 data->glMatrixMode(GL_PROJECTION); 341 data->glMatrixMode(GL_PROJECTION);
342 data->glLoadIdentity(); 342 data->glLoadIdentity();