2018-04-09 08:48:20 +00:00
|
|
|
#ifndef __POSIX_SDL_GL_SYSFB_H__
|
|
|
|
#define __POSIX_SDL_GL_SYSFB_H__
|
|
|
|
|
|
|
|
#include <SDL.h>
|
|
|
|
|
|
|
|
#include "v_video.h"
|
|
|
|
|
2018-06-24 18:16:30 +00:00
|
|
|
class SystemGLFrameBuffer : public DFrameBuffer
|
2018-04-09 08:48:20 +00:00
|
|
|
{
|
|
|
|
typedef DFrameBuffer Super;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// this must have the same parameters as the Windows version, even if they are not used!
|
2018-06-24 18:16:30 +00:00
|
|
|
SystemGLFrameBuffer (void *hMonitor, bool fullscreen);
|
|
|
|
~SystemGLFrameBuffer ();
|
2018-04-09 08:48:20 +00:00
|
|
|
|
|
|
|
void ForceBuffering (bool force);
|
|
|
|
|
|
|
|
bool IsFullscreen ();
|
|
|
|
|
|
|
|
virtual void SetVSync( bool vsync );
|
|
|
|
void SwapBuffers();
|
|
|
|
|
|
|
|
friend class SDLGLVideo;
|
|
|
|
|
2018-06-17 20:09:25 +00:00
|
|
|
int GetClientWidth() override;
|
|
|
|
int GetClientHeight() override;
|
|
|
|
void ToggleFullscreen(bool yes) override;
|
2018-04-09 08:48:20 +00:00
|
|
|
|
|
|
|
SDL_Window *GetSDLWindow() { return Screen; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void SetGammaTable(uint16_t *tbl);
|
|
|
|
void ResetGammaTable();
|
|
|
|
|
2018-06-24 18:16:30 +00:00
|
|
|
SystemGLFrameBuffer () {}
|
2018-04-09 08:48:20 +00:00
|
|
|
uint8_t GammaTable[3][256];
|
|
|
|
bool UpdatePending;
|
|
|
|
|
|
|
|
SDL_Window *Screen;
|
|
|
|
|
|
|
|
SDL_GLContext GLContext;
|
|
|
|
|
|
|
|
void UpdateColors ();
|
|
|
|
|
|
|
|
Uint16 m_origGamma[3][256];
|
|
|
|
bool m_supportsGamma;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __POSIX_SDL_GL_SYSFB_H__
|