1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 *
18 */
19
20 #include "config.h"
21 #include "wine/port.h"
22
23 #include "d3d10core_private.h"
24
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
26
27 /* IUnknown methods */
28
29 static HRESULT STDMETHODCALLTYPE d3d10_buffer_QueryInterface(ID3D10Buffer *iface, REFIID riid, void **object)
30 {
31 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
32
33 if (IsEqualGUID(riid, &IID_ID3D10Buffer)
34 || IsEqualGUID(riid, &IID_ID3D10Resource)
35 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
36 || IsEqualGUID(riid, &IID_IUnknown))
37 {
38 IUnknown_AddRef(iface);
39 *object = iface;
40 return S_OK;
41 }
42
43 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
44
45 *object = NULL;
46 return E_NOINTERFACE;
47 }
48
49 static ULONG STDMETHODCALLTYPE d3d10_buffer_AddRef(ID3D10Buffer *iface)
50 {
51 struct d3d10_buffer *This = (struct d3d10_buffer *)iface;
52 ULONG refcount = InterlockedIncrement(&This->refcount);
53
54 TRACE("%p increasing refcount to %u\n", This, refcount);
55
56 return refcount;
57 }
58
59 static ULONG STDMETHODCALLTYPE d3d10_buffer_Release(ID3D10Buffer *iface)
60 {
61 struct d3d10_buffer *This = (struct d3d10_buffer *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
63
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
65
66 if (!refcount)
67 {
68 IWineD3DBuffer_Release(This->wined3d_buffer);
69 HeapFree(GetProcessHeap(), 0, This);
70 }
71
72 return refcount;
73 }
74
75 /* ID3D10DeviceChild methods */
76
77 static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10Device **device)
78 {
79 FIXME("iface %p, device %p stub!\n", iface, device);
80 }
81
82 static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface,
83 REFGUID guid, UINT *data_size, void *data)
84 {
85 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
86 iface, debugstr_guid(guid), data_size, data);
87
88 return E_NOTIMPL;
89 }
90
91 static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateData(ID3D10Buffer *iface,
92 REFGUID guid, UINT data_size, const void *data)
93 {
94 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
95 iface, debugstr_guid(guid), data_size, data);
96
97 return E_NOTIMPL;
98 }
99
100 static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateDataInterface(ID3D10Buffer *iface,
101 REFGUID guid, const IUnknown *data)
102 {
103 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
104
105 return E_NOTIMPL;
106 }
107
108 /* ID3D10Resource methods */
109
110 static void STDMETHODCALLTYPE d3d10_buffer_GetType(ID3D10Buffer *iface, D3D10_RESOURCE_DIMENSION *resource_dimension)
111 {
112 TRACE("iface %p, resource_dimension %p\n", iface, resource_dimension);
113
114 *resource_dimension = D3D10_RESOURCE_DIMENSION_BUFFER;
115 }
116
117 static void STDMETHODCALLTYPE d3d10_buffer_SetEvictionPriority(ID3D10Buffer *iface, UINT eviction_priority)
118 {
119 FIXME("iface %p, eviction_priority %u stub!\n", iface, eviction_priority);
120 }
121
122 static UINT STDMETHODCALLTYPE d3d10_buffer_GetEvictionPriority(ID3D10Buffer *iface)
123 {
124 FIXME("iface %p stub!\n", iface);
125
126 return 0;
127 }
128
129 /* ID3D10Buffer methods */
130
131 static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP map_type, UINT map_flags, void **data)
132 {
133 FIXME("iface %p, map_type %u, map_flags %#x, data %p stub!\n", iface, map_type, map_flags, data);
134
135 return E_NOTIMPL;
136 }
137
138 static void STDMETHODCALLTYPE d3d10_buffer_Unmap(ID3D10Buffer *iface)
139 {
140 FIXME("iface %p stub!\n", iface);
141 }
142
143 static void STDMETHODCALLTYPE d3d10_buffer_GetDesc(ID3D10Buffer *iface, D3D10_BUFFER_DESC *desc)
144 {
145 FIXME("iface %p, desc %p stub!\n", iface, desc);
146 }
147
148 const struct ID3D10BufferVtbl d3d10_buffer_vtbl =
149 {
150 /* IUnknown methods */
151 d3d10_buffer_QueryInterface,
152 d3d10_buffer_AddRef,
153 d3d10_buffer_Release,
154 /* ID3D10DeviceChild methods */
155 d3d10_buffer_GetDevice,
156 d3d10_buffer_GetPrivateData,
157 d3d10_buffer_SetPrivateData,
158 d3d10_buffer_SetPrivateDataInterface,
159 /* ID3D10Resource methods */
160 d3d10_buffer_GetType,
161 d3d10_buffer_SetEvictionPriority,
162 d3d10_buffer_GetEvictionPriority,
163 /* ID3D10Buffer methods */
164 d3d10_buffer_Map,
165 d3d10_buffer_Unmap,
166 d3d10_buffer_GetDesc,
167 };
168
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.