summaryrefslogtreecommitdiff
path: root/src/video/win32_v.h
AgeCommit message (Collapse)Author
2021-04-12Fix: [win32] buffer_locked state not initialised, causing _screen.dst_ptr to ↵Rubidium
be potentially not set
2021-04-11Feature: allow a toggle to enable/disable vsyncPatric Stout
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.
2021-03-09Add: Display refresh rate game option (#8813)sean
2021-03-08Add: [Video] move GameLoop into its own threadPatric Stout
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.
2021-03-08Codechange: don't set the window position when changing blitterMichael Lutz
There really is no need to make an extra call to the OS in these cases.
2021-03-08Remove: [Video] no longer draw in a threadPatric Stout
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.
2021-03-08Add: Option to (dis-)allow accelerated video drivers. (#8819)Patric Stout
The video drivers using the OpenGL backend are currently our only accelerated drivers. The options defaults to off for macOS builds and to on everywhere else. Co-authored-by: Michael Lutz <michi@icosahedron.de>
2021-02-24Codechange: [Video] make the prototype of PollEvent() the same for all driversPatric Stout
Additionally, call it from the draw-tick.
2021-02-22Add: [OpenGL] Support for a separate animation buffer that stores the ↵Michael Lutz
palette values of the screen in addition to the colour buffer.
2021-02-22Change: [Win32] Prioritize the OpenGL video driver over the GDI one.Michael Lutz
2021-02-22Add: [OpenGL] Accelerated mouse cursor drawing.Michael Lutz
2021-02-22Add: [OpenGL] Support for 8bpp blitters.Michael Lutz
2021-02-22Change: [Win32] Disable VSync for OpenGL by default.Michael Lutz
2021-02-22Codechange: [OpenGL] Use a pixel buffer object to store the video buffer.Michael Lutz
2021-02-22Codechange: [Win32] Move remaing global _wnd variables into the video driver.Michael Lutz
2021-02-22Change: Lock the video buffer when drawing inside the game loop to properly ↵Michael Lutz
account for threaded drawing.
2021-02-22Codechange: [Win32] Move the global video buffer pointer into the driver class.Michael Lutz
2021-02-22Codechange: [OpenGL] Only update the dirty parts of the video buffer texture.Michael Lutz
2021-02-22Add: [Win32] Video driver that uses OpenGL to transfer the video buffer to ↵Michael Lutz
the screen.
2021-02-22Codechange: [Win32] Move common initialization and finalization to the video ↵Michael Lutz
driver base class.
2021-02-22Codechange: [Win32] Move GDI-specific variables and related functions into ↵Michael Lutz
the GDI video driver class.
2021-02-22Codechange: [Win32] Move GDI specific drawing code into the GDI video driver ↵Michael Lutz
class.
2021-02-22Codechange: [Win32] Split the video driver into a base class and a GDI ↵Michael Lutz
backend class.
2021-02-20Codechange: be consistent in what CheckPaletteAnim() does and when it is calledPatric Stout
Additionally, make sure this is a class method. Later commits will make use of this.
2021-02-20Codechange: be consistent in naming the paint function Paint()Patric Stout
Also move this function to be a class member. This to allow further deduplicating of code in a later commit.
2021-02-20Codechange: use (Un)LockVideoBuffer() to manage video bufferPatric Stout
2021-02-20Codechange: move all input-handling of video-drivers into InputLoopPatric Stout
2021-02-20Fix: [Win32] now we are drawing on a tick, no longer use WM_PAINTPatric Stout
WM_PAINT hits when-ever Windows feels like, but always after we marked the screen as dirty. In result, it was lagging behind, giving a sub-60fps experience. With the new draw-tick there is no longer a need to be driven by WM_PAINT, so it is better anyway to drive the drawing ourself. As an added bonus this makes the win32 driver more like the others.
2021-02-14Add: [Win32] Automatic zoom level suggestion for Win32 video driver.Michael Lutz
The zoom level suggestion is based on the DPI scaling set in Windows. We use 150% scaling as the threshold for 2X zoom and 300% scaling as the threshold for 4X zoom.
2021-01-14Feature: Choose a sensible window size on a fresh OTTD config file. (#8536)Michael Lutz
2020-05-21Codechange: Use std::string in the driver and blitter selection code.Michael Lutz
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-03-24Codechange: Use override specifer for overriding member declarationsHenry Wilson
This is a C++11 feature that allows the compiler to check that a virtual member declaration overrides a base-class member with the same signature. Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked as virtual despite being a template.
2017-03-11(svn r27775) -Fix [FS#6510]: Insufficient thread synchronisation when ↵frosch
switching blitters. (JGR)
2013-11-25(svn r26108) -Codechange: some coding style (whitespace)rubidium
2013-11-25(svn r26107) -Codechange/cleanup: remove some coding bloat and simplify the ↵rubidium
driver factory instatiations
2013-08-05(svn r25680) -Codechange: [Win32] Cancel the current IME composition when ↵michi_cc
the input focus changes.
2011-11-17(svn r23241) -Codechange: make the decision when to go to the custom drawn ↵rubidium
cursor more prominently during the initialisation of OpenTTD
2011-10-04(svn r22999) -Codechange: Allow changing the blitter during the running game.michi_cc
2011-05-02(svn r22410) -Document: some more bits ;)rubidium
2011-02-26(svn r22149) -Fix [FS#4521]: Windows video driver crashed when it couldn't ↵rubidium
go to full screen at the resolution of the configuration file when starting OpenTTD
2009-09-05(svn r17428) -Codechange: add a function to get the name of a driverrubidium
2009-08-21(svn r17248) -Fix: add GPL license notice where appropriaterubidium
2008-05-06(svn r12971) -Documentation: add @file in files that missed them and add ↵rubidium
something more than whitespace as description of files that don't have a description.
2008-01-01(svn r11734) -Change: Allow ToggleFullScreen to return the result of the ↵belugas
operation' attempt. Previously, only visual clues were available. -Fix[FS#1519]: When you can not use this resolution at full screen, now you'll know that it failed. As for the reason it did not work, each computer/OS has its reason.
2007-07-07(svn r10472) -Fix (r10741): typos prevented compilationpeter1138
2007-07-07(svn r10471) -Codechange: implement driver probing priority so that ↵peter1138
'preferred' drivers are loaded first
2007-07-06(svn r10458) -Fix (r10444): restore original descriptions for win32 driverspeter1138
2007-07-05(svn r10444) -Codechange: switch to c++ classes and inheritance for ↵peter1138
sound/music/video drivers, using self-registration based on the blitter-model.
2007-02-12(svn r8691) -Cleanup: Some proper #endif comments for sound/music/video ↵Darkvater
files, and a little elimination of magic numbers in Win32SoundStart