push c6fcfc519a04d046be60ec60e33d075a2146cc03
[wine/hacks.git] / dlls / d3d10core / texture2d.c
blob9b57c6134199a3a3fb52e4a289e4f3aad75a8de4
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "config.h"
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
27 /* IUnknown methods */
29 static HRESULT STDMETHODCALLTYPE d3d10_texture2d_QueryInterface(ID3D10Texture2D *iface, REFIID riid, void **object)
31 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
33 if (IsEqualGUID(riid, &IID_ID3D10Texture2D)
34 || IsEqualGUID(riid, &IID_ID3D10Resource)
35 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
36 || IsEqualGUID(riid, &IID_IUnknown))
38 IUnknown_AddRef(iface);
39 *object = iface;
40 return S_OK;
43 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
45 *object = NULL;
46 return E_NOINTERFACE;
49 static ULONG STDMETHODCALLTYPE d3d10_texture2d_AddRef(ID3D10Texture2D *iface)
51 struct d3d10_texture2d *This = (struct d3d10_texture2d *)iface;
52 ULONG refcount = InterlockedIncrement(&This->refcount);
54 TRACE("%p increasing refcount to %u\n", This, refcount);
56 return refcount;
59 static ULONG STDMETHODCALLTYPE d3d10_texture2d_Release(ID3D10Texture2D *iface)
61 struct d3d10_texture2d *This = (struct d3d10_texture2d *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
66 return refcount;
69 /* ID3D10DeviceChild methods */
71 static void STDMETHODCALLTYPE d3d10_texture2d_GetDevice(ID3D10Texture2D *iface, ID3D10Device **device)
73 FIXME("iface %p, device %p stub!\n", iface, device);
76 static HRESULT STDMETHODCALLTYPE d3d10_texture2d_GetPrivateData(ID3D10Texture2D *iface,
77 REFGUID guid, UINT *data_size, void *data)
79 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
80 iface, debugstr_guid(guid), data_size, data);
82 return E_NOTIMPL;
85 static HRESULT STDMETHODCALLTYPE d3d10_texture2d_SetPrivateData(ID3D10Texture2D *iface,
86 REFGUID guid, UINT data_size, const void *data)
88 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
89 iface, debugstr_guid(guid), data_size, data);
91 return E_NOTIMPL;
94 static HRESULT STDMETHODCALLTYPE d3d10_texture2d_SetPrivateDataInterface(ID3D10Texture2D *iface,
95 REFGUID guid, const IUnknown *data)
97 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
99 return E_NOTIMPL;
102 /* ID3D10Resource methods */
104 static void STDMETHODCALLTYPE d3d10_texture2d_GetType(ID3D10Texture2D *iface,
105 D3D10_RESOURCE_DIMENSION *resource_dimension)
107 FIXME("iface %p, resource_dimension %p stub!\n", iface, resource_dimension);
110 static void STDMETHODCALLTYPE d3d10_texture2d_SetEvictionPriority(ID3D10Texture2D *iface, UINT eviction_priority)
112 FIXME("iface %p, eviction_priority %u stub!\n", iface, eviction_priority);
115 static UINT STDMETHODCALLTYPE d3d10_texture2d_GetEvictionPriority(ID3D10Texture2D *iface)
117 FIXME("iface %p stub!\n", iface);
119 return 0;
122 /* ID3D10Texture2D methods */
124 static HRESULT STDMETHODCALLTYPE d3d10_texture2d_Map(ID3D10Texture2D *iface, UINT sub_resource,
125 D3D10_MAP map_type, UINT map_flags, D3D10_MAPPED_TEXTURE2D *mapped_texture)
127 FIXME("iface %p, sub_resource %u, map_type %u, map_flags %#x, mapped_texture %p stub!\n",
128 iface, sub_resource, map_type, map_flags, mapped_texture);
130 return E_NOTIMPL;
133 static void STDMETHODCALLTYPE d3d10_texture2d_Unmap(ID3D10Texture2D *iface, UINT sub_resource)
135 FIXME("iface %p, sub_resource %u stub!\n", iface, sub_resource);
138 static void STDMETHODCALLTYPE d3d10_texture2d_GetDesc(ID3D10Texture2D *iface, D3D10_TEXTURE2D_DESC *desc)
140 FIXME("iface %p, desc %p stub!\n", iface, desc);
143 const struct ID3D10Texture2DVtbl d3d10_texture2d_vtbl =
145 /* IUnknown methods */
146 d3d10_texture2d_QueryInterface,
147 d3d10_texture2d_AddRef,
148 d3d10_texture2d_Release,
149 /* ID3D10DeviceChild methods */
150 d3d10_texture2d_GetDevice,
151 d3d10_texture2d_GetPrivateData,
152 d3d10_texture2d_SetPrivateData,
153 d3d10_texture2d_SetPrivateDataInterface,
154 /* ID3D10Resource methods */
155 d3d10_texture2d_GetType,
156 d3d10_texture2d_SetEvictionPriority,
157 d3d10_texture2d_GetEvictionPriority,
158 /* ID3D10Texture2D methods */
159 d3d10_texture2d_Map,
160 d3d10_texture2d_Unmap,
161 d3d10_texture2d_GetDesc,