OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
15 #include <condition_variable>
32 bool ClaimMousePointer()
override;
59 bool MakeWindow(
bool full_screen,
bool resize =
true);
60 void ClientSizeChanged(
int w,
int h,
bool force =
false);
74 friend LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
87 const char *
GetName()
const override {
return "win32"; }
94 void Paint()
override;
100 void UpdatePalette(HDC dc, uint start, uint count);
104 static int RedrawScreenDebug();
120 VideoDriver_Win32OpenGL() : dc(nullptr), gl_rc(nullptr), anim_buffer(nullptr) {}
124 void Stop()
override;
139 uint8 *
GetAnimBuffer()
override {
return this->anim_buffer; }
143 const char *
GetName()
const override {
return "win32-opengl"; }
152 void Paint()
override;
159 const char *AllocateContext();
160 void DestroyContext();
166 FVideoDriver_Win32OpenGL() :
DriverFactoryBase(
Driver::DT_VIDEO, 10,
"win32-opengl",
"Win32 OpenGL Video Driver") {}
virtual bool AllocateBackingStore(int w, int h, bool force=false)=0
(Re-)create the backing store.
void MainLoop() override
Perform the actual drawing.
virtual bool HasAnimBuffer()
Does this video driver support a separate animation buffer in addition to the colour buffer?
Base class for Windows video drivers.
virtual const char * GetName() const =0
Get the name of this driver.
The base of all video drivers.
Dimensions (a width and height) of a rectangle in 2D.
void Paint() override
Paint the window.
void EditBoxLostFocus() override
An edit box lost the input focus.
int width
Width in pixels of our display surface.
virtual void ReleaseVideoPointer()
Hand video buffer back to the painting backend.
DriverFactoryBase(Driver::Type type, int priority, const char *name, const char *description)
Construct a new DriverFactory.
bool PollEvent() override
Process a single system event.
virtual Driver * CreateInstance() const =0
Create an instance of this driver-class.
HWND main_wnd
Handle to system window.
bool buffer_locked
Video buffer was locked by the main thread.
bool AllocateBackingStore(int w, int h, bool force=false) override
(Re-)create the backing store.
Dimension GetScreenSize() const override
Get the resolution of the main screen.
int height_org
Original monitor resolution height, before we changed it.
int height
Height in pixels of our display surface.
virtual void ClearSystemSprites()
Clear all cached sprites.
void * buffer_bits
Internal rendering buffer.
HBITMAP dib_sect
System bitmap object referencing our rendering buffer.
void Stop() override
Stop this driver.
virtual void PaletteChanged(HWND hWnd)=0
Palette of the window has changed.
std::vector< int > GetListOfMonitorRefreshRates() override
Get a list of refresh rates of each available monitor.
void PaletteChanged(HWND hWnd) override
Palette of the window has changed.
virtual void Paint()
Paint the window.
const char * GetName() const override
Get the name of this driver.
virtual void ToggleVsync(bool vsync)
Change the vsync setting.
virtual const char * Start(const StringList &parm)=0
Start this driver.
void CheckPaletteAnim() override
Process any pending palette animation.
The factory for Windows' video driver.
bool has_focus
Does our window have system focus?
std::vector< std::string > StringList
Type for a list of strings.
bool MakeWindow(bool full_screen, bool resize=true)
Instantiate a new window.
virtual uint8 GetFullscreenBpp()
Get screen depth to use for fullscreen mode.
void Stop() override
Stop this driver.
bool ToggleFullscreen(bool fullscreen) override
Change the full screen setting.
void UnlockVideoBuffer() override
Unlock a previously locked video buffer.
virtual uint8 * GetAnimBuffer()
Get a pointer to the animation buffer of the video back-end.
virtual bool UseSystemCursor()
Get whether the mouse cursor is drawn by the video driver.
int width_org
Original monitor resolution width, before we changed it.
virtual void PopulateSystemSprites()
Populate all sprites in cache.
const char * Start(const StringList ¶m) override
Start this driver.
bool fullscreen
Whether to use (true) fullscreen mode.
virtual void * GetVideoPointer()=0
Get a pointer to the video buffer.
@ DT_VIDEO
A video driver.
void MakeDirty(int left, int top, int width, int height) override
Mark a particular area dirty.
Driver * CreateInstance() const override
Create an instance of this driver-class.
virtual bool UsesHardwareAcceleration() const
Does the driver use hardware acceleration (video-drivers only).
bool LockVideoBuffer() override
Make sure the video buffer is ready for drawing.
The GDI video driver for windows.
Rect dirty_rect
Region of the screen that needs redrawing.
bool ChangeResolution(int w, int h) override
Change the resolution of the window.
bool AfterBlitterChange() override
Callback invoked after the blitter was changed.
virtual bool HasEfficient8Bpp() const
Has this video driver an efficient code path for palette animated 8-bpp sprites?
A driver for communicating with the user.
Specification of a rectangle with absolute coordinates of all edges.
float GetDPIScale() override
Get DPI scaling factor of the screen OTTD is displayed on.
void * GetVideoPointer() override
Get a pointer to the video buffer.
void InputLoop() override
Handle input logic, is CTRL pressed, should we fast-forward, etc.
Base for all driver factories.
virtual bool AfterBlitterChange()
Callback invoked after the blitter was changed.
HPALETTE gdi_palette
Palette object for 8bpp blitter.