[PATCH] d3dx9: Add stubs for the ID3DXRenderToSurface functions

Tony Wasserka tony.wasserka at freenet.de
Sat Feb 23 12:41:47 CST 2008


---
 dlls/d3dx9_36/Makefile.in   |    3 +-
 dlls/d3dx9_36/d3dx9_36.spec |    2 +-
 dlls/d3dx9_36/rts.c         |  130 +++++++++++++++++++++++++++++++++++++++=
++++
 3 files changed, 133 insertions(+), 2 deletions(-)
 create mode 100755 dlls/d3dx9_36/rts.c

diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in
index f76e3f5..47631a2 100644
--- a/dlls/d3dx9_36/Makefile.in
+++ b/dlls/d3dx9_36/Makefile.in
@@ -11,7 +11,8 @@ C_SRCS =3D=20
 =09d3dx9_36_main.c=20
 =09font.c=20
 =09line.c=20
-=09rtem.c
+=09rtem.c=20
+=09rts.c
=20
 @MAKE_DLL_RULES@
=20
diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index d9c760b..e91d973 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -82,7 +82,7 @@
 @ stub D3DXCreatePRTCompBuffer
 @ stub D3DXCreatePRTEngine
 @ stdcall D3DXCreateRenderToEnvMap(ptr long long long long long ptr)
-@ stub D3DXCreateRenderToSurface
+@ stdcall D3DXCreateRenderToSurface(ptr long long long long long ptr)
 @ stdcall D3DXCreateSPMesh(ptr ptr ptr ptr ptr) d3dx8.D3DXCreateSPMesh
 @ stub D3DXCreateSkinInfo
 @ stub D3DXCreateSkinInfoFromBlendedMesh
diff --git a/dlls/d3dx9_36/rts.c b/dlls/d3dx9_36/rts.c
new file mode 100755
index 0000000..5ea70b3
--- /dev/null
+++ b/dlls/d3dx9_36/rts.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2008 Tony Wasserka
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, U=
SA
+ *
+ */
+
+#include "config.h"
+#include "wine/port.h"
+#include "d3dx9_36_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(d3dx);
+
+HRESULT WINAPI D3DXCreateRenderToSurface(LPDIRECT3DDEVICE9 device, UINT si=
ze, UINT miplevels, D3DFORMAT format, BOOL stencil, D3DFORMAT stencil_forma=
t, LPD3DXRENDERTOSURFACE *rts)
+{
+    ID3DXRenderToSurfaceImpl *object=3DNULL;
+
+    TRACE("stubn");
+    object=3DHeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXRen=
derToSurfaceImpl));
+    if(object=3D=3DNULL) {
+        *rts=3D(LPD3DXRENDERTOSURFACE)NULL;
+        return E_OUTOFMEMORY;
+    }
+    object->lpVtbl=3D&D3DXRenderToSurface_Vtbl;
+    object->ref=3D1;
+
+    *rts=3D(LPD3DXRENDERTOSURFACE)object;
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_QueryInterface(LPD3DXRENDER=
TOSURFACE iface, REFIID riid, LPVOID *object)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+
+    if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ID3DXRen=
derToSurface)) {
+        TRACE("(%p): QueryInterface from %sn", This, debugstr_guid(riid));
+        IUnknown_AddRef(iface);
+        *object=3DThis;
+        return S_OK;
+    }
+    WARN("(%p)->(%s, %p): not foundn", iface, debugstr_guid(riid), object)=
;
+    object=3DNULL;
+    return E_NOINTERFACE;
+}
+
+static ULONG WINAPI ID3DXRenderToSurfaceImpl_AddRef(LPD3DXRENDERTOSURFACE =
iface)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    ULONG ref=3DInterlockedIncrement(&This->ref);
+    TRACE("(%p): AddRef from %dn", This, ref-1);
+    return ref;
+}
+
+static ULONG WINAPI ID3DXRenderToSurfaceImpl_Release(LPD3DXRENDERTOSURFACE=
 iface)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    ULONG ref=3DInterlockedDecrement(&This->ref);
+    TRACE("(%p): ReleaseRef to %dn", This, ref);
+    return ref;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_GetDevice(LPD3DXRENDERTOSUR=
FACE iface, LPDIRECT3DDEVICE9 *device)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    TRACE("(%p): stubn", This);
+    device=3DNULL;
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_GetDesc(LPD3DXRENDERTOSURFA=
CE iface, D3DXRTS_DESC *desc)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_BeginScene(LPD3DXRENDERTOSU=
RFACE iface, LPDIRECT3DSURFACE9 surface, CONST D3DVIEWPORT9 *viewport)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_EndScene(LPD3DXRENDERTOSURF=
ACE iface, DWORD mipfilter)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_OnLostDevice(LPD3DXRENDERTO=
SURFACE iface)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+static HRESULT WINAPI ID3DXRenderToSurfaceImpl_OnResetDevice(LPD3DXRENDERT=
OSURFACE iface)
+{
+    ID3DXRenderToSurfaceImpl *This=3D(ID3DXRenderToSurfaceImpl*)iface;
+    TRACE("(%p): stubn", This);
+    return S_OK;
+}
+
+const ID3DXRenderToSurfaceVtbl D3DXRenderToSurface_Vtbl =3D
+{
+    /*** IUnknown methods ***/
+    ID3DXRenderToSurfaceImpl_QueryInterface,
+    ID3DXRenderToSurfaceImpl_AddRef,
+    ID3DXRenderToSurfaceImpl_Release,
+    /*** ID3DXRenderToSurface methods ***/
+    ID3DXRenderToSurfaceImpl_GetDevice,
+    ID3DXRenderToSurfaceImpl_GetDesc,
+    ID3DXRenderToSurfaceImpl_BeginScene,
+    ID3DXRenderToSurfaceImpl_EndScene,
+    ID3DXRenderToSurfaceImpl_OnLostDevice,
+    ID3DXRenderToSurfaceImpl_OnResetDevice
+};
--=20
1.5.3.7

=0A=0A=0A=0AUnbegrenzter Speicher, Top-Spamschutz, 120 SMS und eigene E-Mai=
lDomain inkl.=0Ahttp://office.freenet.de/dienste/emailoffice/produktuebersi=
cht/power/mail/index.html=0A



More information about the wine-patches mailing list