DXGL r318 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r317
|
r318
|
r319
>
Date:
00:09, 8 February 2013
Author:
admin
Status:
new
Tags:
Comment:
Add IDirect3DDevice object creation in QueryInterface of IDirect3DDevice7.
Accept DDraw1 Z-buffers in AddAttachedSurface.
Modified paths:
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
/ddraw/glDirectDrawSurface.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -418,7 +418,23 @@
419
419
return D3D_OK;
420
420
}
421
421
}
422
- ERR(E_NOINTERFACE);
422
+ if(riid == IID_IDirect3DDevice)
423
+ {
424
+ if(glD3DDev1)
425
+ {
426
+ *ppvObj = glD3DDev1;
427
+ glD3DDev1->AddRef();
428
+ return D3D_OK;
429
+ }
430
+ else
431
+ {
432
+ this->AddRef();
433
+ *ppvObj = new glDirect3DDevice1(this);
434
+ glD3DDev1 = (glDirect3DDevice1*)*ppvObj;
435
+ return D3D_OK;
436
+ }
437
+ }
438
+ return E_NOINTERFACE;
423
439
}
424
440
425
441
ULONG WINAPI glDirect3DDevice7::AddRef()
Index: ddraw/glDirectDrawSurface.cpp
—
—
@@ -499,7 +499,7 @@
500
500
DDSURFACEDESC2 ddsd;
501
501
ddsd.dwSize = sizeof(DDSURFACEDESC2);
502
502
attached->GetSurfaceDesc(&ddsd);
503
- if(ddsd.ddpfPixelFormat.dwFlags & DDPF_ZBUFFER)
503
+ if((ddsd.ddpfPixelFormat.dwFlags & DDPF_ZBUFFER) || (ddsd.ddsCaps.dwCaps & DDSCAPS_ZBUFFER))
504
504
{
505
505
attached->AddRef();
506
506
zbuffer = attached;
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