push 378fe7a60681a28e8b22f62dcfe122d585b92570
[wine/hacks.git] / dlls / d3d10core / buffer.c
blobc4f32bf75c3206973e811d510d2cb2491f17ab51
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_buffer_QueryInterface(ID3D10Buffer *iface, REFIID riid, void **object)
31 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
33 if (IsEqualGUID(riid, &IID_ID3D10Buffer)
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_buffer_AddRef(ID3D10Buffer *iface)
51 struct d3d10_buffer *This = (struct d3d10_buffer *)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_buffer_Release(ID3D10Buffer *iface)
61 struct d3d10_buffer *This = (struct d3d10_buffer *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
66 if (!refcount)
68 HeapFree(GetProcessHeap(), 0, This);
71 return refcount;
74 /* ID3D10DeviceChild methods */
76 static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10Device **device)
78 FIXME("iface %p, device %p stub!\n", iface, device);
81 static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface,
82 REFGUID guid, UINT *data_size, void *data)
84 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
85 iface, debugstr_guid(guid), data_size, data);
87 return E_NOTIMPL;
90 static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateData(ID3D10Buffer *iface,
91 REFGUID guid, UINT data_size, const void *data)
93 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
94 iface, debugstr_guid(guid), data_size, data);
96 return E_NOTIMPL;
99 static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateDataInterface(ID3D10Buffer *iface,
100 REFGUID guid, const IUnknown *data)
102 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
104 return E_NOTIMPL;
107 /* ID3D10Resource methods */
109 static void STDMETHODCALLTYPE d3d10_buffer_GetType(ID3D10Buffer *iface, D3D10_RESOURCE_DIMENSION *resource_dimension)
111 TRACE("iface %p, resource_dimension %p\n", iface, resource_dimension);
113 *resource_dimension = D3D10_RESOURCE_DIMENSION_BUFFER;
116 static void STDMETHODCALLTYPE d3d10_buffer_SetEvictionPriority(ID3D10Buffer *iface, UINT eviction_priority)
118 FIXME("iface %p, eviction_priority %u stub!\n", iface, eviction_priority);
121 static UINT STDMETHODCALLTYPE d3d10_buffer_GetEvictionPriority(ID3D10Buffer *iface)
123 FIXME("iface %p stub!\n", iface);
125 return 0;
128 /* ID3D10Buffer methods */
130 static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP map_type, UINT map_flags, void **data)
132 FIXME("iface %p, map_type %u, map_flags %#x, data %p stub!\n", iface, map_type, map_flags, data);
134 return E_NOTIMPL;
137 static void STDMETHODCALLTYPE d3d10_buffer_Unmap(ID3D10Buffer *iface)
139 FIXME("iface %p stub!\n", iface);
142 static void STDMETHODCALLTYPE d3d10_buffer_GetDesc(ID3D10Buffer *iface, D3D10_BUFFER_DESC *desc)
144 FIXME("iface %p, desc %p stub!\n", iface, desc);
147 const struct ID3D10BufferVtbl d3d10_buffer_vtbl =
149 /* IUnknown methods */
150 d3d10_buffer_QueryInterface,
151 d3d10_buffer_AddRef,
152 d3d10_buffer_Release,
153 /* ID3D10DeviceChild methods */
154 d3d10_buffer_GetDevice,
155 d3d10_buffer_GetPrivateData,
156 d3d10_buffer_SetPrivateData,
157 d3d10_buffer_SetPrivateDataInterface,
158 /* ID3D10Resource methods */
159 d3d10_buffer_GetType,
160 d3d10_buffer_SetEvictionPriority,
161 d3d10_buffer_GetEvictionPriority,
162 /* ID3D10Buffer methods */
163 d3d10_buffer_Map,
164 d3d10_buffer_Unmap,
165 d3d10_buffer_GetDesc,