Commit Graph

220 Commits (0b2567d882827f3a2c8b9e927c4d7f354e498a58)

Author SHA1 Message Date
Henry Wilson 0b2567d882 Codechange: Remove shift as fast-forward key when _DEBUG is defined 1 year ago
Peter Nelson 9666e46739 Feature: Variable GUI scale.
GUI scale is now variable from 100% to 500%, and no longer restricted to
powers-of-2.
2 years ago
Bouke Haarsma 45d98f689a Fix #9993: Handle DPI changes on macOS and Windows 2 years ago
Niels Martin Hansen 345dcd3c7b Add: Show current video driver info in Options window 2 years ago
Patric Stout 74186998a2 Codechange: use _cur_palette the same in all the drivers
It was a bit of a mixed bag. With this change, gfx.cpp is in
control who accesses _cur_palette from the video-drivers.
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
glx22 d485b50813 Fix: [MinGW] Ignore wglGetProcAddress() cast warnings 3 years ago
glx22 744a9e4745 Codechange: [WIN32] Add a wrapper around GetProcAddress() 3 years ago
glx22 2df48a78cc Fix: [MinGW32] Can't convert lambda to stdcall 3 years ago
glx22 f4c7d5577e Codechange: [WIN32] Use VersionHelpers where appropriate 3 years ago
Michael Lutz f4d5c8d99e
Fix: [OpenGL] Main loop expects to start with the video buffer unmapped. (#9100) 3 years ago
Michael Lutz ef80baf75c Codechange: [Win32] Try getting an OpenGL 4.5 context first before aiming at 3.2. 3 years ago
Michael Lutz e53313391a Fix: [OpenGL] Check maximum supported texture size against screen resolution. 3 years ago
Michael Lutz 5644c00482
Fix: Check for a validly mapped OpenGL screen buffer during driver init. (#9007) 3 years ago
Patric Stout f0f2073006 Feature: allow a toggle to enable/disable vsync
Vsync should be off by default, as for most players it will be
better to play without vsync. Exception exist, mainly people who
play in fullscreen mode.
3 years ago
Jonathan G Rennison 39b7ef31f8 Fix: Data races on cursor state in OpenGL backends 3 years ago
Michael Lutz 96d33ab46a Fix #8930: [Win32] Don't handle printable keys on keydown if an edit box is in focus.
Handle printable input only when the matching WM_CHAR message is incoming.
Without an edit box, do the handling in keydown as usual to support hotkeys.
3 years ago
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 3 years ago
Michael Lutz f0f96e3103
Fix #8871: [OpenGL] Initialize all buffers after resize and clear back buffer. (#8877) 3 years ago
sean 0464a50ab8
Add: Display refresh rate game option (#8813) 3 years ago
Patric Stout e56d2c63c3 Add: [Video] move GameLoop into its own thread
This allows drawing to happen while the GameLoop is doing an
iteration too.

Sadly, not much drawing currently can be done while the GameLoop
is running, as for example PollEvent() or UpdateWindows() can
influence the game-state. As such, they first need to acquire a
lock on the game-state before they can be called.

Currently, the main advantage is the time spend in Paint(), which
for non-OpenGL drivers can be a few milliseconds. For OpenGL this
is more like 0.05 milliseconds; in these instances this change
doesn't add any benefits for now.

This is an alternative to the former "draw-thread", which moved
the drawing in a thread for some OSes. It has similar performance
gain as this does, although this implementation allows for more
finer control over what suffers when the GameLoop takes too
long: drawing or the next GameLoop. For now they both suffer
equally.
3 years ago
Michael Lutz 3a4a15cc93 Codechange: don't set the window position when changing blitter
There really is no need to make an extra call to the OS in
these cases.
3 years ago
Patric Stout 4610aa7ae3 Remove: [Video] no longer draw in a thread
Drawing in a thread is a bit odd, and often leads to surprising
issues. For example, OpenGL would only allow it if you move the
full context to the thread. Which is not always easily done on
all OSes.
In general, the advise is to handle system events and drawing
from the main thread, and do everything else in other threads.
So, let's be more like other games.

Additionally, putting the drawing routine in a thread was only
done for a few targets.

Upcoming commit will move the GameLoop in a thread, which will
work for all targets.
3 years ago
Patric Stout 04db99749b
Fix #8784: using alt+enter didn't update the fullscreen toggle visibly (#8820)
Basically, the window was not invalidated, so it was never redrawn.
This made it look like it wasn't working, but it really was.
3 years ago
Michael Lutz c656633bea Fix #8775: [Win32] Don't create the main window when alt-tabbing back into fullscreen. 3 years ago
Michael Lutz b7a44983b4 Fix: [Win32] Original window size was lost when tabbing in and out of fullscreen. 3 years ago
Patric Stout c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
3 years ago
Michael Lutz 311df31fb1 Codechange: [OpenGL] Load all OpenGL functions dynamically. 3 years ago
Patric Stout 67d3c6aa71 Codechange: [Video] move InteractiveRandom() to the VideoDriver 3 years ago
Patric Stout c409f45ddd Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
3 years ago
Niels Martin Hansen b427ddce88 Codechange: Switch to explicit wide strings 3 years ago
Niels Martin Hansen beeb9e0a1b Remove: [Win32] Last pretenses of being able to build for Windows 95 3 years ago
Michael Lutz 06ca147a82 Fix 8706c36f: Change RELEASE code, too. 3 years ago
Michael Lutz 200be7d20c Add: [OpenGL] Support for a separate animation buffer that stores the palette values of the screen in addition to the colour buffer. 3 years ago
Michael Lutz 6bcc4884c2 Add: [OpenGL] Accelerated mouse cursor drawing. 3 years ago
Michael Lutz f94b2e73e1 Codechange: [Win32] Use an OpenGL core context instead of a compatibility one. 3 years ago
Michael Lutz e8fc050b6e Add: [OpenGL] Support for 8bpp blitters. 3 years ago
Michael Lutz b181859629 Change: [Win32] Disable VSync for OpenGL by default. 3 years ago
Michael Lutz 9a069faa01 Codechange: [Win32] Try to get an OpenGL 3.2+ context if possible. 3 years ago
Michael Lutz a990c497b5 Codechange: [OpenGL] Use a pixel buffer object to store the video buffer. 3 years ago
Michael Lutz 8706c36fc0 Codechange: [Win32] Move remaing global _wnd variables into the video driver. 3 years ago
Michael Lutz d6b6775888 Change: Lock the video buffer when drawing inside the game loop to properly account for threaded drawing. 3 years ago
Michael Lutz 73ed748deb Codechange: [Win32] Move the global video buffer pointer into the driver class. 3 years ago
Michael Lutz 5ad545dcc1 Codechange: [OpenGL] Only update the dirty parts of the video buffer texture. 3 years ago
Michael Lutz d7b96a424f Codechange: [OpenGL] Use new-style extension testing introduced with OpenGL 3.0. 3 years ago
Michael Lutz ef478ade64 Add: [Win32] Video driver that uses OpenGL to transfer the video buffer to the screen. 3 years ago
Michael Lutz af4d32357c Codechange: [Win32] Move common initialization and finalization to the video driver base class. 3 years ago
Michael Lutz 78b8fc3e4f Codechange: [Win32] Move GDI-specific variables and related functions into the GDI video driver class. 3 years ago
Michael Lutz 8b90d4abe0 Codechange: [Win32] Move GDI specific drawing code into the GDI video driver class. 3 years ago
Michael Lutz 59e0d9618b Codechange: [Win32] Split the video driver into a base class and a GDI backend class. 3 years ago