| Index: ddraw/ddraw.vcxproj |
| — | — | @@ -171,6 +171,7 @@ |
| 172 | 172 | <ClInclude Include="glDirect3DDevice.h" />
|
| 173 | 173 | <ClInclude Include="glDirect3DLight.h" />
|
| 174 | 174 | <ClInclude Include="glDirect3DMaterial.h" />
|
| | 175 | + <ClInclude Include="glDirect3DTexture.h" />
|
| 175 | 176 | <ClInclude Include="glDirect3DVertexBuffer.h" />
|
| 176 | 177 | <ClInclude Include="glDirect3DViewport.h" />
|
| 177 | 178 | <ClInclude Include="glDirectDraw.h" />
|
| — | — | @@ -220,6 +221,7 @@ |
| 221 | 222 | <ClCompile Include="glDirect3DDevice.cpp" />
|
| 222 | 223 | <ClCompile Include="glDirect3DLight.cpp" />
|
| 223 | 224 | <ClCompile Include="glDirect3DMaterial.cpp" />
|
| | 225 | + <ClCompile Include="glDirect3DTexture.cpp" />
|
| 224 | 226 | <ClCompile Include="glDirect3DVertexBuffer.cpp" />
|
| 225 | 227 | <ClCompile Include="glDirect3DViewport.cpp" />
|
| 226 | 228 | <ClCompile Include="glDirectDraw.cpp" />
|
| Index: ddraw/ddraw.vcxproj.filters |
| — | — | @@ -113,6 +113,9 @@ |
| 114 | 114 | <ClInclude Include="glDirect3DMaterial.h">
|
| 115 | 115 | <Filter>Header Files</Filter>
|
| 116 | 116 | </ClInclude>
|
| | 117 | + <ClInclude Include="glDirect3DTexture.h">
|
| | 118 | + <Filter>Header Files</Filter>
|
| | 119 | + </ClInclude>
|
| 117 | 120 | </ItemGroup>
|
| 118 | 121 | <ItemGroup>
|
| 119 | 122 | <ClCompile Include="ddraw.cpp">
|
| — | — | @@ -184,6 +187,9 @@ |
| 185 | 188 | <ClCompile Include="glDirect3DMaterial.cpp">
|
| 186 | 189 | <Filter>Source Files</Filter>
|
| 187 | 190 | </ClCompile>
|
| | 191 | + <ClCompile Include="glDirect3DTexture.cpp">
|
| | 192 | + <Filter>Source Files</Filter>
|
| | 193 | + </ClCompile>
|
| 188 | 194 | </ItemGroup>
|
| 189 | 195 | <ItemGroup>
|
| 190 | 196 | <ResourceCompile Include="ddraw.rc">
|
| Index: ddraw/glDirect3DDevice.cpp |
| — | — | @@ -21,6 +21,7 @@ |
| 22 | 22 | #include "glRenderer.h"
|
| 23 | 23 | #include "glDirectDraw.h"
|
| 24 | 24 | #include "glDirectDrawSurface.h"
|
| | 25 | +#include "glDirect3DTexture.h"
|
| 25 | 26 | #include "glDirect3DMaterial.h"
|
| 26 | 27 | #include "glDirect3DViewport.h"
|
| 27 | 28 | #include "glDirect3DVertexBuffer.h"
|
| — | — | @@ -1569,14 +1570,68 @@ |
| 1570 | 1571 | if(!this) return DDERR_INVALIDOBJECT;
|
| 1571 | 1572 | return glD3DDev7->MultiplyTransform(dtstTransformStateType,lpD3DMatrix);
|
| 1572 | 1573 | }
|
| 1573 | | - HRESULT WINAPI NextViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport, LPDIRECT3DVIEWPORT3 *lplpAnotherViewport, DWORD dwFlags);
|
| 1574 | | - HRESULT WINAPI SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus);
|
| 1575 | | - HRESULT WINAPI SetCurrentViewport(LPDIRECT3DVIEWPORT3 lpd3dViewport);
|
| 1576 | | - HRESULT WINAPI SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState);
|
| 1577 | | - HRESULT WINAPI SetRenderState(D3DRENDERSTATETYPE dwRendStateType, DWORD dwRenderState);
|
| 1578 | | - HRESULT WINAPI SetRenderTarget(LPDIRECTDRAWSURFACE4 lpNewRenderTarget, DWORD dwFlags);
|
| 1579 | | - HRESULT WINAPI SetTexture(DWORD dwStage, LPDIRECT3DTEXTURE2 lpTexture);
|
| 1580 | | - HRESULT WINAPI SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, DWORD dwValue);
|
| 1581 | | - HRESULT WINAPI SetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix);
|
| 1582 | | - HRESULT WINAPI ValidateDevice(LPDWORD lpdwPasses);
|
| 1583 | | - HRESULT WINAPI Vertex(LPVOID lpVertex);
|
| | 1574 | +HRESULT WINAPI glDirect3DDevice3::NextViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport, LPDIRECT3DVIEWPORT3 *lplpAnotherViewport, DWORD dwFlags)
|
| | 1575 | +{
|
| | 1576 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1577 | + return glD3DDev7->NextViewport(lpDirect3DViewport,lplpAnotherViewport,dwFlags);
|
| | 1578 | +}
|
| | 1579 | +
|
| | 1580 | +HRESULT WINAPI glDirect3DDevice3::SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
|
| | 1581 | +{
|
| | 1582 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1583 | + return glD3DDev7->SetClipStatus(lpD3DClipStatus);
|
| | 1584 | +}
|
| | 1585 | +
|
| | 1586 | +HRESULT WINAPI glDirect3DDevice3::SetCurrentViewport(LPDIRECT3DVIEWPORT3 lpd3dViewport)
|
| | 1587 | +{
|
| | 1588 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1589 | + return glD3DDev7->SetCurrentViewport(lpd3dViewport);
|
| | 1590 | +}
|
| | 1591 | +
|
| | 1592 | +HRESULT WINAPI glDirect3DDevice3::SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState)
|
| | 1593 | +{
|
| | 1594 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1595 | + return glD3DDev7->SetLightState(dwLightStateType,dwLightState);
|
| | 1596 | +}
|
| | 1597 | +
|
| | 1598 | +HRESULT WINAPI glDirect3DDevice3::SetRenderState(D3DRENDERSTATETYPE dwRendStateType, DWORD dwRenderState)
|
| | 1599 | +{
|
| | 1600 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1601 | + return glD3DDev7->SetRenderState(dwRendStateType,dwRenderState);
|
| | 1602 | +}
|
| | 1603 | +
|
| | 1604 | +HRESULT WINAPI glDirect3DDevice3::SetRenderTarget(LPDIRECTDRAWSURFACE4 lpNewRenderTarget, DWORD dwFlags)
|
| | 1605 | +{
|
| | 1606 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1607 | + return glD3DDev7->SetRenderTarget(((glDirectDrawSurface4*)lpNewRenderTarget)->GetDDS7(),dwFlags);
|
| | 1608 | +}
|
| | 1609 | +
|
| | 1610 | +HRESULT WINAPI glDirect3DDevice3::SetTexture(DWORD dwStage, LPDIRECT3DTEXTURE2 lpTexture)
|
| | 1611 | +{
|
| | 1612 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1613 | + return glD3DDev7->SetTexture(dwStage,((glDirect3DTexture2*)lpTexture)->GetDDS7());
|
| | 1614 | +}
|
| | 1615 | +
|
| | 1616 | +HRESULT WINAPI glDirect3DDevice3::SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, DWORD dwValue)
|
| | 1617 | +{
|
| | 1618 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1619 | + return glD3DDev7->SetTextureStageState(dwStage,dwState,dwValue);
|
| | 1620 | +}
|
| | 1621 | +
|
| | 1622 | +HRESULT WINAPI glDirect3DDevice3::SetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
|
| | 1623 | +{
|
| | 1624 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1625 | + return glD3DDev7->SetTransform(dtstTransformStateType,lpD3DMatrix);
|
| | 1626 | +}
|
| | 1627 | +
|
| | 1628 | +HRESULT WINAPI glDirect3DDevice3::ValidateDevice(LPDWORD lpdwPasses)
|
| | 1629 | +{
|
| | 1630 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1631 | + return glD3DDev7->ValidateDevice(lpdwPasses);
|
| | 1632 | +}
|
| | 1633 | +
|
| | 1634 | +HRESULT WINAPI glDirect3DDevice3::Vertex(LPVOID lpVertex)
|
| | 1635 | +{
|
| | 1636 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 1637 | + return glD3DDev7->Vertex(lpVertex);
|
| | 1638 | +} |
| \ No newline at end of file |
| Index: ddraw/glDirect3DDevice.h |
| — | — | @@ -127,9 +127,12 @@ |
| 128 | 128 | D3DMATERIALHANDLE AddMaterial(glDirect3DMaterial3* material);
|
| 129 | 129 | HRESULT AddViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport);
|
| 130 | 130 | HRESULT DeleteViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport);
|
| | 131 | + HRESULT NextViewport(LPDIRECT3DVIEWPORT3 lpDirect3DViewport, LPDIRECT3DVIEWPORT3 *lplpAnotherViewport, DWORD dwFlags);
|
| | 132 | + HRESULT SetCurrentViewport(LPDIRECT3DVIEWPORT3 lpd3dViewport);
|
| 131 | 133 | HRESULT Begin(D3DPRIMITIVETYPE d3dpt, DWORD dwVertexTypeDesc, DWORD dwFlags);
|
| 132 | 134 | HRESULT BeginIndexed(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc, LPVOID lpvVertices, DWORD dwNumVertices, DWORD dwFlags);
|
| 133 | 135 | HRESULT Index(WORD wVertexIndex);
|
| | 136 | + HRESULT Vertex(LPVOID lpVertex);
|
| 134 | 137 | HRESULT End(DWORD dwFlags);
|
| 135 | 138 | HRESULT ComputeSphereVisibility3(LPD3DVECTOR lpCenters, LPD3DVALUE lpRadii, DWORD dwNumSpheres, DWORD dwFlags, LPDWORD lpdwReturnValues);
|
| 136 | 139 | HRESULT GetCaps3(LPD3DDEVICEDESC lpD3DHWDevDesc, LPD3DDEVICEDESC lpD3DHELDevDesc);
|
| Index: ddraw/glDirect3DTexture.cpp |
| — | — | @@ -0,0 +1,78 @@ |
| | 2 | +// DXGL
|
| | 3 | +// Copyright (C) 2012 William Feely
|
| | 4 | +
|
| | 5 | +// This library is free software; you can redistribute it and/or
|
| | 6 | +// modify it under the terms of the GNU Lesser General Public
|
| | 7 | +// License as published by the Free Software Foundation; either
|
| | 8 | +// version 2.1 of the License, or (at your option) any later version.
|
| | 9 | +
|
| | 10 | +// This library is distributed in the hope that it will be useful,
|
| | 11 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| | 12 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| | 13 | +// Lesser General Public License for more details.
|
| | 14 | +
|
| | 15 | +// You should have received a copy of the GNU Lesser General Public
|
| | 16 | +// License along with this library; if not, write to the Free Software
|
| | 17 | +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
| | 18 | +
|
| | 19 | +#include "common.h"
|
| | 20 | +#include "glRenderer.h"
|
| | 21 | +#include "glDirectDraw.h"
|
| | 22 | +#include "glDirectDrawSurface.h"
|
| | 23 | +#include "glDirect3DTexture.h"
|
| | 24 | +
|
| | 25 | +glDirect3DTexture2::glDirect3DTexture2(glDirectDrawSurface7 *glDDS7)
|
| | 26 | +{
|
| | 27 | + this->glDDS7 = glDDS7;
|
| | 28 | + refcount = 1;
|
| | 29 | +}
|
| | 30 | +
|
| | 31 | +glDirect3DTexture2::~glDirect3DTexture2()
|
| | 32 | +{
|
| | 33 | + glDDS7->Release();
|
| | 34 | +}
|
| | 35 | +
|
| | 36 | +HRESULT WINAPI glDirect3DTexture2::QueryInterface(REFIID riid, void** ppvObj)
|
| | 37 | +{
|
| | 38 | + if(!this) return DDERR_INVALIDPARAMS;
|
| | 39 | + if(riid == IID_IUnknown)
|
| | 40 | + {
|
| | 41 | + this->AddRef();
|
| | 42 | + *ppvObj = this;
|
| | 43 | + return DD_OK;
|
| | 44 | + }
|
| | 45 | + return glDDS7->QueryInterface(riid,ppvObj);
|
| | 46 | +}
|
| | 47 | +
|
| | 48 | +ULONG WINAPI glDirect3DTexture2::AddRef()
|
| | 49 | +{
|
| | 50 | + if(!this) return 0;
|
| | 51 | + refcount++;
|
| | 52 | + return refcount;
|
| | 53 | +}
|
| | 54 | +
|
| | 55 | +ULONG WINAPI glDirect3DTexture2::Release()
|
| | 56 | +{
|
| | 57 | + if(!this) return 0;
|
| | 58 | + ULONG ret;
|
| | 59 | + refcount--;
|
| | 60 | + ret = refcount;
|
| | 61 | + if(refcount == 0) delete this;
|
| | 62 | + return ret;
|
| | 63 | +}
|
| | 64 | +
|
| | 65 | +HRESULT WINAPI glDirect3DTexture2::GetHandle(LPDIRECT3DDEVICE2 lpDirect3DDevice2, LPD3DTEXTUREHANDLE lpHandle)
|
| | 66 | +{
|
| | 67 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 68 | + FIXME("glDirect3DTexture2::GetHandle: stub");
|
| | 69 | +}
|
| | 70 | +HRESULT WINAPI glDirect3DTexture2::Load(LPDIRECT3DTEXTURE2 lpD3DTexture2)
|
| | 71 | +{
|
| | 72 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 73 | + FIXME("glDirect3DTexture2::Load: stub");
|
| | 74 | +}
|
| | 75 | +HRESULT WINAPI glDirect3DTexture2::PaletteChanged(DWORD dwStart, DWORD dwCount)
|
| | 76 | +{
|
| | 77 | + if(!this) return DDERR_INVALIDOBJECT;
|
| | 78 | + FIXME("glDirect3DTexture2::PaletteChanged: stub");
|
| | 79 | +}
|
| Index: ddraw/glDirect3DTexture.h |
| — | — | @@ -0,0 +1,39 @@ |
| | 2 | +// DXGL
|
| | 3 | +// Copyright (C) 2012 William Feely
|
| | 4 | +
|
| | 5 | +// This library is free software; you can redistribute it and/or
|
| | 6 | +// modify it under the terms of the GNU Lesser General Public
|
| | 7 | +// License as published by the Free Software Foundation; either
|
| | 8 | +// version 2.1 of the License, or (at your option) any later version.
|
| | 9 | +
|
| | 10 | +// This library is distributed in the hope that it will be useful,
|
| | 11 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| | 12 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| | 13 | +// Lesser General Public License for more details.
|
| | 14 | +
|
| | 15 | +// You should have received a copy of the GNU Lesser General Public
|
| | 16 | +// License along with this library; if not, write to the Free Software
|
| | 17 | +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
| | 18 | +
|
| | 19 | +#pragma once
|
| | 20 | +#ifndef __GLDIRECT3DTEXTURE_H
|
| | 21 | +#define __GLDIRECT3DTEXTURE_H
|
| | 22 | +
|
| | 23 | +class glDirect3DTexture2 : public IDirect3DTexture2
|
| | 24 | +{
|
| | 25 | +public:
|
| | 26 | + glDirect3DTexture2(glDirectDrawSurface7 *glDDS7);
|
| | 27 | + virtual ~glDirect3DTexture2();
|
| | 28 | + HRESULT WINAPI QueryInterface(REFIID riid, void** ppvObj);
|
| | 29 | + ULONG WINAPI AddRef();
|
| | 30 | + ULONG WINAPI Release();
|
| | 31 | + HRESULT WINAPI GetHandle(LPDIRECT3DDEVICE2 lpDirect3DDevice2, LPD3DTEXTUREHANDLE lpHandle);
|
| | 32 | + HRESULT WINAPI Load(LPDIRECT3DTEXTURE2 lpD3DTexture2);
|
| | 33 | + HRESULT WINAPI PaletteChanged(DWORD dwStart, DWORD dwCount);
|
| | 34 | + glDirectDrawSurface7 *GetDDS7(){return glDDS7;}
|
| | 35 | +private:
|
| | 36 | + glDirectDrawSurface7 *glDDS7;
|
| | 37 | + ULONG refcount;
|
| | 38 | +};
|
| | 39 | +
|
| | 40 | +#endif //__GLDIRECT3DTEXTURE_H |
| \ No newline at end of file |