Get rid of a W->A cross call in ImageList_LoadImageW.
[wine.git] / dlls / d3d8 / basetexture.c
blob642be184fb477ebf9ebe3198dfb00e87db7e814e
1 /*
2 * IDirect3DBaseTexture8 implementation
4 * Copyright 2002 Jason Edmeades
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.
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.
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
21 #include "config.h"
23 #include <stdarg.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "wingdi.h"
29 #include "wine/debug.h"
31 #include "d3d8_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(d3d);
35 /* IDirect3DBaseTexture8 (Inherited from IUnknown) */
36 HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
38 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
39 TRACE("(%p) : QueryInterface\n", This);
40 if (IsEqualGUID(riid, &IID_IUnknown)
41 || IsEqualGUID(riid, &IID_IDirect3DResource8)
42 || IsEqualGUID(riid, &IID_IDirect3DBaseTexture8)) {
43 IDirect3DBaseTexture8Impl_AddRef(iface);
44 *ppobj = This;
45 return D3D_OK;
48 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
49 return E_NOINTERFACE;
52 ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface) {
53 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
54 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
55 return ++(This->ref);
58 ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface) {
59 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
60 ULONG ref = --This->ref;
61 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
62 if (ref == 0)
63 HeapFree(GetProcessHeap(), 0, This);
64 return ref;
67 /* IDirect3DBaseTexture8 (Inherited from IDirect3DResource8) */
68 HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
69 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
70 TRACE("(%p) : returning %p\n", This, This->Device);
71 *ppDevice = (LPDIRECT3DDEVICE8) This->Device;
72 /**
73 * Note Calling this method will increase the internal reference count
74 * on the IDirect3DDevice8 interface.
76 IDirect3DDevice8Impl_AddRef(*ppDevice);
77 return D3D_OK;
79 HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
80 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
81 FIXME("(%p) : stub\n", This); return D3D_OK;
83 HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
84 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
85 FIXME("(%p) : stub\n", This); return D3D_OK;
87 HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid) {
88 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
89 FIXME("(%p) : stub\n", This); return D3D_OK;
91 DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew) {
92 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
93 FIXME("(%p) : stub\n", This);
94 return 0;
96 DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface) {
97 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
98 FIXME("(%p) : stub\n", This);
99 return 0;
101 void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface) {
102 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
103 FIXME("(%p) : stub\n", This);
105 D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface) {
106 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
107 /*TRACE("(%p) : returning %d\n", This, This->ResourceType);*/
108 return This->ResourceType;
111 /* IDirect3DBaseTexture8 */
112 DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew) {
113 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
114 FIXME("(%p) : stub\n", This);
115 return 0;
117 DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface) {
118 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
119 FIXME("(%p) : stub\n", This);
120 return 0;
122 DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface) {
123 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
124 TRACE("(%p) : returning %d\n", This, This->levels);
125 return This->levels;
128 ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl =
130 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
131 IDirect3DBaseTexture8Impl_QueryInterface,
132 IDirect3DBaseTexture8Impl_AddRef,
133 IDirect3DBaseTexture8Impl_Release,
134 IDirect3DBaseTexture8Impl_GetDevice,
135 IDirect3DBaseTexture8Impl_SetPrivateData,
136 IDirect3DBaseTexture8Impl_GetPrivateData,
137 IDirect3DBaseTexture8Impl_FreePrivateData,
138 IDirect3DBaseTexture8Impl_SetPriority,
139 IDirect3DBaseTexture8Impl_GetPriority,
140 IDirect3DBaseTexture8Impl_PreLoad,
141 IDirect3DBaseTexture8Impl_GetType,
142 IDirect3DBaseTexture8Impl_SetLOD,
143 IDirect3DBaseTexture8Impl_GetLOD,
144 IDirect3DBaseTexture8Impl_GetLevelCount,
147 BOOL WINAPI IDirect3DBaseTexture8Impl_IsDirty(LPDIRECT3DBASETEXTURE8 iface) {
148 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
149 return This->Dirty;
152 BOOL WINAPI IDirect3DBaseTexture8Impl_SetDirty(LPDIRECT3DBASETEXTURE8 iface, BOOL dirty) {
153 BOOL old;
154 ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
156 old = This->Dirty;
157 This->Dirty = dirty;
158 return old;