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
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 struct d3d10_texture2d
*This
= (struct d3d10_texture2d
*)iface
;
33 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
35 if (IsEqualGUID(riid
, &IID_ID3D10Texture2D
)
36 || IsEqualGUID(riid
, &IID_ID3D10Resource
)
37 || IsEqualGUID(riid
, &IID_ID3D10DeviceChild
)
38 || IsEqualGUID(riid
, &IID_IUnknown
))
40 IUnknown_AddRef(iface
);
45 if (This
->dxgi_surface
)
47 TRACE("Forwarding to dxgi surface\n");
48 return IDXGISurface_QueryInterface(This
->dxgi_surface
, riid
, object
);
51 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
57 static ULONG STDMETHODCALLTYPE
d3d10_texture2d_AddRef(ID3D10Texture2D
*iface
)
59 struct d3d10_texture2d
*This
= (struct d3d10_texture2d
*)iface
;
60 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
62 TRACE("%p increasing refcount to %u\n", This
, refcount
);
67 static ULONG STDMETHODCALLTYPE
d3d10_texture2d_Release(ID3D10Texture2D
*iface
)
69 struct d3d10_texture2d
*This
= (struct d3d10_texture2d
*)iface
;
70 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
72 TRACE("%p decreasing refcount to %u\n", This
, refcount
);
76 if (This
->dxgi_surface
) IDXGISurface_Release(This
->dxgi_surface
);
77 if (This
->wined3d_surface
) IWineD3DSurface_Release(This
->wined3d_surface
);
78 HeapFree(GetProcessHeap(), 0, This
);
84 /* ID3D10DeviceChild methods */
86 static void STDMETHODCALLTYPE
d3d10_texture2d_GetDevice(ID3D10Texture2D
*iface
, ID3D10Device
**device
)
88 FIXME("iface %p, device %p stub!\n", iface
, device
);
91 static HRESULT STDMETHODCALLTYPE
d3d10_texture2d_GetPrivateData(ID3D10Texture2D
*iface
,
92 REFGUID guid
, UINT
*data_size
, void *data
)
94 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
95 iface
, debugstr_guid(guid
), data_size
, data
);
100 static HRESULT STDMETHODCALLTYPE
d3d10_texture2d_SetPrivateData(ID3D10Texture2D
*iface
,
101 REFGUID guid
, UINT data_size
, const void *data
)
103 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
104 iface
, debugstr_guid(guid
), data_size
, data
);
109 static HRESULT STDMETHODCALLTYPE
d3d10_texture2d_SetPrivateDataInterface(ID3D10Texture2D
*iface
,
110 REFGUID guid
, const IUnknown
*data
)
112 FIXME("iface %p, guid %s, data %p stub!\n", iface
, debugstr_guid(guid
), data
);
117 /* ID3D10Resource methods */
119 static void STDMETHODCALLTYPE
d3d10_texture2d_GetType(ID3D10Texture2D
*iface
,
120 D3D10_RESOURCE_DIMENSION
*resource_dimension
)
122 TRACE("iface %p, resource_dimension %p\n", iface
, resource_dimension
);
124 *resource_dimension
= D3D10_RESOURCE_DIMENSION_TEXTURE2D
;
127 static void STDMETHODCALLTYPE
d3d10_texture2d_SetEvictionPriority(ID3D10Texture2D
*iface
, UINT eviction_priority
)
129 FIXME("iface %p, eviction_priority %u stub!\n", iface
, eviction_priority
);
132 static UINT STDMETHODCALLTYPE
d3d10_texture2d_GetEvictionPriority(ID3D10Texture2D
*iface
)
134 FIXME("iface %p stub!\n", iface
);
139 /* ID3D10Texture2D methods */
141 static HRESULT STDMETHODCALLTYPE
d3d10_texture2d_Map(ID3D10Texture2D
*iface
, UINT sub_resource
,
142 D3D10_MAP map_type
, UINT map_flags
, D3D10_MAPPED_TEXTURE2D
*mapped_texture
)
144 FIXME("iface %p, sub_resource %u, map_type %u, map_flags %#x, mapped_texture %p stub!\n",
145 iface
, sub_resource
, map_type
, map_flags
, mapped_texture
);
150 static void STDMETHODCALLTYPE
d3d10_texture2d_Unmap(ID3D10Texture2D
*iface
, UINT sub_resource
)
152 FIXME("iface %p, sub_resource %u stub!\n", iface
, sub_resource
);
155 static void STDMETHODCALLTYPE
d3d10_texture2d_GetDesc(ID3D10Texture2D
*iface
, D3D10_TEXTURE2D_DESC
*desc
)
157 struct d3d10_texture2d
*This
= (struct d3d10_texture2d
*)iface
;
159 TRACE("iface %p, desc %p\n", iface
, desc
);
164 const struct ID3D10Texture2DVtbl d3d10_texture2d_vtbl
=
166 /* IUnknown methods */
167 d3d10_texture2d_QueryInterface
,
168 d3d10_texture2d_AddRef
,
169 d3d10_texture2d_Release
,
170 /* ID3D10DeviceChild methods */
171 d3d10_texture2d_GetDevice
,
172 d3d10_texture2d_GetPrivateData
,
173 d3d10_texture2d_SetPrivateData
,
174 d3d10_texture2d_SetPrivateDataInterface
,
175 /* ID3D10Resource methods */
176 d3d10_texture2d_GetType
,
177 d3d10_texture2d_SetEvictionPriority
,
178 d3d10_texture2d_GetEvictionPriority
,
179 /* ID3D10Texture2D methods */
181 d3d10_texture2d_Unmap
,
182 d3d10_texture2d_GetDesc
,