DXGL r118 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r117
|
r118
|
r119
>
Date:
20:02, 8 March 2012
Author:
admin
Status:
new
Tags:
Comment:
Add GetCaps, GetRenderTarget, and SetRenderTarget to IDirect3DDevice7 interface
Modified paths:
/ddraw/glDirect3D.h
(modified) (
history
)
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3D.h
—
—
@@ -19,6 +19,7 @@
20
20
#ifndef __GLDIRECT3D_H
21
21
#define __GLDIRECT3D_H
22
22
23
+extern D3DDEVICEDESC7 d3ddesc;
23
24
class glDirectDraw7;
24
25
25
26
class glDirect3D7 : public IDirect3D7
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -477,8 +477,11 @@
478
478
HRESULT WINAPI glDirect3DDevice7::GetCaps(LPD3DDEVICEDESC7 lpD3DDevDesc)
479
479
{
480
480
if(!this) return DDERR_INVALIDPARAMS;
481
- FIXME("glDirect3DDevice7::GetCaps: stub");
482
- ERR(DDERR_GENERIC);
481
+ D3DDEVICEDESC7 desc = d3ddesc;
482
+ desc.dwDevCaps |= D3DDEVCAPS_HWRASTERIZATION | D3DDEVCAPS_HWTRANSFORMANDLIGHT;
483
+ desc.deviceGUID = IID_IDirect3DTnLHalDevice;
484
+ memcpy(lpD3DDevDesc,&desc,sizeof(D3DDEVICEDESC7));
485
+ return D3D_OK;
483
486
}
484
487
HRESULT WINAPI glDirect3DDevice7::GetClipPlane(DWORD dwIndex, D3DVALUE *pPlaneEquation)
485
488
{
—
—
@@ -536,8 +539,9 @@
537
540
HRESULT WINAPI glDirect3DDevice7::GetRenderTarget(LPDIRECTDRAWSURFACE7 *lplpRenderTarget)
538
541
{
539
542
if(!this) return DDERR_INVALIDPARAMS;
540
- FIXME("glDirect3DDevice7::GetRenderTarget: stub");
541
- ERR(DDERR_GENERIC);
543
+ if(!lplpRenderTarget) return DDERR_INVALIDPARAMS;
544
+ *lplpRenderTarget = glDDS7;
545
+ return D3D_OK;
542
546
}
543
547
HRESULT WINAPI glDirect3DDevice7::GetStateData(DWORD dwState, LPVOID* lplpStateData)
544
548
{
—
—
@@ -682,8 +686,16 @@
683
687
HRESULT WINAPI glDirect3DDevice7::SetRenderTarget(LPDIRECTDRAWSURFACE7 lpNewRenderTarget, DWORD dwFlags)
684
688
{
685
689
if(!this) return DDERR_INVALIDPARAMS;
686
- FIXME("glDirect3DDevice7::SetRenderTarget: stub");
687
- ERR(DDERR_GENERIC);
690
+ if(!lpNewRenderTarget) return DDERR_INVALIDPARAMS;
691
+ if(dwFlags) return DDERR_INVALIDPARAMS;
692
+ DDSURFACEDESC2 ddsd;
693
+ ddsd.dwSize = sizeof(DDSURFACEDESC2);
694
+ lpNewRenderTarget->GetSurfaceDesc(&ddsd);
695
+ if(!(ddsd.ddsCaps.dwCaps & DDSCAPS_3DDEVICE)) return DDERR_INVALIDSURFACETYPE;
696
+ glDDS7->Release();
697
+ glDDS7 = (glDirectDrawSurface7*)lpNewRenderTarget;
698
+ glDDS7->AddRef();
699
+ return D3D_OK;
688
700
}
689
701
HRESULT WINAPI glDirect3DDevice7::SetStateData(DWORD dwState, LPVOID lpStateData)
690
702
{
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