Add: Option to (dis-)allow accelerated video drivers. (#8819)
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>
This commit is contained in:
@@ -54,6 +54,9 @@ class FVideoDriver_CocoaOpenGL : public DriverFactoryBase {
|
||||
public:
|
||||
FVideoDriver_CocoaOpenGL() : DriverFactoryBase(Driver::DT_VIDEO, 9, "cocoa-opengl", "Cocoa OpenGL Video Driver") {}
|
||||
Driver *CreateInstance() const override { return new VideoDriver_CocoaOpenGL(); }
|
||||
|
||||
protected:
|
||||
bool UsesHardwareAcceleration() const override { return true; }
|
||||
};
|
||||
|
||||
#endif /* VIDEO_COCOA_OGL_H */
|
||||
|
@@ -122,7 +122,7 @@ protected:
|
||||
|
||||
class FVideoDriver_CocoaQuartz : public DriverFactoryBase {
|
||||
public:
|
||||
FVideoDriver_CocoaQuartz() : DriverFactoryBase(Driver::DT_VIDEO, 10, "cocoa", "Cocoa Video Driver") {}
|
||||
FVideoDriver_CocoaQuartz() : DriverFactoryBase(Driver::DT_VIDEO, 8, "cocoa", "Cocoa Video Driver") {}
|
||||
Driver *CreateInstance() const override { return new VideoDriver_CocoaQuartz(); }
|
||||
};
|
||||
|
||||
|
@@ -51,4 +51,7 @@ class FVideoDriver_SDL_OpenGL : public DriverFactoryBase {
|
||||
public:
|
||||
FVideoDriver_SDL_OpenGL() : DriverFactoryBase(Driver::DT_VIDEO, 8, "sdl-opengl", "SDL OpenGL Video Driver") {}
|
||||
/* virtual */ Driver *CreateInstance() const override { return new VideoDriver_SDL_OpenGL(); }
|
||||
|
||||
protected:
|
||||
bool UsesHardwareAcceleration() const override { return true; }
|
||||
};
|
||||
|
@@ -17,6 +17,8 @@
|
||||
#include "../window_func.h"
|
||||
#include "video_driver.hpp"
|
||||
|
||||
bool _video_hw_accel; ///< Whether to consider hardware accelerated video drivers.
|
||||
|
||||
bool VideoDriver::Tick()
|
||||
{
|
||||
auto cur_ticks = std::chrono::steady_clock::now();
|
||||
|
@@ -23,6 +23,7 @@ extern std::string _ini_videodriver;
|
||||
extern std::vector<Dimension> _resolutions;
|
||||
extern Dimension _cur_resolution;
|
||||
extern bool _rightclick_emulate;
|
||||
extern bool _video_hw_accel;
|
||||
|
||||
/** The base of all video drivers. */
|
||||
class VideoDriver : public Driver {
|
||||
|
@@ -175,6 +175,9 @@ class FVideoDriver_Win32OpenGL : public DriverFactoryBase {
|
||||
public:
|
||||
FVideoDriver_Win32OpenGL() : DriverFactoryBase(Driver::DT_VIDEO, 10, "win32-opengl", "Win32 OpenGL Video Driver") {}
|
||||
/* virtual */ Driver *CreateInstance() const override { return new VideoDriver_Win32OpenGL(); }
|
||||
|
||||
protected:
|
||||
bool UsesHardwareAcceleration() const override { return true; }
|
||||
};
|
||||
|
||||
#endif /* WITH_OPENGL */
|
||||
|
Reference in New Issue
Block a user