DXGL r890 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r889
|
r890
|
r891
>
Date:
01:26, 9 January 2019
Author:
admin
Status:
new
Tags:
Comment:
Redraw surface format test window when contents change in windowed mode.
Attempt to initialize a reference D3D device in software D3D mode (non-DXGL mode).
Modified paths:
/dxglcfg/tests.cpp
(modified) (
history
)
Diff
[
purge
]
Index: dxglcfg/tests.cpp
—
—
@@ -1,5 +1,5 @@
2
2
// DXGL
3
-// Copyright (C) 2011 William Feely
3
+// Copyright (C) 2011-2019 William Feely
4
4
5
5
// This library is free software; you can redistribute it and/or
6
6
// modify it under the terms of the GNU Lesser General Public
—
—
@@ -557,7 +557,12 @@
558
558
if (FAILED(error)) d3dfail = TRUE;
559
559
else
560
560
{
561
- if(softd3d) error = d3d7->EnumZBufferFormats(IID_IDirect3DRGBDevice, zcallback, &ddpfz);
561
+ if(softd3d)
562
+ {
563
+ error = d3d7->CreateDevice(IID_IDirect3DRefDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
564
+ if(error != D3D_OK)
565
+ error = d3d7->EnumZBufferFormats(IID_IDirect3DRGBDevice, zcallback, &ddpfz);
566
+ }
562
567
else error = d3d7->EnumZBufferFormats(IID_IDirect3DHALDevice, zcallback, &ddpfz);
563
568
error = ddsrender->GetSurfaceDesc(&ddsd);
564
569
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
—
—
@@ -580,7 +585,9 @@
581
586
{
582
587
if (!softd3d)
583
588
{
584
- error = d3d7->CreateDevice(IID_IDirect3DRGBDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
589
+ error = d3d7->CreateDevice(IID_IDirect3DRefDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
590
+ if(error != D3D_OK)
591
+ error = d3d7->CreateDevice(IID_IDirect3DRGBDevice, (LPDIRECTDRAWSURFACE7)ddsrender->GetSurface(), &d3d7dev);
585
592
if (error != D3D_OK)
586
593
{
587
594
d3dfail = TRUE;
—
—
@@ -2323,6 +2330,8 @@
2324
2331
D3DVIEWPORT7 viewport;
2325
2332
D3DDEVICEDESC7 d3ddevdesc;
2326
2333
DWORD texwidth, texheight;
2334
+ POINT p;
2335
+ RECT srcrect,destrect;
2327
2336
errorlocation = 0;
2328
2337
errornumber = 0;
2329
2338
if (ddver > 3)
—
—
@@ -2621,6 +2630,16 @@
2622
2631
}
2623
2632
DrawFormatTestHUD(ddsrender, srcformat, destformat, showhud, testpattern,
2624
2633
testmethod, ddsd.dwWidth, ddsd.dwHeight, errorlocation, errornumber);
2634
+ if (!fullscreen)
2635
+ {
2636
+ p.x = 0;
2637
+ p.y = 0;
2638
+ ClientToScreen(hWnd, &p);
2639
+ GetClientRect(hWnd, &destrect);
2640
+ OffsetRect(&destrect, p.x, p.y);
2641
+ SetRect(&srcrect, 0, 0, width, height);
2642
+ if (ddsurface && ddsrender)error = ddsurface->Blt(&destrect, ddsrender, &srcrect, DDBLT_WAIT, NULL);
2643
+ }
2625
2644
}
2626
2645
2627
2646
void RunTestLooped(int test)
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