Fix #10079: don't render at 1000fps if HW acceleration + vsync is requested but not active (#12067)

This commit is contained in:
Patric Stout
2024-02-12 22:39:23 +01:00
committed by GitHub
parent 79374bc003
commit bad31f2d42
8 changed files with 14 additions and 11 deletions

View File

@@ -23,7 +23,7 @@ class VideoDriver_CocoaOpenGL : public VideoDriver_Cocoa {
const char *AllocateContext(bool allow_software);
public:
VideoDriver_CocoaOpenGL() : gl_context(nullptr), anim_buffer(nullptr), driver_info(this->GetName()) {}
VideoDriver_CocoaOpenGL() : VideoDriver_Cocoa(true), gl_context(nullptr), anim_buffer(nullptr), driver_info(this->GetName()) {}
const char *Start(const StringList &param) override;
void Stop() override;

View File

@@ -35,7 +35,7 @@ public:
OTTD_CocoaWindowDelegate *delegate; //!< Window delegate object
public:
VideoDriver_Cocoa();
VideoDriver_Cocoa(bool uses_hardware_acceleration = false);
void Stop() override;
void MainLoop() override;

View File

@@ -87,7 +87,8 @@ static const Dimension _default_resolutions[] = {
};
VideoDriver_Cocoa::VideoDriver_Cocoa()
VideoDriver_Cocoa::VideoDriver_Cocoa(bool uses_hardware_acceleration)
: VideoDriver(uses_hardware_acceleration)
{
this->setup = false;
this->buffer_locked = false;