DXGL r779 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r778‎ | r779 | r780 >
Date:21:17, 15 December 2017
Author:admin
Status:new
Tags:
Comment:
Add VSync control.
Fix a buffer overrun in DXGL Config.
Modified paths:
  • /ddraw/glRenderer.cpp (modified) (history)
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: ddraw/glRenderer.cpp
@@ -1611,6 +1611,8 @@
16121612 */
16131613 void glRenderer__SetSwap(glRenderer *This, int swap)
16141614 {
 1615+ if (dxglcfg.vsync == 1) swap = 0;
 1616+ else if (dxglcfg.vsync == 2) swap = 1;
16151617 if(swap != This->oldswap)
16161618 {
16171619 This->ext->wglSwapIntervalEXT(swap);
@@ -2720,6 +2722,7 @@
27212723 glFinish();
27222724 DXGLTimer_Init(&This->timer);
27232725 DXGLTimer_Calibrate(&This->timer, height, frequency);
 2726+ if (dxglcfg.vsync == 1) This->oldswap = 1;
27242727 glRenderer__SetSwap(This,0);
27252728 glUtil_SetViewport(This->util,0,0,width,height);
27262729 glViewport(0,0,width,height);
Index: dxglcfg/dxglcfg.cpp
@@ -93,7 +93,7 @@
9494 TCHAR strdefault[] = _T("(global default)");
9595 TCHAR strdefaultshort[] = _T("(default)");
9696 HWND hTab;
97 -HWND hTabs[6];
 97+HWND hTabs[8];
9898 static int tabopen;
9999
100100 static const TCHAR *colormodes[32] = {