mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-09 09:10:51 +00:00
I have no idea why they were even in there, as they intentionally circumvented all GC related features - they declared themselves fixed if prone to getting collected, they all used OF_YesReallyDelete when destroying themselves and they never used any of the object creation or RTTI features, aside from a single assert in V_Init2. Essentially they were a drag on the system and OF_YesReallyDelete was effectively added just to deal with the canvases which were DObjects but not supposed to behave like them in the first place.
60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#include "hardware.h"
|
|
#include "v_video.h"
|
|
#include "sdlglvideo.h"
|
|
|
|
class SDLFB : public SDLBaseFB
|
|
{
|
|
typedef SDLBaseFB Super;
|
|
public:
|
|
SDLFB(int width, int height, bool bgra, bool fullscreen, SDL_Window *oldwin);
|
|
~SDLFB();
|
|
|
|
bool Lock(bool buffer);
|
|
void Unlock();
|
|
bool Relock();
|
|
void ForceBuffering(bool force);
|
|
bool IsValid();
|
|
void Update();
|
|
PalEntry *GetPalette();
|
|
void GetFlashedPalette(PalEntry pal[256]);
|
|
void UpdatePalette();
|
|
bool SetGamma(float gamma);
|
|
bool SetFlash(PalEntry rgb, int amount);
|
|
void GetFlash(PalEntry &rgb, int &amount);
|
|
void SetFullscreen(bool fullscreen);
|
|
int GetPageCount();
|
|
bool IsFullscreen();
|
|
|
|
friend class SDLGLVideo;
|
|
|
|
virtual void SetVSync(bool vsync);
|
|
virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y);
|
|
|
|
SDL_Window *GetSDLWindow() override { return Screen; }
|
|
|
|
private:
|
|
PalEntry SourcePalette[256];
|
|
uint8_t GammaTable[3][256];
|
|
PalEntry Flash;
|
|
int FlashAmount;
|
|
float Gamma;
|
|
bool UpdatePending;
|
|
|
|
SDL_Window *Screen;
|
|
SDL_Renderer *Renderer;
|
|
union
|
|
{
|
|
SDL_Texture *Texture;
|
|
SDL_Surface *Surface;
|
|
};
|
|
|
|
bool UsingRenderer;
|
|
bool NeedPalUpdate;
|
|
bool NeedGammaUpdate;
|
|
bool NotPaletted;
|
|
|
|
void UpdateColors();
|
|
void ResetSDLRenderer();
|
|
|
|
SDLFB() {}
|
|
};
|