Add: Show current video driver info in Options window

This commit is contained in:
Niels Martin Hansen
2022-04-30 14:52:39 +02:00
parent be72f1e54b
commit 345dcd3c7b
13 changed files with 55 additions and 3 deletions

View File

@@ -18,11 +18,12 @@ class VideoDriver_CocoaOpenGL : public VideoDriver_Cocoa {
CGLContextObj gl_context;
uint8 *anim_buffer; ///< Animation buffer from OpenGL back-end.
std::string driver_info; ///< Information string about selected driver.
const char *AllocateContext(bool allow_software);
public:
VideoDriver_CocoaOpenGL() : gl_context(nullptr), anim_buffer(nullptr) {}
VideoDriver_CocoaOpenGL() : gl_context(nullptr), anim_buffer(nullptr), driver_info(this->GetName()) {}
const char *Start(const StringList &param) override;
void Stop() override;
@@ -41,6 +42,8 @@ public:
/** Return driver name */
const char *GetName() const override { return "cocoa-opengl"; }
const char *GetInfoString() const override { return this->driver_info.c_str(); }
void AllocateBackingStore(bool force = false) override;
protected:

View File

@@ -203,6 +203,11 @@ const char *VideoDriver_CocoaOpenGL::Start(const StringList &param)
return err;
}
this->driver_info = GetName();
this->driver_info += " (";
this->driver_info += OpenGLBackend::Get()->GetDriverName();
this->driver_info += ")";
bool fullscreen = _fullscreen;
if (!this->MakeWindow(_cur_resolution.width, _cur_resolution.height)) {
this->Stop();