OpenTTD Source  1.11.0-beta2
sdl_v.cpp File Reference
#include "../stdafx.h"
#include "../openttd.h"
#include "../gfx_func.h"
#include "../rev.h"
#include "../blitter/factory.hpp"
#include "../thread.h"
#include "../progress.h"
#include "../core/random_func.hpp"
#include "../core/math_func.hpp"
#include "../fileio_func.h"
#include "../framerate_type.h"
#include "../window_func.h"
#include "sdl_v.h"
#include <SDL.h>
#include <mutex>
#include <condition_variable>
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  SDLVkMapping
 

Macros

#define MAX_DIRTY_RECTS   100
 
#define AS(x, z)   {x, 0, z}
 
#define AM(x, y, z, w)   {x, (byte)(y - x), z}
 

Functions

static void UpdatePalette (bool init=false)
 
static void InitPalette ()
 
static void GetVideoModes ()
 
static void GetAvailableVideoMode (uint *w, uint *h)
 
static uint ConvertSdlKeyIntoMy (SDL_keysym *sym, WChar *character)
 

Variables

static FVideoDriver_SDL iFVideoDriver_SDL
 
static SDL_Surface * _sdl_surface
 
static SDL_Surface * _sdl_realscreen
 
static bool _all_modes
 
static bool _draw_threaded
 Whether the drawing is/may be done in a separate thread.
 
static std::recursive_mutex * _draw_mutex = nullptr
 Mutex to keep the access to the shared memory controlled.
 
static std::condition_variable_any * _draw_signal = nullptr
 Signal to draw the next frame.
 
static volatile bool _draw_continue
 Should we keep continue drawing?
 
static Palette _local_palette
 
static SDL_Rect _dirty_rects [MAX_DIRTY_RECTS]
 
static int _num_dirty_rects
 
static int _use_hwpalette
 
static int _requested_hwpalette
 
static const Dimension _default_resolutions []
 
static const SDLVkMapping _vk_mapping []
 

Detailed Description

Implementation of the SDL video driver.

Definition in file sdl_v.cpp.

Variable Documentation

◆ _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 198 of file sdl_v.cpp.