Initial support for fullscreen application modes.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404063
This commit is contained in:
parent
d023c50f43
commit
f617baee05
4 changed files with 53 additions and 1 deletions
|
@ -2456,6 +2456,35 @@ photon_pumpevents(_THIS)
|
|||
break;
|
||||
case Ph_EV_INFO:
|
||||
{
|
||||
switch (event->subtype)
|
||||
{
|
||||
case Ph_OFFSCREEN_INVALID:
|
||||
{
|
||||
uint32_t* type;
|
||||
|
||||
type = PhGetData(event);
|
||||
switch (*type)
|
||||
{
|
||||
case Pg_VIDEO_MODE_SWITCHED:
|
||||
case Pg_ENTERED_DIRECT:
|
||||
case Pg_EXITED_DIRECT:
|
||||
case Pg_DRIVER_STARTED:
|
||||
{
|
||||
/* TODO: */
|
||||
/* We must tell the renderer, that it have */
|
||||
/* to recreate all surfaces */
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Ph_EV_KEY:
|
||||
|
|
|
@ -83,6 +83,7 @@ typedef struct SDL_DisplayData
|
|||
SDL_bool cursor_visible; /* SDL_TRUE if cursor visible */
|
||||
uint32_t cursor_size; /* Cursor size in memory w/ structure */
|
||||
uint32_t mode_2dcaps; /* Current video mode 2D capabilities */
|
||||
SDL_bool direct_mode; /* Direct mode state */
|
||||
#if defined(SDL_VIDEO_OPENGL_ES)
|
||||
gf_display_t display; /* GF display handle */
|
||||
gf_display_info_t display_info; /* GF display information */
|
||||
|
|
|
@ -163,6 +163,9 @@ photon_createrenderer(SDL_Window * window, Uint32 flags)
|
|||
renderer->window = window->id;
|
||||
renderer->driverdata = rdata;
|
||||
|
||||
/* Copy direct_mode status */
|
||||
rdata->direct_mode=didata->direct_mode;
|
||||
|
||||
/* Set render acceleration flag in case it is accelerated */
|
||||
if ((didata->caps & SDL_PHOTON_ACCELERATED) == SDL_PHOTON_ACCELERATED) {
|
||||
renderer->info.flags = SDL_RENDERER_ACCELERATED;
|
||||
|
@ -172,7 +175,16 @@ photon_createrenderer(SDL_Window * window, Uint32 flags)
|
|||
|
||||
/* Check if upper level requested synchronization on vsync signal */
|
||||
if ((flags & SDL_RENDERER_PRESENTVSYNC) == SDL_RENDERER_PRESENTVSYNC) {
|
||||
rdata->enable_vsync = SDL_TRUE;
|
||||
if (rdata->direct_mode==SDL_TRUE)
|
||||
{
|
||||
/* We can control vsync only in direct mode */
|
||||
rdata->enable_vsync = SDL_TRUE;
|
||||
renderer->info.flags |= SDL_RENDERER_PRESENTVSYNC;
|
||||
}
|
||||
else
|
||||
{
|
||||
rdata->enable_vsync = SDL_FALSE;
|
||||
}
|
||||
} else {
|
||||
rdata->enable_vsync = SDL_FALSE;
|
||||
}
|
||||
|
@ -600,6 +612,15 @@ photon_activaterenderer(SDL_Renderer * renderer)
|
|||
static int
|
||||
photon_displaymodechanged(SDL_Renderer * renderer)
|
||||
{
|
||||
SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
|
||||
SDL_Window *window = SDL_GetWindowFromID(renderer->window);
|
||||
SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
|
||||
SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
|
||||
|
||||
/* Copy direct_mode status */
|
||||
rdata->direct_mode=didata->direct_mode;
|
||||
|
||||
/* Update the surfaces */
|
||||
return _photon_recreate_surfaces(renderer);
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ typedef struct SDL_RenderData
|
|||
uint32_t window_width; /* Last active window width */
|
||||
uint32_t window_height; /* Last active window height */
|
||||
PhGC_t* gc; /* Graphics context */
|
||||
SDL_bool direct_mode; /* Direct Mode state */
|
||||
PdOffscreenContext_t* osurfaces[SDL_PHOTON_MAX_SURFACES];
|
||||
PhImage_t* psurfaces[SDL_PHOTON_MAX_SURFACES];
|
||||
PmMemoryContext_t* pcontexts[SDL_PHOTON_MAX_SURFACES];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue