![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
Go to the source code of this file.
Macros | |
#define | MAXFINGERS 11 |
#define | SDLK_PERCENT '%' |
#define | Vid_ClearAllTouchscreenAreas(skip) |
Functions | |
qbool | GL_ExtensionSupported (const char *name) |
void * | GL_GetProcAddress (const char *name) |
void | IN_Move (void) |
static void | IN_Move_TouchScreen_Quake (void) |
static void | IN_Move_TouchScreen_SteelStorm (void) |
static int | MapKey (unsigned int sdlkey) |
void | Sys_SDL_HandleEvents (void) |
Perform Key_Event () callbacks until the input que is empty. | |
static void | VID_ApplyDisplayMode (const viddef_mode_t *mode) |
Applies display settings immediately (no vid_restart required). | |
static void | VID_ApplyDisplayMode_c (cvar_t *var) |
void | VID_BuildJoyState (vid_joystate_t *joystate) |
void | VID_EnableJoystick (qbool enable) |
void | VID_Finish (void) |
vid_mode_t | VID_GetDesktopMode (void) |
qbool | VID_HasScreenKeyboardSupport (void) |
void | VID_Init (void) |
Called at startup. | |
qbool | VID_InitMode (const viddef_mode_t *mode) |
allocates and opens an appropriate OpenGL context (and its window) | |
static qbool | VID_InitModeGL (const viddef_mode_t *mode) |
size_t | VID_ListModes (vid_mode_t *modes, size_t maxcount) |
static void | VID_SetHints_c (cvar_t *var) |
static void | VID_SetMouse (qbool relative, qbool hidecursor) |
static void | VID_SetVsync_c (cvar_t *var) |
qbool | VID_ShowingKeyboard (void) |
void | VID_ShowKeyboard (qbool show) |
void | VID_Shutdown (void) |
Called at shutdown. | |
static qbool | VID_TouchscreenArea (int corner, float px, float py, float pwidth, float pheight, const char *icon, float textheight, const char *text, float *resultmove, qbool *resultbutton, keynum_t key, const char *typedtext, float deadzone, float oversizepixels_x, float oversizepixels_y, qbool iamexclusive) |
static void | VID_TouchscreenCursor (float px, float py, float pwidth, float pheight, qbool *resultbutton, keynum_t key) |
Variables | |
static keynum_t | buttonremap [] |
int | cl_available = true |
static SDL_GLContext | context |
static cvar_t | joy_sdl2_trigger_deadzone = {CF_ARCHIVE | CF_CLIENT, "joy_sdl2_trigger_deadzone", "0.5", "deadzone for triggers to be registered as key presses"} |
float | multitouch [MAXFINGERS][3] |
int | multitouchs [MAXFINGERS] |
static cvar_t * | steelstorm_showing_map = NULL |
static cvar_t * | steelstorm_showing_mousecursor = NULL |
static qbool | vid_hasfocus = false |
static SDL_GameController * | vid_sdlgamecontroller = NULL |
static SDL_Joystick * | vid_sdljoystick = NULL |
static int | vid_sdljoystickindex = -1 |
qbool | vid_supportrefreshrate = false |
static qbool | vid_usinghidecursor = false |
static qbool | vid_usingmouse = false |
static qbool | vid_usingmouse_relativeworks = false |
static qbool | vid_wmborder_waiting |
static qbool | vid_wmborderless |
static SDL_Window * | window |
#define MAXFINGERS 11 |
Definition at line 445 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), Sys_SDL_HandleEvents(), VID_TouchscreenArea(), and VID_TouchscreenCursor().
#define Vid_ClearAllTouchscreenAreas | ( | skip | ) |
Definition at line 722 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_SteelStorm().
qbool GL_ExtensionSupported | ( | const char * | name | ) |
Definition at line 1351 of file vid_sdl.c.
References name.
Referenced by GL_CheckExtension().
void * GL_GetProcAddress | ( | const char * | name | ) |
Definition at line 936 of file vid_sdl.c.
References GAME_STEELSTORM, gamemode, viddef_mode_t::height, in_mouse_x, in_mouse_y, IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), in_windowmouse_x, in_windowmouse_y, cvar_t::integer, key_console, key_consoleactive, KEY_CONSOLEACTIVE_USER, key_dest, key_message, viddef_t::mode, scr_numtouchscreenareas, vid, VID_ApplyJoyState(), VID_BuildJoyState(), VID_ShowKeyboard(), vid_stick_mouse, vid_touchscreen, vid_touchscreen_showkeyboard, vid_usingmouse, vid_usingmouse_relativeworks, viddef_mode_t::width, window, x, and y.
Referenced by CL_Input().
Definition at line 867 of file vid_sdl.c.
References cl, cl_forwardspeed, cl_pitchspeed, cl_sidespeed, cl_yawspeed, client_state_t::cmd, cmd_local, Con_ToggleConsole_f(), usercmd_t::forwardmove, viddef_mode_t::height, in_windowmouse_x, in_windowmouse_y, K_ESCAPE, K_MOUSE1, K_MOUSE2, K_MOUSE4, K_MOUSE5, K_SPACE, key_console, key_consoleactive, KEY_CONSOLEACTIVE_USER, key_dest, key_game, MAXFINGERS, viddef_t::mode, multitouch, multitouchs, NULL, client_state_t::realframetime, usercmd_t::sidemove, cvar_t::value, vid, VID_ShowingKeyboard(), VID_ShowKeyboard(), VID_TouchscreenArea(), client_state_t::viewangles, viddef_mode_t::width, x, and y.
Referenced by IN_Move().
Definition at line 752 of file vid_sdl.c.
References client_state_t::activeweapon, cl, cl_forwardspeed, cl_pitchspeed, cl_sidespeed, cl_yawspeed, client_state_t::cmd, developer, usercmd_t::forwardmove, i, in_windowmouse_x, in_windowmouse_y, cvar_t::integer, K_ESCAPE, K_MOUSE1, K_MOUSE2, K_MOUSE3, K_SHIFT, K_SPACE, key_console, key_consoleactive, KEY_CONSOLEACTIVE_USER, key_dest, key_game, MAXFINGERS, multitouch, multitouchs, NULL, client_state_t::realframetime, usercmd_t::sidemove, steelstorm_showing_map, steelstorm_showing_mousecursor, cvar_t::value, Vid_ClearAllTouchscreenAreas, vid_conheight, vid_conwidth, vid_height, VID_ShowingKeyboard(), vid_touchscreen_density, VID_TouchscreenArea(), VID_TouchscreenCursor(), vid_width, and client_state_t::viewangles.
Referenced by IN_Move().
Definition at line 89 of file vid_sdl.c.
References K_ALT, K_BACKSPACE, K_CAPSLOCK, K_CTRL, K_DEL, K_DOWNARROW, K_END, K_ENTER, K_ESCAPE, K_F1, K_F10, K_F11, K_F12, K_F2, K_F3, K_F4, K_F5, K_F6, K_F7, K_F8, K_F9, K_HOME, K_INS, K_KP_0, K_KP_1, K_KP_2, K_KP_3, K_KP_4, K_KP_5, K_KP_6, K_KP_7, K_KP_8, K_KP_9, K_KP_DIVIDE, K_KP_ENTER, K_KP_EQUALS, K_KP_MINUS, K_KP_MULTIPLY, K_KP_PERIOD, K_KP_PLUS, K_LEFTARROW, K_NUMLOCK, K_PAUSE, K_PGDN, K_PGUP, K_PRINTSCREEN, K_RIGHTARROW, K_SCROLLOCK, K_SHIFT, K_SPACE, K_TAB, K_UPARROW, and SDLK_PERCENT.
Referenced by Sys_SDL_HandleEvents().
Perform Key_Event () callbacks until the input que is empty.
Definition at line 1043 of file vid_sdl.c.
References ARRAY_SIZE, buttonremap, cl, cl_demo_mousegrab, cl_prydoncursor, cls, Con_DPrintf(), CON_ERROR, Con_Print(), Con_Printf(), CON_WARN, client_state_t::csqc_wantsmousemove, Cvar_SetValueQuick(), client_static_t::demoplayback, viddef_mode_t::display, viddef_mode_t::height, host, host_shutdown, i, in_client_mouse, cvar_t::integer, K_MWHEELDOWN, K_MWHEELUP, K_TEXT, key_consoleactive, key_dest, Key_Event(), key_menu, key_menu_grabbed, MapKey(), MAXFINGERS, viddef_t::mode, multitouch, NULL, scr_loading, host_static_t::state, u8_bytelen(), u8_getchar_utf8_enabled(), vid, vid_activewindow, VID_EnableJoystick(), vid_hasfocus, vid_hidden, vid_info_displaycount, VID_JoyBlockEmulatedKeys(), vid_mouse, vid_resizable, VID_SetMouse(), vid_touchscreen, vid_wmborder_waiting, vid_wmborderless, viddef_mode_t::width, window, viddef_t::xPos, and viddef_t::yPos.
Referenced by Host_Frame().
|
static |
Applies display settings immediately (no vid_restart required).
Definition at line 1357 of file vid_sdl.c.
References viddef_mode_t::bitsperpixel, bound, Con_DPrintf(), CON_ERROR, Con_Printf(), CON_WARN, viddef_mode_t::desktopfullscreen, viddef_mode_t::display, viddef_mode_t::fullscreen, viddef_mode_t::height, cvar_t::integer, mode, viddef_t::mode, NULL, viddef_mode_t::refreshrate, viddef_t::stencil, vid, vid_borderless, vid_info_displaycount, vid_resizable, vid_wmborder_waiting, vid_wmborderless, viddef_mode_t::width, window, viddef_t::xPos, and viddef_t::yPos.
Referenced by VID_ApplyDisplayMode_c(), and VID_InitModeGL().
Definition at line 1483 of file vid_sdl.c.
References Con_DPrintf(), cvar_t::integer, key_consoleactive, key_dest, key_menu, max, mode, cvar_t::name, cvar_t::string, VID_ApplyDisplayMode(), vid_bitsperpixel, vid_desktopfullscreen, vid_display, vid_fullscreen, vid_height, vid_refreshrate, vid_width, and window.
Referenced by VID_Init().
void VID_BuildJoyState | ( | vid_joystate_t * | joystate | ) |
Definition at line 683 of file vid_sdl.c.
References vid_joystate_t::axis, vid_joystate_t::button, joy_sdl2_trigger_deadzone, cvar_t::value, VID_JoyState_GetAxis(), vid_sdlgamecontroller, vid_sdljoystick, VID_Shared_BuildJoyState_Begin(), and VID_Shared_BuildJoyState_Finish().
Referenced by IN_Move(), and VID_JoyBlockEmulatedKeys().
Definition at line 1583 of file vid_sdl.c.
References Con_DPrintf(), CON_ERROR, Con_Printf(), Cvar_SetValueQuick(), index, cvar_t::integer, joy_active, joy_detected, joy_enable, joy_index, NULL, vid_sdlgamecontroller, vid_sdljoystick, vid_sdljoystickindex, and VID_Shared_SetJoystick().
Referenced by Sys_SDL_HandleEvents(), and VID_Shutdown().
Definition at line 1876 of file vid_sdl.c.
References CHECKGLERROR, GL_Finish(), gl_finish, cvar_t::integer, r_speeds, viddef_t::renderpath, RENDERPATH_GL32, RENDERPATH_GLES2, vid, vid_hidden, VID_UpdateGamma(), and window.
Referenced by CL_UpdateScreen(), and VID_InitModeGL().
vid_mode_t VID_GetDesktopMode | ( | void | ) |
Definition at line 1895 of file vid_sdl.c.
References vid_mode_t::bpp, viddef_mode_t::display, vid_mode_t::height, mode, viddef_t::mode, vid_mode_t::pixelheight_denom, vid_mode_t::pixelheight_num, vid_mode_t::refreshrate, vid, and vid_mode_t::width.
Referenced by VM_M_getresolution().
Called at startup.
Definition at line 1534 of file vid_sdl.c.
References CON_ERROR, Con_Printf(), Cvar_RegisterCallback(), Cvar_RegisterVariable(), Cvar_SetValueQuick(), joy_sdl2_trigger_deadzone, Sys_Error(), version, VID_ApplyDisplayMode_c(), vid_borderless, vid_desktopfullscreen, vid_display, vid_fullscreen, vid_height, vid_minimize_on_focus_loss, vid_mouse_clickthrough, vid_refreshrate, vid_resizable, VID_SetHints_c(), VID_SetVsync_c(), vid_touchscreen, vid_vsync, and vid_width.
Referenced by CL_Init().
qbool VID_InitMode | ( | const viddef_mode_t * | mode | ) |
allocates and opens an appropriate OpenGL context (and its window)
Definition at line 1850 of file vid_sdl.c.
References Cvar_FindVar(), Cvar_SetValueQuick(), cvars_all, mode, steelstorm_showing_map, steelstorm_showing_mousecursor, Sys_Error(), VID_InitModeGL(), and vid_touchscreen_supportshowkeyboard.
Referenced by VID_Mode().
|
static |
Definition at line 1692 of file vid_sdl.c.
References sys_t::argc, sys_t::argv, bound, Con_DPrint(), CON_ERROR, Con_Printf(), context, Cvar_Callback(), Cvar_SetQuick(), Cvar_SetValueQuick(), viddef_mode_t::desktopfullscreen, viddef_mode_t::display, viddef_mode_t::fullscreen, gamename, GL_Clear(), GL_COLOR_BUFFER_BIT, gl_debug, gl_info_driver, gl_info_renderer, gl_info_vendor, gl_info_version, GL_InitFunctions(), gl_renderer, GL_Setup(), GL_VENDOR, gl_vendor, gl_version, i, cvar_t::integer, mode, viddef_t::mode, NULL, qglGetString(), viddef_mode_t::stereobuffer, sys, Sys_CheckParm(), Sys_Error(), vid, vid_activewindow, VID_ApplyDisplayMode(), vid_borderless, VID_Finish(), vid_hasfocus, vid_hidden, vid_info_displaycount, vid_resizable, VID_SetHints_c(), VID_Shutdown(), vid_usinghidecursor, vid_usingmouse, vid_vsync, vid_wmborder_waiting, vid_wmborderless, window, viddef_t::xPos, and viddef_t::yPos.
Referenced by VID_InitMode().
size_t VID_ListModes | ( | vid_mode_t * | modes, |
size_t | maxcount ) |
Definition at line 1913 of file vid_sdl.c.
References Con_DPrintf(), viddef_mode_t::display, mode, viddef_t::mode, modes, and vid.
Referenced by MR_Init().
Definition at line 1528 of file vid_sdl.c.
References cvar_t::integer, vid_minimize_on_focus_loss, and vid_mouse_clickthrough.
Referenced by VID_Init(), and VID_InitModeGL().
Definition at line 365 of file vid_sdl.c.
References cl_ignoremousemoves, Con_DPrintf(), Con_Print(), Cvar_SetValueQuick(), cvar_t::integer, VID_SetMouse(), vid_usinghidecursor, vid_usingmouse, and vid_usingmouse_relativeworks.
Referenced by Sys_SDL_HandleEvents(), VID_SetMouse(), and VID_Shutdown().
Definition at line 1508 of file vid_sdl.c.
References cls, Con_DPrintf(), CON_ERROR, Con_Printf(), context, cvar_t::integer, client_static_t::timedemo, and vid_vsync.
Referenced by VID_Init().
Definition at line 360 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_Quake(), and IN_Move_TouchScreen_SteelStorm().
Definition at line 343 of file vid_sdl.c.
Referenced by IN_Move(), and IN_Move_TouchScreen_Quake().
Called at shutdown.
Definition at line 1863 of file vid_sdl.c.
References context, NULL, VID_EnableJoystick(), VID_SetMouse(), and window.
Referenced by CL_Shutdown(), Sys_Error(), Sys_HandleCrash(), VID_InitModeGL(), and VID_Restart_f().
|
static |
Definition at line 452 of file vid_sdl.c.
References scr_touchscreenarea_t::active, scr_touchscreenarea_t::activealpha, bound, i, scr_touchscreenarea_t::inactivealpha, K_TEXT, Key_Event(), MAXFINGERS, multitouch, multitouchs, scr_touchscreenarea_t::pic, px, scr_touchscreenarea_t::rect, scr_numtouchscreenareas, scr_touchscreenareas, scr_touchscreenarea_t::text, scr_touchscreenarea_t::textheight, cvar_t::value, Vector2Normalize2, VectorClear, VectorCopy, vid_conheight, and vid_conwidth.
Referenced by IN_Move_TouchScreen_Quake(), and IN_Move_TouchScreen_SteelStorm().
|
static |
resultbutton != button &&
Definition at line 565 of file vid_sdl.c.
References scr_touchscreenarea_t::active, scr_touchscreenarea_t::activealpha, host, in_windowmouse_x, in_windowmouse_y, scr_touchscreenarea_t::inactivealpha, cvar_t::integer, Key_Event(), MAXFINGERS, multitouch, scr_touchscreenarea_t::pic, px, host_static_t::realtime, scr_touchscreenarea_t::rect, scr_numtouchscreenareas, scr_touchscreenareas, steelstorm_showing_mousecursor, scr_touchscreenarea_t::text, scr_touchscreenarea_t::textheight, cvar_t::value, vid_conheight, vid_conwidth, vid_height, and vid_width.
Referenced by IN_Move_TouchScreen_SteelStorm().
|
static |
Definition at line 1022 of file vid_sdl.c.
Referenced by Sys_SDL_HandleEvents().
Definition at line 64 of file vid_sdl.c.
Referenced by Host_Init(), and SV_ServerOptions().
|
static |
Definition at line 80 of file vid_sdl.c.
Referenced by VID_InitModeGL(), VID_SetVsync_c(), and VID_Shutdown().
|
static |
Definition at line 75 of file vid_sdl.c.
Referenced by VID_BuildJoyState(), and VID_Init().
float multitouch[MAXFINGERS][3] |
Definition at line 446 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), Sys_SDL_HandleEvents(), VID_TouchscreenArea(), and VID_TouchscreenCursor().
int multitouchs[MAXFINGERS] |
Definition at line 449 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_Quake(), IN_Move_TouchScreen_SteelStorm(), and VID_TouchscreenArea().
Definition at line 77 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_SteelStorm(), and VID_InitMode().
Definition at line 78 of file vid_sdl.c.
Referenced by IN_Move_TouchScreen_SteelStorm(), VID_InitMode(), and VID_TouchscreenCursor().
Definition at line 71 of file vid_sdl.c.
Referenced by Sys_SDL_HandleEvents(), and VID_InitModeGL().
|
static |
Definition at line 74 of file vid_sdl.c.
Referenced by VID_BuildJoyState(), and VID_EnableJoystick().
|
static |
Definition at line 73 of file vid_sdl.c.
Referenced by VID_BuildJoyState(), and VID_EnableJoystick().
|
static |
Definition at line 1582 of file vid_sdl.c.
Referenced by VID_EnableJoystick().
Definition at line 70 of file vid_sdl.c.
Referenced by VID_InitModeGL(), and VID_SetMouse().
Definition at line 68 of file vid_sdl.c.
Referenced by IN_Move(), VID_InitModeGL(), and VID_SetMouse().
Definition at line 69 of file vid_sdl.c.
Referenced by IN_Move(), and VID_SetMouse().
|
static |
Definition at line 72 of file vid_sdl.c.
Referenced by Sys_SDL_HandleEvents(), VID_ApplyDisplayMode(), and VID_InitModeGL().
|
static |
Definition at line 72 of file vid_sdl.c.
Referenced by Sys_SDL_HandleEvents(), VID_ApplyDisplayMode(), and VID_InitModeGL().
|
static |
Definition at line 81 of file vid_sdl.c.
Referenced by IN_Move(), Sys_SDL_HandleEvents(), VID_ApplyDisplayMode(), VID_ApplyDisplayMode_c(), VID_Finish(), VID_InitModeGL(), and VID_Shutdown().