diff options
Diffstat (limited to 'src/video')
-rw-r--r-- | src/video/cocoa/cocoa_ogl.h | 3 | ||||
-rw-r--r-- | src/video/cocoa/cocoa_v.h | 2 | ||||
-rw-r--r-- | src/video/sdl2_opengl_v.h | 3 | ||||
-rw-r--r-- | src/video/video_driver.cpp | 2 | ||||
-rw-r--r-- | src/video/video_driver.hpp | 1 | ||||
-rw-r--r-- | src/video/win32_v.h | 3 |
6 files changed, 13 insertions, 1 deletions
diff --git a/src/video/cocoa/cocoa_ogl.h b/src/video/cocoa/cocoa_ogl.h index be5d73113..9d95cd606 100644 --- a/src/video/cocoa/cocoa_ogl.h +++ b/src/video/cocoa/cocoa_ogl.h @@ -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 */ diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index a32c7065d..371e4b5bc 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.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(); } }; diff --git a/src/video/sdl2_opengl_v.h b/src/video/sdl2_opengl_v.h index a59233db6..71bc4373a 100644 --- a/src/video/sdl2_opengl_v.h +++ b/src/video/sdl2_opengl_v.h @@ -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; } }; diff --git a/src/video/video_driver.cpp b/src/video/video_driver.cpp index 5e2518435..cb81f857d 100644 --- a/src/video/video_driver.cpp +++ b/src/video/video_driver.cpp @@ -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(); diff --git a/src/video/video_driver.hpp b/src/video/video_driver.hpp index 938dd84bf..58802efab 100644 --- a/src/video/video_driver.hpp +++ b/src/video/video_driver.hpp @@ -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 { diff --git a/src/video/win32_v.h b/src/video/win32_v.h index 017467118..6dec59300 100644 --- a/src/video/win32_v.h +++ b/src/video/win32_v.h @@ -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 */ |