When using desktop mode attach all thread inputs together, so that
[wine] / dlls / d3d8 / basetexture.c
1 /*
2  * IDirect3DBaseTexture8 implementation
3  *
4  * Copyright 2002 Jason Edmeades
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "windef.h"
22 #include "winbase.h"
23 #include "winuser.h"
24 #include "wingdi.h"
25 #include "wine/debug.h"
26
27 #include "d3d8_private.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
30
31 /* IDirect3DBaseTexture8 (Inherited from IUnknown) */
32 HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
33 {
34     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
35     TRACE("(%p) : QueryInterface\n", This);
36     if (IsEqualGUID(riid, &IID_IUnknown)
37         || IsEqualGUID(riid, &IID_IDirect3DResource8)
38         || IsEqualGUID(riid, &IID_IDirect3DBaseTexture8)) {
39         IDirect3DBaseTexture8Impl_AddRef(iface);
40         *ppobj = This;
41         return D3D_OK;
42     }
43
44     WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
45     return E_NOINTERFACE;
46 }
47
48 ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface) {
49     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
50     TRACE("(%p) : AddRef from %ld\n", This, This->ref);
51     return ++(This->ref);
52 }
53
54 ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface) {
55     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
56     ULONG ref = --This->ref;
57     TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
58     if (ref == 0)
59         HeapFree(GetProcessHeap(), 0, This);
60     return ref;
61 }
62
63 /* IDirect3DBaseTexture8 (Inherited from IDirect3DResource8) */
64 HRESULT  WINAPI        IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
65     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
66     TRACE("(%p) : returning %p\n", This, This->Device);
67     *ppDevice = (LPDIRECT3DDEVICE8) This->Device;
68     /**
69      * Note  Calling this method will increase the internal reference count 
70      * on the IDirect3DDevice8 interface. 
71      */
72     IDirect3DDevice8Impl_AddRef(*ppDevice);
73     return D3D_OK;
74 }
75 HRESULT  WINAPI        IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
76     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
77     FIXME("(%p) : stub\n", This);    return D3D_OK;
78 }
79 HRESULT  WINAPI        IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
80     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
81     FIXME("(%p) : stub\n", This);    return D3D_OK;
82 }
83 HRESULT  WINAPI        IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid) {
84     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
85     FIXME("(%p) : stub\n", This);    return D3D_OK;
86 }
87 DWORD    WINAPI        IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew) {
88     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
89     FIXME("(%p) : stub\n", This);    return D3D_OK;
90 }
91 DWORD    WINAPI        IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface) {
92     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
93     FIXME("(%p) : stub\n", This);    return D3D_OK;
94 }
95 void     WINAPI        IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface) {
96     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
97     FIXME("(%p) : stub\n", This);
98 }
99 D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface) {
100     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
101     TRACE("(%p) : returning %d\n", This, This->ResourceType);
102     return This->ResourceType;
103 }
104
105 /* IDirect3DBaseTexture8 */
106 DWORD    WINAPI        IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew) {
107     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
108     FIXME("(%p) : stub\n", This);    return D3D_OK;
109 }
110 DWORD    WINAPI        IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface) {
111     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
112     FIXME("(%p) : stub\n", This);    return D3D_OK;
113 }
114 DWORD    WINAPI        IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface) {
115     ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
116     FIXME("(%p) : stub\n", This);    return D3D_OK;
117 }
118
119 ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl =
120 {
121     ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
122     IDirect3DBaseTexture8Impl_QueryInterface,
123     IDirect3DBaseTexture8Impl_AddRef,
124     IDirect3DBaseTexture8Impl_Release,
125     IDirect3DBaseTexture8Impl_GetDevice,
126     IDirect3DBaseTexture8Impl_SetPrivateData,
127     IDirect3DBaseTexture8Impl_GetPrivateData,
128     IDirect3DBaseTexture8Impl_FreePrivateData,
129     IDirect3DBaseTexture8Impl_SetPriority,
130     IDirect3DBaseTexture8Impl_GetPriority,
131     IDirect3DBaseTexture8Impl_PreLoad,
132     IDirect3DBaseTexture8Impl_GetType,
133     IDirect3DBaseTexture8Impl_SetLOD,
134     IDirect3DBaseTexture8Impl_GetLOD,
135     IDirect3DBaseTexture8Impl_GetLevelCount,
136 };