/
gl_sysfb.h
62 lines (41 loc) · 1.32 KB
/
gl_sysfb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __POSIX_SDL_GL_SYSFB_H__
#define __POSIX_SDL_GL_SYSFB_H__
#include <SDL.h>
#include "v_video.h"
class SystemGLFrameBuffer : public DFrameBuffer
{
typedef DFrameBuffer Super;
public:
// this must have the same parameters as the Windows version, even if they are not used!
SystemGLFrameBuffer (void *hMonitor, bool fullscreen);
~SystemGLFrameBuffer ();
void ForceBuffering (bool force);
bool IsFullscreen ();
virtual void SetVSync( bool vsync );
void SwapBuffers();
friend class SDLGLVideo;
int GetClientWidth() override;
int GetClientHeight() override;
void ToggleFullscreen(bool yes) override;
void SetWindowSize(int client_w, int client_h);
SDL_Window *GetSDLWindow() { return Screen; }
void GetWindowBordersSize(int &top, int &left);
bool m_fsswitch;
protected:
void SetGammaTable(uint16_t *tbl);
void ResetGammaTable();
SystemGLFrameBuffer () {}
uint8_t GammaTable[3][256];
bool UpdatePending;
SDL_Window *Screen;
SDL_GLContext GLContext;
void UpdateColors ();
Uint16 m_origGamma[3][256];
bool m_supportsGamma;
static const int MIN_WIDTH = 320;
static const int MIN_HEIGHT = 200;
typedef DECLSPEC int SDLCALL (*SDL_GetWindowBordersSizePtr)(SDL_Window *, int *, int *, int *, int *);
SDL_GetWindowBordersSizePtr SDL_GetWindowBordersSize_;
void *sdl_lib;
};
#endif // __POSIX_SDL_GL_SYSFB_H__