DXGL r31 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r30
|
r31
|
r32
>
Date:
21:29, 18 December 2011
Author:
admin
Status:
new
Tags:
Comment:
Fix DXGLTest and render window repainting
Fix render window messages not being processed by glDirectDraw7 class
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/dxgltest/Tests2D.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -1272,7 +1272,7 @@
1273
1273
wndclass.hInstance = (HINSTANCE)GetWindowLongPtr(hWnd,GWLP_HINSTANCE);
1274
1274
wndclass.hIcon = NULL;
1275
1275
wndclass.hCursor = NULL;
1276
- wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
1276
+ wndclass.hbrBackground = NULL;
1277
1277
wndclass.lpszMenuName = NULL;
1278
1278
wndclass.lpszClassName = "DXGLRenderWindow";
1279
1279
wndclass.hIconSm = NULL;
—
—
@@ -1388,7 +1388,12 @@
1389
1389
}
1390
1390
LRESULT glDirectDraw7::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
1391
1391
{
1392
- return DefWindowProcA(hWnd,msg,wParam,lParam);
1392
+ if(msg == WM_CREATE)
1393
+ {
1394
+ SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)this);
1395
+ return 0;
1396
+ }
1397
+ return DefWindowProc(hwnd,msg,wParam,lParam);
1393
1398
}
1394
1399
void glDirectDraw7::GetHandles(HWND *hwnd, HWND *hrender)
1395
1400
{
Index: dxgltest/Tests2D.cpp
—
—
@@ -68,6 +68,7 @@
69
69
70
70
LRESULT CALLBACK DDWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
71
71
{
72
+ bool paintwnd = true;
72
73
POINT p;
73
74
RECT srcrect,destrect;
74
75
HRESULT error;
—
—
@@ -115,8 +116,9 @@
116
117
RunTestTimed(testnum);
117
118
break;
118
119
case WM_SIZE:
120
+ paintwnd = false;
119
121
case WM_PAINT:
120
- BeginPaint(hWnd,&paintstruct);
122
+ if(paintwnd) BeginPaint(hWnd,&paintstruct);
121
123
if(!fullscreen)
122
124
{
123
125
p.x = 0;
—
—
@@ -127,7 +129,7 @@
128
130
SetRect(&srcrect,0,0,width,height);
129
131
if(ddsurface && ddsrender)error = ddsurface->Blt(&destrect,ddsrender,&srcrect,DDBLT_WAIT,NULL);
130
132
}
131
- EndPaint(hWnd,&paintstruct);
133
+ if(paintwnd) EndPaint(hWnd,&paintstruct);
132
134
return 0;
133
135
case WM_MOUSEMOVE:
134
136
RunTestMouse(testnum,WM_MOUSEMOVE,wParam,lParam);
—
—
@@ -268,7 +270,7 @@
269
271
wc.hIconSm = LoadIcon(hinstance,MAKEINTRESOURCE(IDI_DXGLSM));
270
272
if(testnum == 6) wc.hCursor = LoadCursor(NULL,IDC_CROSS);
271
273
else wc.hCursor = LoadCursor(NULL,IDC_ARROW);
272
- wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
274
+ wc.hbrBackground = NULL;
273
275
wc.lpszClassName = wndclassname2d;
274
276
if(!RegisterClassEx(&wc))
275
277
{
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