src/video/glesrenderer/SDL_renderer_gles.c
branchgsoc2008_iphone
changeset 2426 aad0c5ccf6bb
parent 2359 b70b96e615d2
child 2456 da4fd7cf8745
equal deleted inserted replaced
2425:491958a6c881 2426:aad0c5ccf6bb
   276             renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
   276             renderer->info.flags |= SDL_RENDERER_SINGLEBUFFER;
   277         }
   277         }
   278     }
   278     }
   279 	
   279 	
   280 	if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) {
   280 	if (SDL_GL_ExtensionSupported("GL_OES_draw_texture")) {
   281 		printf("using draw texture\n");
       
   282 		data->GL_OES_draw_texture_supported = SDL_TRUE;
   281 		data->GL_OES_draw_texture_supported = SDL_TRUE;
   283 		data->useDrawTexture = SDL_TRUE;
   282 		data->useDrawTexture = SDL_TRUE;
   284 	}
   283 	}
   285 	else {
   284 	else {
   286 		printf("not using draw texture\n");
       
   287 		data->GL_OES_draw_texture_supported = SDL_FALSE;
   285 		data->GL_OES_draw_texture_supported = SDL_FALSE;
   288 		data->useDrawTexture = SDL_FALSE;
   286 		data->useDrawTexture = SDL_FALSE;
   289 	}	
   287 	}	
   290 
   288 
   291     data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
   289     data->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value);
   307 static int GL_ActivateRenderer(SDL_Renderer * renderer)
   305 static int GL_ActivateRenderer(SDL_Renderer * renderer)
   308 {
   306 {
   309 		
   307 		
   310     GL_RenderData *data = (GL_RenderData *)renderer->driverdata;
   308     GL_RenderData *data = (GL_RenderData *)renderer->driverdata;
   311     SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   309     SDL_Window *window = SDL_GetWindowFromID(renderer->window);
   312 		
   310 				
   313 	if (data->context == NULL) {
       
   314 		printf("Context is null, dude\n");
       
   315 	}
       
   316 		
       
   317     if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
   311     if (SDL_GL_MakeCurrent(window->id, data->context) < 0) {
   318         return -1;
   312         return -1;
   319     }
   313     }
   320     if (data->updateSize) {
   314     if (data->updateSize) {
   321         data->glMatrixMode(GL_PROJECTION);
   315         data->glMatrixMode(GL_PROJECTION);