DXGL r191 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r190‎ | r191 | r192 >
Date:15:35, 3 July 2012
Author:admin
Status:new
Tags:
Comment:
(DOES NOT BUILD) Add more IDirect3DDevice3 functions.
Modified paths:
  • /ddraw/glDirect3D.h (modified) (history)
  • /ddraw/glDirect3DDevice.cpp (modified) (history)
  • /ddraw/glDirect3DDevice.h (modified) (history)

Diff [purge]

Index: ddraw/glDirect3D.h
@@ -20,6 +20,7 @@
2121 #define __GLDIRECT3D_H
2222
2323 extern D3DDEVICEDESC7 d3ddesc;
 24+extern D3DDEVICEDESC d3ddesc3;
2425 class glDirectDraw7;
2526
2627 class glDirect3D7 : public IDirect3D7
Index: ddraw/glDirect3DDevice.cpp
@@ -1464,21 +1464,111 @@
14651465 if(!this) return DDERR_INVALIDOBJECT;
14661466 return glD3DDev7->End(dwFlags);
14671467 }
1468 - HRESULT WINAPI EndScene();
1469 - HRESULT WINAPI EnumTextureFormats(LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, LPVOID lpArg);
1470 - HRESULT WINAPI GetCaps(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc);
1471 - HRESULT WINAPI GetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus);
1472 - HRESULT WINAPI GetCurrentViewport(LPDIRECT3DVIEWPORT3 *lplpd3dViewport);
1473 - HRESULT WINAPI GetDirect3D(LPDIRECT3D3 *lplpD3D);
1474 - HRESULT WINAPI GetLightState(D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState);
1475 - HRESULT WINAPI GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState);
1476 - HRESULT WINAPI GetRenderTarget(LPDIRECTDRAWSURFACE4 *lplpRenderTarget);
1477 - HRESULT WINAPI GetStats(LPD3DSTATS lpD3DStats);
1478 - HRESULT WINAPI GetTexture(DWORD dwStage, LPDIRECT3DTEXTURE2 * lplpTexture);
1479 - HRESULT WINAPI GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, LPDWORD lpdwValue);
1480 - HRESULT WINAPI GetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix);
1481 - HRESULT WINAPI Index(WORD wVertexIndex);
1482 - HRESULT WINAPI MultiplyTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix);
 1468+
 1469+HRESULT WINAPI glDirect3DDevice3::EndScene()
 1470+{
 1471+ if(!this) return DDERR_INVALIDOBJECT;
 1472+ return glD3DDev7->EndScene();
 1473+}
 1474+
 1475+HRESULT WINAPI glDirect3DDevice3::EnumTextureFormats(LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, LPVOID lpArg)
 1476+{
 1477+ if(!this) return DDERR_INVALIDOBJECT;
 1478+ return glD3DDev7->EnumTextureFormats(lpd3dEnumPixelProc,lpArg);
 1479+}
 1480+
 1481+HRESULT WINAPI glDirect3DDevice3::GetCaps(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc)
 1482+{
 1483+ if(!this) return DDERR_INVALIDOBJECT;
 1484+ return glD3DDev7->GetCaps3(lpD3DHWDevDesc,lpD3DHELDevDesc);
 1485+}
 1486+
 1487+HRESULT WINAPI glDirect3DDevice3::GetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
 1488+{
 1489+ if(!this) return DDERR_INVALIDOBJECT;
 1490+ return glD3DDev7->GetClipStatus(lpD3DClipStatus);
 1491+}
 1492+
 1493+HRESULT WINAPI glDirect3DDevice3::GetCurrentViewport(LPDIRECT3DVIEWPORT3 *lplpd3dViewport)
 1494+{
 1495+ if(!this) return DDERR_INVALIDOBJECT;
 1496+ return glD3DDev7->GetCurrentViewport(lplpd3dViewport);
 1497+}
 1498+
 1499+HRESULT WINAPI glDirect3DDevice3::GetDirect3D(LPDIRECT3D3 *lplpD3D)
 1500+{
 1501+ if(!this) return DDERR_INVALIDOBJECT;
 1502+ LPDIRECT3D7 d3d7;
 1503+ HRESULT err = glD3DDev7->GetDirect3D(&d3d7);
 1504+ if(!d3d7) return err;
 1505+ d3d7->QueryInterface(IID_IDirect3D3,(void**)lplpD3D);
 1506+ d3d7->Release();
 1507+ return err;
 1508+}
 1509+
 1510+HRESULT WINAPI glDirect3DDevice3::GetLightState(D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState)
 1511+{
 1512+ if(!this) return DDERR_INVALIDOBJECT;
 1513+ return glD3DDev7->GetLightState(dwLightStateType,lpdwLightState);
 1514+}
 1515+
 1516+HRESULT WINAPI glDirect3DDevice3::GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState)
 1517+{
 1518+ if(!this) return DDERR_INVALIDOBJECT;
 1519+ return glD3DDev7->GetRenderState(dwRenderStateType,lpdwRenderState);
 1520+}
 1521+
 1522+HRESULT WINAPI glDirect3DDevice3::GetRenderTarget(LPDIRECTDRAWSURFACE4 *lplpRenderTarget)
 1523+{
 1524+ if(!this) return DDERR_INVALIDOBJECT;
 1525+ LPDIRECTDRAWSURFACE7 dds7;
 1526+ HRESULT err = glD3DDev7->GetRenderTarget(&dds7);
 1527+ if(!dds7) return err;
 1528+ dds7->QueryInterface(IID_IDirectDrawSurface7,(void**)lplpRenderTarget);
 1529+ dds7->Release();
 1530+ return err;
 1531+}
 1532+
 1533+HRESULT WINAPI glDirect3DDevice3::GetStats(LPD3DSTATS lpD3DStats)
 1534+{
 1535+ if(!this) return DDERR_INVALIDOBJECT;
 1536+ return glD3DDev7->GetStats(lpD3DStats);
 1537+}
 1538+
 1539+HRESULT WINAPI glDirect3DDevice3::GetTexture(DWORD dwStage, LPDIRECT3DTEXTURE2 * lplpTexture)
 1540+{
 1541+ if(!this) return DDERR_INVALIDOBJECT;
 1542+ LPDIRECTDRAWSURFACE7 dds7;
 1543+ HRESULT err = glD3DDev7->GetTexture(dwStage,&dds7);
 1544+ if(!dds7) return err;
 1545+ dds7->QueryInterface(IID_IDirect3DTexture2,(void**)lplpTexture);
 1546+ dds7->Release();
 1547+ return err;
 1548+}
 1549+
 1550+HRESULT WINAPI glDirect3DDevice3::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, LPDWORD lpdwValue)
 1551+{
 1552+ if(!this) return DDERR_INVALIDOBJECT;
 1553+ return glD3DDev7->GetTextureStageState(dwStage,dwState,lpdwValue);
 1554+}
 1555+
 1556+HRESULT WINAPI glDirect3DDevice3::GetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
 1557+{
 1558+ if(!this) return DDERR_INVALIDOBJECT;
 1559+ return glD3DDev7->GetTransform(dtstTransformStateType,lpD3DMatrix);
 1560+}
 1561+
 1562+HRESULT WINAPI glDirect3DDevice3::Index(WORD wVertexIndex)
 1563+{
 1564+ if(!this) return DDERR_INVALIDOBJECT;
 1565+ return glD3DDev7->Index(wVertexIndex);
 1566+}
 1567+
 1568+HRESULT WINAPI glDirect3DDevice3::MultiplyTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
 1569+{
 1570+ if(!this) return DDERR_INVALIDOBJECT;
 1571+ return glD3DDev7->MultiplyTransform(dtstTransformStateType,lpD3DMatrix);
 1572+}
