From ab8759049d19046de9fc23ba1f77d512f32e0fe1 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 23 Apr 2017 17:17:36 +0300 Subject: [PATCH] Enabled GLSW framebuffer in Cocoa backend by default Added fallback to generic Cocoa implementation if it's not available (i.e. without OpenGL Core Profile support) Value of vid_glswfb CVAR is now saved to configuration file --- src/posix/cocoa/i_video.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 542d02fdd..14120a59b 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -116,7 +116,7 @@ DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool bgra, bool fullscreen); -CUSTOM_CVAR(Bool, vid_glswfb, false, CVAR_NOINITCALL) +CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_NOINITCALL | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { Printf("This won't take effect until " GAMENAME " is restarted.\n"); } @@ -658,6 +658,13 @@ DFrameBuffer* CocoaVideo::CreateFrameBuffer(const int width, const int height, c else if (vid_glswfb) { fb = CreateGLSWFrameBuffer(width, height, bgra, fullscreen); + + if (!fb->IsValid()) + { + delete fb; + + fb = new CocoaFrameBuffer(width, height, bgra, fullscreen); + } } else {