2018-04-09 08:48:20 +00:00
|
|
|
#ifndef __WIN32_GL_SYSFB_H__
|
|
|
|
#define __WIN32_GL_SYSFB_H__
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
#include "v_video.h"
|
|
|
|
|
2018-06-24 18:16:30 +00:00
|
|
|
class SystemGLFrameBuffer : public DFrameBuffer
|
2013-06-23 07:49:34 +00:00
|
|
|
{
|
2018-03-30 22:25:15 +00:00
|
|
|
typedef DFrameBuffer Super;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
2018-06-17 20:09:25 +00:00
|
|
|
void SaveWindowedPos();
|
|
|
|
void RestoreWindowedPos();
|
|
|
|
|
2013-06-23 07:49:34 +00:00
|
|
|
public:
|
2018-06-24 18:16:30 +00:00
|
|
|
SystemGLFrameBuffer() {}
|
2013-06-23 07:49:34 +00:00
|
|
|
// Actually, hMonitor is a HMONITOR, but it's passed as a void * as there
|
|
|
|
// look to be some cross-platform bits in the way.
|
2018-06-24 18:16:30 +00:00
|
|
|
SystemGLFrameBuffer(void *hMonitor, bool fullscreen);
|
|
|
|
virtual ~SystemGLFrameBuffer();
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
void SetVSync (bool vsync);
|
2013-08-18 12:16:33 +00:00
|
|
|
void SwapBuffers();
|
2013-06-23 07:49:34 +00:00
|
|
|
|
2018-06-17 20:09:25 +00:00
|
|
|
int GetClientWidth() override;
|
|
|
|
int GetClientHeight() override;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
2018-06-17 20:09:25 +00:00
|
|
|
bool IsFullscreen() override;
|
|
|
|
void ToggleFullscreen(bool yes) override;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
void InitializeState();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2018-06-24 18:11:08 +00:00
|
|
|
void GetCenteredPos(int in_w, int in_h, int &winx, int &winy, int &winw, int &winh, int &scrwidth, int &scrheight);
|
|
|
|
void KeepWindowOnScreen(int &winx, int &winy, int winw, int winh, int scrwidth, int scrheight);
|
|
|
|
|
2018-06-17 20:09:25 +00:00
|
|
|
void PositionWindow(bool fullscreen);
|
2018-06-17 14:19:14 +00:00
|
|
|
|
2016-07-26 19:27:02 +00:00
|
|
|
void ResetGammaTable();
|
2017-03-08 17:50:37 +00:00
|
|
|
void SetGammaTable(uint16_t * tbl);
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
float m_Gamma, m_Brightness, m_Contrast;
|
2017-03-09 12:16:01 +00:00
|
|
|
uint16_t m_origGamma[768];
|
|
|
|
bool m_supportsGamma;
|
2018-06-17 14:19:14 +00:00
|
|
|
bool m_Fullscreen;
|
2017-03-09 12:16:01 +00:00
|
|
|
char m_displayDeviceNameBuffer[32/*CCHDEVICENAME*/]; // do not use windows.h constants here!
|
2013-06-23 07:49:34 +00:00
|
|
|
char *m_displayDeviceName;
|
2018-06-17 14:19:14 +00:00
|
|
|
void *m_Monitor;
|
2016-09-25 23:38:25 +00:00
|
|
|
int SwapInterval;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
friend class Win32GLVideo;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2018-04-09 08:48:20 +00:00
|
|
|
#endif // __WIN32_GL_SYSFB_H__
|