14831573 HRESULT WINAPI NextViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport, LPDIRECT3DVIEWPORT3 *lplpAnotherViewport, DWORD dwFlags);
14841574 HRESULT WINAPI SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus);
14851575 HRESULT WINAPI SetCurrentViewport(LPDIRECT3DVIEWPORT3 lpd3dViewport);
Index: ddraw/glDirect3DDevice.h
@@ -129,8 +129,14 @@
130130 HRESULT DeleteViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport);
131131 HRESULT Begin(D3DPRIMITIVETYPE d3dpt, DWORD dwVertexTypeDesc, DWORD dwFlags);
132132 HRESULT BeginIndexed(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags);
 133+ HRESULT Index(WORD wVertexIndex);
133134 HRESULT End(DWORD dwFlags);
134135 HRESULT ComputeSphereVisibility3(LPD3DVECTOR lpCenters, LPD3DVALUE lpRadii, DWORD dwNumSpheres, DWORD dwFlags, LPDWORD lpdwReturnValues);
 136+ HRESULT GetCaps3(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc);
 137+ HRESULT GetCurrentViewport(LPDIRECT3DVIEWPORT3 *lplpd3dViewport);
 138+ HRESULT GetLightState(D3DLIGHTSTATETYPE dwLightStateType, LPDWORD lpdwLightState);
 139+ HRESULT SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState);
 140+ HRESULT GetStats(LPD3DSTATS lpD3DStats);
135141 __int64 SelectShader(GLVERTEX *VertexType);
136142 void UpdateNormalMatrix();
137143 GLfloat matWorld[16];