DXGL r170 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r169‎ | r170 | r171 >
Date:21:13, 10 June 2012
Author:admin
Status:new
Tags:
Comment:
Fix thread leaks.
Add missing troubleshooting.htm file to repository
Modified paths:
  • /Help/troubleshooting.htm (added) (history)
  • /ddraw/glRenderer.cpp (modified) (history)
  • /dxgltest/timer.cpp (modified) (history)

Diff [purge]

Index: Help/troubleshooting.htm
@@ -0,0 +1,37 @@
 2+<!DOCTYPE html>
 3+<html>
 4+ <head>
 5+ <title>Configuration</title>
 6+ <link rel="stylesheet" type="text/css" href="dxgl.css" />
 7+ </head>
 8+ <body>
 9+ <h1>Troubleshooting</h1>
 10+ <h2>Problem: DXGL does not load</h2>
 11+ <h3>Cause: No application profile</h3>
 12+ Solution: Open "Configure DXGL" and click the Add button. Browse to your program and double click it.
 13+ <h3>Cause: System ddraw.dll registered under absolute path</h3>
 14+ Solution: Open the file dllpaths.reg in the DXGL installation folder. This will fix initialization for the
 15+ current user.
 16+ <h3>Cause: Program does not use DirectDraw</h3>
 17+ Solution: Make sure your program is configured to use DirectDraw or Direct3D up to version 7.
 18+ <h2>Problem: Program crashes</h2>
 19+ <h3>Cause: Incompatible Application Compatibility flags in registry</h3>
 20+ Solution: Browse to the folder where the application is installed. Right click the program file and click Properties.
 21+ Click the Compatibility tab and make sure no compatibility options are checked. If this does not solve your problem,
 22+ open Registry Editor and browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
 23+ and make sure there is no entry for your program. If there is, delete the entry.
 24+ <h3>Cause: Bug in DXGL</h3>
 25+ Solution: Go to <a href="https://www.williamfeely.info/bugzilla">https://www.williamfeely.info/bugzilla</a> and create a
 26+ bug report. Please be sure to be as descriptive as possible.
 27+ <h3>Cause: Change color depth option checked</h3>
 28+ Solution: Uncheck Change color depth in DXGL Config.
 29+ <h2>Problem: Graphics corruption or missing graphics</h2>
 30+ <h3>Cause: Bug in DXGL</h3>
 31+ Solution: Go to <a href="https://www.williamfeely.info/bugzilla">https://www.williamfeely.info/bugzilla</a> and create a
 32+ bug report. Please be sure to be as descriptive as possible.
 33+ <h2>Problem: OpenGL error message on load</h2>
 34+ <h3>Cause: Incompatible drivers</h3>
 35+ Solution: Make sure your graphics card supports OpenGL 2.0 and framebuffer objects. Then go to the graphics card
 36+ manufacturer's website and download updated drivers.
 37+ </body>
 38+</html>
Index: ddraw/glRenderer.cpp
@@ -292,6 +292,7 @@
293293 CloseHandle(busy);
294294 LeaveCriticalSection(&cs);
295295 DeleteCriticalSection(&cs);
 296+ CloseHandle(hThread);
296297 }
297298
298299 /**
@@ -1238,7 +1239,6 @@
12391240 return;
12401241 }
12411242 outputs[0] = (void*)D3D_OK;
1242 - SetEvent(busy);
12431243 GLfloat color[4];
12441244 dwordto4float(dwColor,color);
12451245 if(target->zbuffer) SetFBO(target->texture,target->GetZBuffer()->texture,target->GetZBuffer()->hasstencil);
@@ -1262,12 +1262,13 @@
12631263 glClear(clearbits);
12641264 if(target->zbuffer) target->zbuffer->dirty |= 2;
12651265 target->dirty |= 2;
 1266+ SetEvent(busy);
12661267 }
12671268
12681269 void glRenderer::_Flush()
12691270 {
 1271+ glFlush();
12701272 SetEvent(busy);
1271 - glFlush();
12721273 }
12731274
12741275 void glRenderer::_DrawPrimitives(glDirect3DDevice7 *device, GLenum mode, GLVERTEX *vertices, int *texformats, DWORD count, LPWORD indices,
Index: dxgltest/timer.cpp
@@ -61,6 +61,7 @@
6262 if(!hThread)
6363 {
6464 hThread = CreateThread(NULL,0,TimerThread,NULL,0,NULL);
 65+ CloseHandle(hThread);
6566 }
6667 }
6768 void StopTimer()