comparison src/video/photon/SDL_photon_render.c @ 3387:05499ec8c022

Initial support for fullscreen application modes.
author Mike Gorchak <lestat@i.com.ua>
date Mon, 12 Oct 2009 19:47:01 +0000
parents fff074de9675
children d6b79fc83362
comparison
equal deleted inserted replaced
3386:fff074de9675 3387:05499ec8c022
161 renderer->DestroyRenderer = photon_destroyrenderer; 161 renderer->DestroyRenderer = photon_destroyrenderer;
162 renderer->info = photon_renderdriver.info; 162 renderer->info = photon_renderdriver.info;
163 renderer->window = window->id; 163 renderer->window = window->id;
164 renderer->driverdata = rdata; 164 renderer->driverdata = rdata;
165 165
166 /* Copy direct_mode status */
167 rdata->direct_mode=didata->direct_mode;
168
166 /* Set render acceleration flag in case it is accelerated */ 169 /* Set render acceleration flag in case it is accelerated */
167 if ((didata->caps & SDL_PHOTON_ACCELERATED) == SDL_PHOTON_ACCELERATED) { 170 if ((didata->caps & SDL_PHOTON_ACCELERATED) == SDL_PHOTON_ACCELERATED) {
168 renderer->info.flags = SDL_RENDERER_ACCELERATED; 171 renderer->info.flags = SDL_RENDERER_ACCELERATED;
169 } else { 172 } else {
170 renderer->info.flags = 0; 173 renderer->info.flags = 0;
171 } 174 }
172 175
173 /* Check if upper level requested synchronization on vsync signal */ 176 /* Check if upper level requested synchronization on vsync signal */
174 if ((flags & SDL_RENDERER_PRESENTVSYNC) == SDL_RENDERER_PRESENTVSYNC) { 177 if ((flags & SDL_RENDERER_PRESENTVSYNC) == SDL_RENDERER_PRESENTVSYNC) {
175 rdata->enable_vsync = SDL_TRUE; 178 if (rdata->direct_mode==SDL_TRUE)
179 {
180 /* We can control vsync only in direct mode */
181 rdata->enable_vsync = SDL_TRUE;
182 renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
183 }
184 else
185 {
186 rdata->enable_vsync = SDL_FALSE;
187 }
176 } else { 188 } else {
177 rdata->enable_vsync = SDL_FALSE; 189 rdata->enable_vsync = SDL_FALSE;
178 } 190 }
179 191
180 /* Check what buffer copy/flip scheme is requested */ 192 /* Check what buffer copy/flip scheme is requested */
598 } 610 }
599 611
600 static int 612 static int
601 photon_displaymodechanged(SDL_Renderer * renderer) 613 photon_displaymodechanged(SDL_Renderer * renderer)
602 { 614 {
615 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
616 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
617 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
618 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
619
620 /* Copy direct_mode status */
621 rdata->direct_mode=didata->direct_mode;
622
623 /* Update the surfaces */
603 return _photon_recreate_surfaces(renderer); 624 return _photon_recreate_surfaces(renderer);
604 } 625 }
605 626
606 static int 627 static int
607 photon_createtexture(SDL_Renderer * renderer, SDL_Texture * texture) 628 photon_createtexture(SDL_Renderer * renderer, SDL_Texture * texture)