static int video_bpp;
#if SDL_MAJOR_VERSION == 1
-static SDL_Surface *screen;
+static SDL_Surface *video_screen;
static int video_flags;
#else
static SDL_GLContext context;
float move[3], aim[3];
static qboolean oldbuttons[128];
static qboolean buttons[128];
- static keydest_t oldkeydest;
keydest_t keydest = (key_consoleactive & KEY_CONSOLEACTIVE_USER) ? key_console : key_dest;
memcpy(oldbuttons, buttons, sizeof(oldbuttons));
memset(multitouchs, 0, sizeof(multitouchs));
multitouch[MAXFINGERS-1][0] = 0;
}*/
- if (oldkeydest != keydest)
- {
- switch(keydest)
- {
- case key_game: VID_ShowKeyboard(false);break;
- case key_console: VID_ShowKeyboard(true);break;
- case key_message: VID_ShowKeyboard(true);break;
- default: break; /* qc extensions control the other cases */
- }
- }
- oldkeydest = keydest;
// TODO: make touchscreen areas controlled by a config file or the VMs. THIS IS A MESS!
// TODO: can't just clear buttons[] when entering a new keydest, some keys would remain pressed
// SS:BR menuqc has many peculiarities, including that it can't accept more than one command per frame and pressing and releasing on the same frame
{
static int old_x = 0, old_y = 0;
static int stuck = 0;
+ static keydest_t oldkeydest;
+ static qboolean oldshowkeyboard;
int x, y;
vid_joystate_t joystate;
+ keydest_t keydest = (key_consoleactive & KEY_CONSOLEACTIVE_USER) ? key_console : key_dest;
scr_numtouchscreenareas = 0;
+ // Only apply the new keyboard state if the input changes.
+ if (keydest != oldkeydest || !!vid_touchscreen_showkeyboard.integer != oldshowkeyboard)
+ {
+ switch(keydest)
+ {
+ case key_console: VID_ShowKeyboard(true);break;
+ case key_message: VID_ShowKeyboard(true);break;
+ default: VID_ShowKeyboard(!!vid_touchscreen_showkeyboard.integer); break;
+ }
+ }
+ oldkeydest = keydest;
+ oldshowkeyboard = !!vid_touchscreen_showkeyboard.integer;
+
if (vid_touchscreen.integer)
{
switch(gamemode)
vid.width = event.resize.w;
vid.height = event.resize.h;
if (!vid_isfullscreen)
- screen = SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags);
+ video_screen = SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags);
if (vid_softsurface)
{
SDL_FreeSurface(vid_softsurface);
vid.support.ext_texture_edge_clamp = true; // GLES2 core
vid.support.ext_texture_filter_anisotropic = false; // probably don't want to use it...
vid.support.ext_texture_srgb = false;
+ vid.support.arb_texture_float = SDL_GL_ExtensionSupported("GL_OES_texture_float") != 0;
+ vid.support.arb_half_float_pixel = SDL_GL_ExtensionSupported("GL_OES_texture_half_float") != 0;
+ vid.support.arb_half_float_vertex = SDL_GL_ExtensionSupported("GL_OES_vertex_half_float") != 0;
// NOTE: On some devices, a value of 512 gives better FPS than the maximum.
qglGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&vid.maxtexturesize_2d);
else
{
rect->left = workArea.left + max(0, (workWidth - width) / 2);
- rect->top = workArea.top + ((workHeight - height) / 2);
+ rect->top = workArea.top + max(0, (workHeight - height) / 2);
}
}
#endif
int flags = SDL_OPENGL;
#else
int windowflags = SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL;
+ int xPos = SDL_WINDOWPOS_UNDEFINED;
+ int yPos = SDL_WINDOWPOS_UNDEFINED;
#endif
#ifndef USE_GLES2
int i;
}
}
#else
- int xPos = SDL_WINDOWPOS_UNDEFINED;
- int yPos = SDL_WINDOWPOS_UNDEFINED;
{
if (mode->fullscreen) {
if (vid_desktopfullscreen.integer)
video_bpp = mode->bitsperpixel;
#if SDL_MAJOR_VERSION == 1
video_flags = flags;
- screen = VID_WrapSDL_SetVideoMode(mode->width, mode->height, mode->bitsperpixel, flags);
- if (screen == NULL)
+ video_screen = VID_WrapSDL_SetVideoMode(mode->width, mode->height, mode->bitsperpixel, flags);
+ if (video_screen == NULL)
{
Con_Printf("Failed to set video mode to %ix%i: %s\n", mode->width, mode->height, SDL_GetError());
VID_Shutdown();
return false;
}
- mode->width = screen->w;
- mode->height = screen->h;
+ mode->width = video_screen->w;
+ mode->height = video_screen->h;
#else
window_flags = windowflags;
window = SDL_CreateWindow(gamename, xPos, yPos, mode->width, mode->height, windowflags);
video_bpp = mode->bitsperpixel;
#if SDL_MAJOR_VERSION == 1
video_flags = flags;
- screen = VID_WrapSDL_SetVideoMode(mode->width, mode->height, mode->bitsperpixel, flags);
- if (screen == NULL)
+ video_screen = VID_WrapSDL_SetVideoMode(mode->width, mode->height, mode->bitsperpixel, flags);
+ if (video_screen == NULL)
{
Con_Printf("Failed to set video mode to %ix%i: %s\n", mode->width, mode->height, SDL_GetError());
VID_Shutdown();
return false;
}
- mode->width = screen->w;
- mode->height = screen->h;
+ mode->width = video_screen->w;
+ mode->height = video_screen->h;
#else
window_flags = windowflags;
window = SDL_CreateWindow(gamename, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, mode->width, mode->height, windowflags);
#if SDL_MAJOR_VERSION == 1
// if (!r_test.integer)
{
- SDL_BlitSurface(vid_softsurface, NULL, screen, NULL);
- SDL_Flip(screen);
+ SDL_BlitSurface(vid_softsurface, NULL, video_screen, NULL);
+ SDL_Flip(video_screen);
}
#else
{