DXGL r432 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r431
|
r432
|
r433
>
Date:
02:05, 20 April 2014
Author:
admin
Status:
new
Tags:
Comment:
Move swap control and blt vertex list into glRenderer class.
Modified paths:
/ddraw/glRenderer.cpp
(modified) (
history
)
/ddraw/glRenderer.h
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glRenderer.cpp
—
—
@@ -33,7 +33,6 @@
34
34
#include "shadergen.h"
35
35
#include "matrix.h"
36
36
37
-BltVertex bltvertices[4];
38
37
const GLushort bltindices[4] = {0,1,2,3};
39
38
40
39
/**
—
—
@@ -60,14 +59,12 @@
61
60
return (number<<2)+(number>>4);
62
61
}
63
62
64
-int oldswap = 0;
65
-
66
63
/**
67
64
* Sets the Windows OpenGL swap interval
68
65
* @param swap
69
66
* Number of vertical retraces to wait per frame, 0 disable vsync
70
67
*/
71
-inline void SetSwap(int swap)
68
+inline void glRenderer::_SetSwap(int swap)
72
69
{
73
70
if(swap != oldswap)
74
71
{
—
—
@@ -191,6 +188,7 @@
192
189
*/
193
190
glRenderer::glRenderer(int width, int height, int bpp, bool fullscreen, unsigned int frequency, HWND hwnd, glDirectDraw7 *glDD7)
194
191
{
192
+ oldswap = 0;
195
193
fogcolor = 0;
196
194
fogstart = 0.0f;
197
195
fogend = 1.0f;
—
—
@@ -785,11 +783,11 @@
786
784
}
787
785
gllock = false;
788
786
InitGLExt();
789
- SetSwap(1);
787
+ _SetSwap(1);
790
788
SwapBuffers(hDC);
791
789
glFinish();
792
790
timer.Calibrate(height, frequency);
793
- SetSwap(0);
791
+ _SetSwap(0);
794
792
SetViewport(0,0,width,height);
795
793
glViewport(0,0,width,height);
796
794
SetDepthRange(0.0,1.0);
—
—
@@ -1081,7 +1079,7 @@
1082
1080
}
1083
1081
DepthTest(false);
1084
1082
RECT *viewrect = &r2;
1085
- SetSwap(vsync);
1083
+ _SetSwap(vsync);
1086
1084
LONG sizes[6];
1087
1085
GLfloat view[4];
1088
1086
GLint viewport[4];
—
—
@@ -1319,10 +1317,10 @@
1320
1318
if(!wglMakeCurrent(hDC,hRC))
1321
1319
DEBUG("glRenderer::SetWnd: Can not activate GL context\n");
1322
1320
gllock = false;
1323
- SetSwap(1);
1321
+ _SetSwap(1);
1324
1322
SwapBuffers(hDC);
1325
1323
timer.Calibrate(height, frequency);
1326
- SetSwap(0);
1324
+ _SetSwap(0);
1327
1325
SetViewport(0,0,width,height);
1328
1326
}
1329
1327
Index: ddraw/glRenderer.h
—
—
@@ -69,8 +69,6 @@
70
70
#define OP_DELETEFBO 13
71
71
72
72
73
-extern inline void SetSwap(int swap);
74
-
75
73
class glDirectDraw7;
76
74
class glDirect3DDevice7;
77
75
class glDirectDrawSurface7;
—
—
@@ -126,6 +124,7 @@
127
125
void _SetFogStart(GLfloat start);
128
126
void _SetFogEnd(GLfloat end);
129
127
void _SetFogDensity(GLfloat density);
128
+ inline void _SetSwap(int swap);
130
129
int opcode;
131
130
void* inputs[32];
132
131
void* outputs[32];
—
—
@@ -148,6 +147,8 @@
149
148
GLfloat fogstart;
150
149
GLfloat fogend;
151
150
GLfloat fogdensity;
151
+ BltVertex bltvertices[4];
152
+ int oldswap;
152
153
};
153
154
154
155
#endif //_GLRENDERER_H
\ No newline at end of file
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