mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-09 17:22:49 -10:00
When rendering directly to the output buffer, we need to maintain the state of what has been drawn and what needs redrawing per-buffer. We previously tried to do it implicitly by checking `SDL_DOUBLEBUF` and other flags. The previous implementation was broken in several ways, resulting in rendering issues on devices that support 8-bit output directly. Changes this mechanism to explicitly maintain buffer state per output buffer. The new mechanism doesn't require knowledge of the number of buffers, and thus also works correctly with triple-buffering. Fixes #5447
29 lines
687 B
C++
29 lines
687 B
C++
/**
|
|
* @file dx.h
|
|
*
|
|
* Interface of functions setting up the graphics pipeline.
|
|
*/
|
|
#pragma once
|
|
|
|
#include "engine.h"
|
|
|
|
namespace devilution {
|
|
|
|
/** Whether we render directly to the screen surface, i.e. `PalSurface == GetOutputSurface()` */
|
|
extern bool RenderDirectlyToOutputSurface;
|
|
|
|
extern SDL_Surface *PalSurface;
|
|
|
|
Surface GlobalBackBuffer();
|
|
|
|
void dx_init();
|
|
void dx_cleanup();
|
|
void CreateBackBuffer();
|
|
void InitPalette();
|
|
void BltFast(SDL_Rect *srcRect, SDL_Rect *dstRect);
|
|
void Blit(SDL_Surface *src, SDL_Rect *srcRect, SDL_Rect *dstRect);
|
|
void RenderPresent();
|
|
void PaletteGetEntries(int dwNumEntries, SDL_Color *lpEntries);
|
|
|
|
} // namespace devilution
|