OpenTTD Source: src/video/sdl2_v.cpp File Reference

OpenTTD Source 15.3

Data Structures | Macros | Functions | Variables
sdl2_v.cpp File Reference

Implementation of the SDL2 video driver. More...

`#include "../stdafx.h"`
`#include "../openttd.h"`
`#include "../gfx_func.h"`
`#include "../blitter/factory.hpp"`
`#include "../thread.h"`
`#include "../progress.h"`
`#include "../core/math_func.hpp"`
`#include "../core/geometry_func.hpp"`
`#include "../core/utf8.hpp"`
`#include "../fileio_func.h"`
`#include "../framerate_type.h"`
`#include "../window_func.h"`
`#include "sdl2_v.h"`
`#include <SDL.h>`
`#include "../safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | SDLVkMapping

## Macros
#define | AS(x, z) {x, x, z, z, false}
#define | AM(x, y, z, w) {x, y, z, w, false}
#define | AS_UP(x, z) {x, x, z, z, true}
#define | AM_UP(x, y, z, w) {x, y, z, w, true}

## Functions
static void | FindResolutions ()
static void | GetAvailableVideoMode (uint *w, uint *h)
static uint | FindStartupDisplay (uint startup_display)
static uint | ConvertSdlKeyIntoMy (SDL_Keysym *sym, char32_t *character)
static uint | ConvertSdlKeycodeIntoMy (SDL_Keycode kc)
| Like ConvertSdlKeyIntoMy(), but takes an SDL_Keycode as input instead of an SDL_Keysym.
static std::optional< std::string_view > | InitializeSDL ()

## Variables
static const Dimension | default_resolutions []
static constexpr SDLVkMapping | _vk_mapping []

## Detailed Description

Implementation of the SDL2 video driver.

Definition in file sdl2_v.cpp.

## Macro Definition Documentation

## ◆ AM

#define AM | ( |  | x,
|  |  | y,
|  |  | z,
|  |  | w
| ) |  | {x, y, z, w, false}

Definition at line 255 of file sdl2_v.cpp.

## ◆ AM_UP

#define AM_UP | ( |  | x,
|  |  | y,
|  |  | z,
|  |  | w
| ) |  | {x, y, z, w, true}

Definition at line 257 of file sdl2_v.cpp.

## ◆ AS

#define AS | ( |  | x,
|  |  | z
| ) |  | {x, x, z, z, false}

Definition at line 254 of file sdl2_v.cpp.

## ◆ AS_UP

#define AS_UP | ( |  | x,
|  |  | z
| ) |  | {x, x, z, z, true}

Definition at line 256 of file sdl2_v.cpp.

## Function Documentation

## ◆ ConvertSdlKeycodeIntoMy()

static uint ConvertSdlKeycodeIntoMy | ( | SDL_Keycode | kc | ) |
| static

Like ConvertSdlKeyIntoMy(), but takes an SDL_Keycode as input instead of an SDL_Keysym.

Definition at line 360 of file sdl2_v.cpp.

References IsInsideBS().

Referenced by VideoDriver_SDL_Base::PollEvent().

## ◆ ConvertSdlKeyIntoMy()

static uint ConvertSdlKeyIntoMy | ( | SDL_Keysym * | sym,
|  | char32_t * | character
| ) |  |
| static

Definition at line 321 of file sdl2_v.cpp.

## ◆ FindResolutions()

static void FindResolutions | ( |  | ) |
| static

Definition at line 57 of file sdl2_v.cpp.

## ◆ FindStartupDisplay()

static uint FindStartupDisplay | ( | uint | startup_display | ) |
| static

Definition at line 102 of file sdl2_v.cpp.

## ◆ GetAvailableVideoMode()

static void GetAvailableVideoMode | ( | uint * | w,
|  | uint * | h
| ) |  |
| static

Definition at line 80 of file sdl2_v.cpp.

## ◆ InitializeSDL()

static std::optional< std::string_view > InitializeSDL | ( |  | ) |
| static

Definition at line 531 of file sdl2_v.cpp.

## Variable Documentation

## ◆ _vk_mapping

constexpr SDLVkMapping _vk_mapping[]
| staticconstexpr

Definition at line 259 of file sdl2_v.cpp.

## ◆ default_resolutions

const Dimension default_resolutions[]
| static

Initial value:
= {
{ 640, 480 },
{ 800, 600 },
{ 1024, 768 },
{ 1152, 864 },
{ 1280, 800 },
{ 1280, 960 },
{ 1280, 1024 },
{ 1400, 1050 },
{ 1600, 1200 },
{ 1680, 1050 },
{ 1920, 1200 }
}

Definition at line 43 of file sdl2_v.cpp.