DXGL r726 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r725‎ | r726 | r727 >
Date:04:05, 24 July 2017
Author:admin
Status:new
Tags:
Comment:
Support debug option to disable ARB or EXT framebuffers.
Make "no framebuffer" error dialog better.
Modified paths:
  • /ddraw/glExtensions.c (modified) (history)

Diff [purge]

Index: ddraw/glExtensions.c
@@ -1,5 +1,5 @@
22 // DXGL
3 -// Copyright (C) 2011-2016 William Feely
 3+// Copyright (C) 2011-2017 William Feely
44
55 // This library is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU Lesser General Public
@@ -113,9 +113,11 @@
114114 ExitProcess(-1);
115115 }
116116 glextensions = glGetString(GL_EXTENSIONS);
117 - if(strstr((char*)glextensions,"GL_ARB_framebuffer_object") || (ext->glver_major >= 3)) ext->GLEXT_ARB_framebuffer_object = 1;
 117+ if((strstr((char*)glextensions,"GL_ARB_framebuffer_object") || (ext->glver_major >= 3))
 118+ && !dxglcfg.DebugNoArbFramebuffer) ext->GLEXT_ARB_framebuffer_object = 1;
118119 else ext->GLEXT_ARB_framebuffer_object = 0;
119 - if(strstr((char*)glextensions,"GL_EXT_framebuffer_object")) ext->GLEXT_EXT_framebuffer_object = 1;
 120+ if(strstr((char*)glextensions,"GL_EXT_framebuffer_object") && !dxglcfg.DebugNoExtFramebuffer)
 121+ ext->GLEXT_EXT_framebuffer_object = 1;
120122 else ext->GLEXT_EXT_framebuffer_object = 0;
121123 if(strstr((char*)glextensions,"GL_NV_packed_depth_stencil")) ext->GLEXT_NV_packed_depth_stencil = 1;
122124 else ext->GLEXT_NV_packed_depth_stencil = 0;
@@ -213,8 +215,12 @@
214216 }
215217 if(broken_fbo)
216218 {
217 - MessageBox(NULL,_T("DXGL requires support for OpenGL Framebuffer Objects to function. \
218 -Please contact your graphics card manufacturer for an updated driver. This program will now exit."),_T("Fatal error"),
 219+ if(dxglcfg.DebugNoArbFramebuffer || dxglcfg.DebugNoExtFramebuffer)
 220+ MessageBox(NULL, _T("An invalid debug setting has been detected. DXGL requires framebuffer support and the only \
 221+available framebuffer extension(s) have been disabled.\r\n\r\nPlease disable DebugNoArbFramebuffer and/or DebugNoExtFramebuffer \
 222+and restart this program.\r\n\r\nThis program will now exit."), _T("Fatal error"), MB_OK | MB_ICONERROR);
 223+ else MessageBox(NULL,_T("DXGL requires support for OpenGL Framebuffer Objects to function.\n\n\
 224+Please contact your graphics card manufacturer for an updated driver.\n\nThis program will now exit."),_T("Fatal error"),
219225 MB_OK|MB_ICONERROR);
220226 ExitProcess(-1);
221227 }