DXGL r747 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r746‎ | r747 | r748 >
Date:07:55, 15 September 2017
Author:admin
Status:new
Tags:
Comment:
Add single buffer display mode (INI and registry only currently).
Remove beta items from example INI.
Mention link to dxgl.info online help in the CHM help.
Remove beta flag from version info.
Modified paths:
  • /Help/introduction.htm (modified) (history)
  • /cfgmgr/ReadMe.txt (modified) (history)
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /cfgmgr/cfgmgr.h (modified) (history)
  • /common/releasever.h (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)
  • /dxgl-example.ini (modified) (history)

Diff [purge]

Index: Help/introduction.htm
@@ -1,4 +1,4 @@
2 -<!DOCTYPE html>
 2+<!DOCTYPE html>
33 <html>
44 <head>
55 <meta charset="utf-8">
@@ -7,7 +7,7 @@
88 </head>
99 <body id="preview">
1010 <h1>DXGL</h1>
11 - <p><a href="https://www.dxgl.info">https://www.dxgl.info</a></p>
 11+ <p>View help online at <a href="https://www.dxgl.info/help/">https://www.dxgl.info/help/</a></p>
1212 <h2>Introduction</h2>
1313 <p>DXGL is a free replacement for the Windows ddraw.dll library, running on OpenGL. It is designed to overcome driver bugs, particularly in Windows Vista and newer operating systems. It also adds various enhancements to the graphics output such as display scaling and filtering options. DXGL supports the DirectX 7.0 graphics APIs, however it is currently under development and many programs are not yet compatible with DXGL.</p>
1414 <h2>Updgrade notes</h2>
Index: cfgmgr/ReadMe.txt
@@ -282,6 +282,12 @@
283283 Valid settings:
284284 0 - Automatic
285285
 286+Member SingleBufferDevice
 287+INI Entry SingleBufferDevice
 288+INI Group advanced
 289+REG_DWORD HKCU\DXGL\Profiles\<app>\SingleBufferDevice
 290+If true, do not use double buffering in OpenGL.
 291+
286292 Default for all Debug variables is 0 or FALSE.
287293
288294 Member DebugNoExtFramebuffer
Index: cfgmgr/cfgmgr.c
@@ -556,6 +556,7 @@
557557 cfg->vsync = ReadDWORD(hKey,cfg->vsync,&cfgmask->vsync,_T("VSync"));
558558 cfg->TextureFormat = ReadDWORD(hKey,cfg->TextureFormat,&cfgmask->TextureFormat,_T("TextureFormat"));
559559 cfg->TexUpload = ReadDWORD(hKey,cfg->TexUpload,&cfgmask->TexUpload,_T("TexUpload"));
 560+ cfg->SingleBufferDevice = ReadBool(hKey,cfg->SingleBufferDevice,&cfgmask->SingleBufferDevice,_T("SingleBufferDevice"));
560561 cfg->Windows8Detected = ReadBool(hKey,cfg->Windows8Detected,&cfgmask->Windows8Detected,_T("Windows8Detected"));
561562 cfg->DPIScale = ReadDWORD(hKey,cfg->DPIScale,&cfgmask->DPIScale,_T("DPIScale"));
562563 cfg->aspect = ReadFloat(hKey, cfg->aspect, &cfgmask->aspect, _T("ScreenAspect"));
@@ -678,6 +679,7 @@
679680 WriteDWORD(hKey,cfg->vsync,cfgmask->vsync,_T("VSync"));
680681 WriteDWORD(hKey,cfg->TextureFormat,cfgmask->TextureFormat,_T("TextureFormat"));
681682 WriteDWORD(hKey,cfg->TexUpload,cfgmask->TexUpload,_T("TexUpload"));
 683+ WriteBool(hKey,cfg->SingleBufferDevice,cfgmask->SingleBufferDevice,_T("SingleBufferDevice"));
