26#include <condition_variable>
28# include <emscripten.h>
29# include <emscripten/html5.h>
66 if (
_sdl_palette ==
nullptr) UserError(
"SDL2: Couldn't allocate palette: {}", SDL_GetError());
130 SDL_UpdateWindowSurfaceRects(this->
sdl_window, &r, 1);
140 if (
_sdl_real_surface ==
nullptr) UserError(
"SDL2: Couldn't get window surface: {}", SDL_GetError());
152 if (
_sdl_rgb_surface ==
nullptr) UserError(
"SDL2: Couldn't allocate shadow surface: {}", SDL_GetError());
static Blitter * GetCurrentBlitter()
Get the current active blitter (always set by calling SelectBlitter).
How all blitters should look like.
virtual uint8_t GetScreenDepth()=0
Get the screen depth this blitter works for.
virtual Blitter::PaletteAnimation UsePaletteAnimation()=0
Check if the blitter uses palette animation at all.
virtual void PaletteAnimate(const Palette &palette)=0
Called when the 8bpp palette is changed; you should redraw all pixels on the screen that are equal to...
@ None
No palette animation.
@ Blitter
The blitter takes care of the palette animation.
@ VideoBackend
Palette animation should be done by video backend (8bpp only!).
Factory for the SDL video driver.
Palette local_palette
Current palette to use for drawing.
Rect dirty_rect
Rectangle encompassing the dirty area of the video buffer.
struct SDL_Window * sdl_window
Main SDL window.
void UpdatePalette()
Update the dirty palette colours.
bool AllocateBackingStore(int w, int h, bool force=false) override
(Re-)create the backing store.
void * GetVideoPointer() override
Get a pointer to the video buffer.
void Paint() override
Paint the window.
void MakePalette()
Allocate and configure the palette.
Error reporting related functions.
Factory to 'query' all available blitters.
Functions for standard in/out file operations.
Types for recording game performance data.
@ Video
Speed of painting drawn video buffer.
bool IsEmptyRect(const Rect &r)
Check if a rectangle is empty.
Functions related to the gfx engine.
Basic functions/variables used all over the place.
bool CopyPalette(Palette &local_palette, bool force_copy)
Copy the current palette if the palette was updated.
Functions related to modal progress.
Declaration of OTTD revision dependent variables.
A number of safeguards to prevent using unsafe methods.
static SDL_Palette * _sdl_palette
The palette mapping.
static FVideoDriver_SDL_Default iFVideoDriver_SDL_Default
The default, non-GL, SDL video driver.
static SDL_Surface * _sdl_real_surface
The actual surface of the screen.
static SDL_Surface * _sdl_rgb_surface
Optional surface to use for blitting all changes at once.
static SDL_Surface * _sdl_surface
The surface to draw on/to.
Default backend of the SDL2 video driver.
Definition of base types and functions in a cross-platform compatible way.
Window functions not directly related to making/drawing windows.