DXGL r725 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r724
|
r725
|
r726
>
Date:
07:36, 22 July 2017
Author:
admin
Status:
new
Tags:
Comment:
Fix INI boolean values.
Support overriding maximum supported OpenGL version.
Improve OpenGL version error dialog, detect RDP sessions when OpenGL version fails, and detect invalid maximum OpenGL version debug values.
Modified paths:
/cfgmgr/cfgmgr.c
(modified) (
history
)
/ddraw/glExtensions.c
(modified) (
history
)
Diff
[
purge
]
Index: cfgmgr/cfgmgr.c
—
—
@@ -798,6 +798,8 @@
799
799
{
800
800
if (value[0] == 'F') return 0;
801
801
if (value[0] == 'f') return 0;
802
+ if (value[0] == 'T') return 1;
803
+ if (value[0] == 't') return 1;
802
804
if (!atoi(value)) return 0;
803
805
return 1;
804
806
}
Index: ddraw/glExtensions.c
—
—
@@ -17,8 +17,8 @@
18
18
19
19
#include "common.h"
20
20
#include "glExtensions.h"
21
+extern DXGLCFG dxglcfg;
21
22
22
-
23
23
void glExtensions_Init(glExtensions *ext)
24
24
{
25
25
const GLubyte *glversion;
—
—
@@ -29,6 +29,19 @@
30
30
glversion = glGetString(GL_VERSION);
31
31
ext->glver_minor = 0;
32
32
if(!sscanf((char*)glversion,"%d.%d",&ext->glver_major,&ext->glver_minor)) ext->glver_major = 0;
33
+ if (dxglcfg.DebugMaxGLVersionMajor)
34
+ {
35
+ if (dxglcfg.DebugMaxGLVersionMajor < ext->glver_major)
36
+ {
37
+ ext->glver_major = dxglcfg.DebugMaxGLVersionMajor;
38
+ ext->glver_minor = dxglcfg.DebugMaxGLVersionMinor;
39
+ }
40
+ else if (dxglcfg.DebugMaxGLVersionMajor == ext->glver_major)
41
+ {
42
+ if (dxglcfg.DebugMaxGLVersionMinor < ext->glver_minor)
43
+ ext->glver_minor = dxglcfg.DebugMaxGLVersionMinor;
44
+ }
45
+ }
33
46
if((ext->glver_major >= 2) || ((ext->glver_major >= 1) && (ext->glver_minor >= 2)))
34
47
ext->glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)wglGetProcAddress("glDrawRangeElements");
35
48
if((ext->glver_major >= 2) || ((ext->glver_major >= 1) && (ext->glver_minor >= 3)))
—
—
@@ -83,9 +96,20 @@
84
97
}
85
98
else
86
99
{
87
- MessageBox(NULL,_T("DXGL requires an OpenGL 2.0 or higher compatible graphics card to function. \
88
-Please contact your graphics card manufacturer for an updated driver. This program will now exit."),_T("Fatal error"),
89
- MB_OK|MB_ICONERROR);
100
+ if (dxglcfg.DebugMaxGLVersionMajor && (dxglcfg.DebugMaxGLVersionMajor < 2))
101
+ MessageBox(NULL, _T("An invalid debug setting has been detected. DXGL requires at least OpenGL 2.0 and the \
102
+debug settings prohibit OpenGL 2.0 support.\r\n\r\nPlease edit the DebugMaxGLVersionMajor setting to at least 2 and restart \
103
+this program.\r\n\r\nThis program will now exit."), _T("Fatal error"), MB_OK | MB_ICONERROR);
104
+ else
105
+ {
106
+ if(GetSystemMetrics(SM_REMOTESESSION))
107
+ MessageBox(NULL, _T("This program appears to be running in a remote desktop session. Since this session \
108
+does not support OpenGL 2.0 or greater, DXGL will not work.\r\n\r\nTry starting this program from a non-remote session.\r\n\r\n\
109
+This program will now exit."), _T("Fatal error"), MB_OK | MB_ICONERROR);
110
+ else MessageBox(NULL, _T("DXGL requires an OpenGL 2.0 or higher compatible graphics card to function. \
111
+Please contact your graphics card manufacturer for an updated driver.\r\n\r\nThis program will now exit."), _T("Fatal error"),
112
+ MB_OK | MB_ICONERROR);
113
+ }
90
114
ExitProcess(-1);
91
115
}
92
116
glextensions = glGetString(GL_EXTENSIONS);
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version