682684 WriteBool(hKey,cfg->Windows8Detected,cfgmask->Windows8Detected,_T("Windows8Detected"));
683685 WriteDWORD(hKey,cfg->DPIScale,cfgmask->DPIScale,_T("DPIScale"));
684686 WriteFloat(hKey, cfg->aspect, cfgmask->aspect, _T("ScreenAspect"));
@@ -909,6 +911,7 @@
910912 if (!stricmp(name, "VSync")) cfg->vsync = INIIntValue(value);
911913 if (!stricmp(name, "TextureFormat")) cfg->TextureFormat = INIIntValue(value);
912914 if (!stricmp(name, "TexUpload")) cfg->TexUpload = INIIntValue(value);
 915+ if (!stricmp(name, "SingleBufferDevice")) cfg->SingleBufferDevice = INIBoolValue(value);
913916 }
914917 if (!stricmp(section, "debug"))
915918 {
Index: cfgmgr/cfgmgr.h
@@ -57,6 +57,7 @@
5858 DWORD vsync;
5959 DWORD TextureFormat;
6060 DWORD TexUpload;
 61+ BOOL SingleBufferDevice;
6162 // [debug]
6263 BOOL DebugNoExtFramebuffer;
6364 BOOL DebugNoArbFramebuffer;
Index: common/releasever.h
@@ -5,7 +5,7 @@
66 #define DXGLMAJORVER 0
77 #define DXGLMINORVER 5
88 #define DXGLPOINTVER 12
9 -#define DXGLBETA 1
 9+#define DXGLBETA 0
1010
1111 #define STR2(x) #x
1212 #define STR(x) STR2(x)
Index: ddraw/glRenderer.cpp
@@ -2668,7 +2668,8 @@
26692669 ZeroMemory(&pfd,sizeof(PIXELFORMATDESCRIPTOR));
26702670 pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
26712671 pfd.nVersion = 1;
2672 - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
 2672+ if (dxglcfg.SingleBufferDevice) pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
 2673+ else pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
26732674 pfd.iPixelType = PFD_TYPE_RGBA;
26742675 pfd.cColorBits = bpp;
26752676 pfd.iLayerType = PFD_MAIN_PLANE;
@@ -3733,7 +3734,8 @@
37343735 ZeroMemory(&pfd,sizeof(PIXELFORMATDESCRIPTOR));
37353736 pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
37363737 pfd.nVersion = 1;
3737 - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
 3738+ if (dxglcfg.SingleBufferDevice) pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
 3739+ else pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
37383740 pfd.iPixelType = PFD_TYPE_RGBA;
37393741 pfd.cColorBits = bpp;
37403742 pfd.iLayerType = PFD_MAIN_PLANE;
Index: dxgl-example.ini
@@ -92,26 +92,9 @@
9393 ; AllColorDepths - Boolean
9494 ; Adds 8, 16, 24, and 32-bit color modes if they are not already
9595 ; added to the list of display modes passed to the program.
96 -; (future)Equivalent to setting AddColorDepths to 21.
97 -; (future)Overridden by AddColorDepths.
9896 ; Default is true if Windows 8 or higher is detected, false otherwise.
9997 AllColorDepths = true
10098
101 -; AddColorDepths - Integer
102 -; (future) Adds additional color modes if they are not already
103 -; added to the list of display modes passed to the program.
104 -; This is a bit-mapped variable, add up the desired color depths from
105 -; the list of values below:
106 -; 1 - Add 8-bit modes
107 -; 2 - Add 15-bit modes
108 -; 4 - Add 16-bit modes
109 -; 8 - Add 24-bit modes
110 -; 16 - Add 32-bit modes
111 -; Default is 21 if Windows 8 or higher is detected, 0 otherwise.
112 -; Adding both 15 and 16 bit modes at the same time may cause
113 -; crashes or undefined behavior in some programs.
114 -AddColorDepths = 21
115 -
11699 ; ExtraModes - Boolean
117100 ; Adds additional video modes to the list of resolutions.
118101 ; If a display scaling mode is not set and postprocess scaling
@@ -118,24 +101,8 @@
119102 ; is set to automatic, it will add several low resolution pixel doubled
120103 ; video modes.
121104 ; Default is true.
122 -; (future)Equivalent to setting AddModes to 7. Overridden by AddModes.
123105 ExtraModes = true
124106
125 -; AddModes - Integer
126 -; (future) Adds additional video modes to the list of resolutions.
127 -; This is a bitmapped variable, add up the desired mode lists from
128 -; the list of values below:
129 -; 0 - None
130 -; 1 - Add common low-resolution modes
131 -; 2 - Add less common low-resolution modes
132 -; 4 - Add uncommon standard definition modes
133 -; 8 - Add high definition modes
134 -; 16 - Add QHD to UHD modes.
135 -; 32 - Add over-4K UHD modes. Check GPU specifications before enabling.
136 -; 64 - Add very uncommon resolutions of all dimensions.
137 -; Default is 1.
138 -AddModes = 1
139 -
140107 ; SortModes - Integer
141108 ; Determines whether or not to sort display modes by either
142109 ; resolution first or color depth first. This can make in-game
@@ -166,31 +133,9 @@
167134 ; The following values are valid:
168135 ; 0 - Use native primary surface size. Most compatible.
169136 ; 1 - Adjust primary surface size to match display.
170 -; The following will be added in the future:
171 -; 2 - Adjust primary surface to nearest integer multiple of native.
172 -; 3 - Use exact 1.5x scale.
173 - ; 4 - Use exact 2x scale.
174 -; 5 - Use exact 2.5x scale.
175 -; 6 - Use exact 3x scale.
176 -; 7 - Use exact 4x scale.
177 -; 8 - Use custom scale.
178137 ; Default is 0.
179138 AdjustPrimaryResolution = 0
180139
181 -; PrimaryScaleX - Floating point
182 -; (future) Sets the scaling amount in the X dimension for custom primary
183 -; buffer scaling.
184 -; If zero, negative, or an invalid value, will be interpreted as 1.0
185 -; Default is 1.0
186 -PrimaryScaleX = 1.0
187 -
188 -; PrimaryScaleY - Floating point
189 -; (future) Sets the scaling amount in the Y dimension for custom primary
190 -; buffer scaling.
191 -; If zero, negative, or an invalid value, will be interpreted as 1.0
192 -; Default is 1.0
193 -PrimaryScaleY = 1.0
194 -
195140 ; ScreenAspect - Floating point or string
196141 ; Sets the aspect ratio of the display output.
197142 ; May be entered as a floating point number or as aspect ratio notation.
@@ -223,9 +168,7 @@
224169 [postprocess]
225170 ; PostprocessFilter - Integer
226171 ; Selects the filter to use for the postprocess pass.
227 -; (future)If a post processing shader is selected this will be clamped to 1
228 -; or overridden by the shader metadata.
229 -; This will be ignored if there is no
 172+; This will be ignored if there is no postprocess pass or scaling is 1.
230173 ; The following values are valid:
231174 ; 0 - Nearest-neighbor stretching
232175 ; 1 - Bilinear interpolation
@@ -249,21 +192,6 @@
250193 ; Default is 0.0
251194 PostprocessScaleY = 0.0
252195
253 -; EnableShader - Boolean
254 -; (future) If true, uses a custom shader to render the postprocess pass.
255 -; Default is false
256 -EnableShader = false
257 -
258 -; ShaderFile - String
259 -; (future)Path to a file containing either a GLSL fragment shader or a
260 -; to-be-determined metadata file containing a shader pipeline and certain
261 -; parameters.
262 -; The path can be relative (will search the Shaders subdirectory of the
263 -; install directory and the path where the ddraw.dll implementation has been
264 -; placed) or absolute.
265 -; Default is undefined.
266 -; ShaderFile = example.fs
267 -
268196 [d3d]
269197 ; TextureFilter - Integer
270198 ; Texture filtering method for Direct3D draw commands.
@@ -340,6 +268,12 @@
341269 ; currently 0.
342270 TexUpload = 0
343271
 272+; SingleBufferDevice - Boolean
 273+; If true, creates an OpenGL device without double buffering. This has
 274+; various effects, such as disabling vsync and exclusive fullscreen.
 275+; Default is false
 276+SingleBufferDevice = false
 277+
344278 [debug]
345279 ; DebugNoExtFramebuffer - Boolean
346280 ; Disables use of the EXT_framebuffer_object OpenGL extension.