DXGL r42 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r41
|
r42
|
r43
>
Date:
21:44, 24 December 2011
Author:
admin
Status:
new
Tags:
Comment:
Another attempt at vsync fixes.
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/ddraw/glDirectDrawSurface.cpp
(modified) (
history
)
/ddraw/glExtensions.cpp
(modified) (
history
)
/ddraw/glExtensions.h
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -1347,6 +1347,8 @@
1348
1348
}
1349
1349
gllock = false;
1350
1350
InitGLExt();
1351
+ SetSwap(1);
1352
+ SetSwap(0);
1351
1353
glViewport(0,0,width,height);
1352
1354
glMatrixMode(GL_PROJECTION);
1353
1355
glLoadIdentity();
Index: ddraw/glDirectDrawSurface.cpp
—
—
@@ -24,12 +24,13 @@
25
25
#include "glDirectDrawPalette.h"
26
26
#include "glDirectDrawClipper.h"
27
27
28
-int swapinterval;
28
+int swapinterval = 0;
29
29
inline void SetSwap(int swap)
30
30
{
31
31
if(swap != swapinterval)
32
32
{
33
33
wglSwapIntervalEXT(swap);
34
+ swapinterval = wglGetSwapIntervalEXT();
34
35
swapinterval = swap;
35
36
}
36
37
}
—
—
@@ -734,7 +735,6 @@
735
736
else if(dwFlags & DDFLIP_INTERVAL4) SetSwap(4);
736
737
else SetSwap(1);
737
738
}
738
-
739
739
int flips = 1;
740
740
if(lpDDSurfaceTargetOverride) ERR(DDERR_GENERIC);
741
741
if(ddsd.ddsCaps.dwCaps & DDSCAPS_FLIP)
—
—
@@ -777,7 +777,7 @@
778
778
RenderScreen(textures[0],this);
779
779
delete textures;
780
780
}
781
- else ERR(DDERR_NOTFLIPPABLE);
781
+ else return DDERR_NOTFLIPPABLE;
782
782
flipcount+=flips;
783
783
if(flipcount > ddsd.dwBackBufferCount) flipcount -= (ddsd.dwBackBufferCount+1);
784
784
return DD_OK;
Index: ddraw/glExtensions.cpp
—
—
@@ -50,6 +50,7 @@
51
51
void (APIENTRY *glActiveTexture)(GLenum texture) = NULL;
52
52
53
53
BOOL (APIENTRY *wglSwapIntervalEXT)(int interval) = NULL;
54
+int (APIENTRY *wglGetSwapIntervalEXT)() = NULL;
54
55
55
56
int GLEXT_ARB_framebuffer_object = 0;
56
57
int GLEXT_EXT_framebuffer_object = 0;
—
—
@@ -99,4 +100,5 @@
100
101
glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)wglGetProcAddress("glCheckFramebufferStatusEXT");
101
102
}
102
103
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");
104
+ wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)wglGetProcAddress("wglGetSwapIntervalEXT");
103
105
}
Index: ddraw/glExtensions.h
—
—
@@ -57,6 +57,7 @@
58
58
GLAPI void (APIENTRY *glActiveTexture)(GLenum texture);
59
59
60
60
GLAPI BOOL (APIENTRY *wglSwapIntervalEXT)(int interval);
61
+GLAPI int (APIENTRY *wglGetSwapIntervalEXT)();
61
62
62
63
void InitGLExt();
63
64
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