1 | /*
|
---|
2 | * IDirect3DTexture9 implementation
|
---|
3 | *
|
---|
4 | * Copyright 2002-2005 Jason Edmeades
|
---|
5 | * Copyright 2002-2005 Raphael Junqueira
|
---|
6 | * Copyright 2005 Oliver Stieber
|
---|
7 | *
|
---|
8 | * This library is free software; you can redistribute it and/or
|
---|
9 | * modify it under the terms of the GNU Lesser General Public
|
---|
10 | * License as published by the Free Software Foundation; either
|
---|
11 | * version 2.1 of the License, or (at your option) any later version.
|
---|
12 | *
|
---|
13 | * This library is distributed in the hope that it will be useful,
|
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
16 | * Lesser General Public License for more details.
|
---|
17 | *
|
---|
18 | * You should have received a copy of the GNU Lesser General Public
|
---|
19 | * License along with this library; if not, write to the Free Software
|
---|
20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
21 | */
|
---|
22 |
|
---|
23 | /*
|
---|
24 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
25 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
26 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
27 | * a choice of LGPL license versions is made available with the language indicating
|
---|
28 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
29 | * of the LGPL is applied is otherwise unspecified.
|
---|
30 | */
|
---|
31 |
|
---|
32 | #include "config.h"
|
---|
33 | #include "d3d9_private.h"
|
---|
34 |
|
---|
35 | WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
|
---|
36 |
|
---|
37 | /* IDirect3DTexture9 IUnknown parts follow: */
|
---|
38 | static HRESULT WINAPI IDirect3DTexture9Impl_QueryInterface(LPDIRECT3DTEXTURE9 iface, REFIID riid, LPVOID* ppobj) {
|
---|
39 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
40 |
|
---|
41 | if (IsEqualGUID(riid, &IID_IUnknown)
|
---|
42 | || IsEqualGUID(riid, &IID_IDirect3DResource9)
|
---|
43 | || IsEqualGUID(riid, &IID_IDirect3DBaseTexture9)
|
---|
44 | || IsEqualGUID(riid, &IID_IDirect3DTexture9)) {
|
---|
45 | IDirect3DTexture9_AddRef(iface);
|
---|
46 | *ppobj = This;
|
---|
47 | return S_OK;
|
---|
48 | }
|
---|
49 |
|
---|
50 | WARN("(%p)->(%s,%p) not found\n", This, debugstr_guid(riid), ppobj);
|
---|
51 | *ppobj = NULL;
|
---|
52 | return E_NOINTERFACE;
|
---|
53 | }
|
---|
54 |
|
---|
55 | static ULONG WINAPI IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface) {
|
---|
56 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
57 | ULONG ref = InterlockedIncrement(&This->ref);
|
---|
58 |
|
---|
59 | TRACE("(%p) : AddRef from %d\n", This, ref - 1);
|
---|
60 |
|
---|
61 | return ref;
|
---|
62 | }
|
---|
63 |
|
---|
64 | static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) {
|
---|
65 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
66 | ULONG ref = InterlockedDecrement(&This->ref);
|
---|
67 |
|
---|
68 | TRACE("(%p) : ReleaseRef to %d\n", This, ref);
|
---|
69 |
|
---|
70 | if (ref == 0) {
|
---|
71 | EnterCriticalSection(&d3d9_cs);
|
---|
72 | IWineD3DTexture_Destroy(This->wineD3DTexture, D3D9CB_DestroySurface);
|
---|
73 | LeaveCriticalSection(&d3d9_cs);
|
---|
74 | IDirect3DDevice9Ex_Release(This->parentDevice);
|
---|
75 | HeapFree(GetProcessHeap(), 0, This);
|
---|
76 | }
|
---|
77 | return ref;
|
---|
78 | }
|
---|
79 |
|
---|
80 | /* IDirect3DTexture9 IDirect3DResource9 Interface follow: */
|
---|
81 | static HRESULT WINAPI IDirect3DTexture9Impl_GetDevice(LPDIRECT3DTEXTURE9 iface, IDirect3DDevice9** ppDevice) {
|
---|
82 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
83 | IWineD3DDevice *wined3d_device;
|
---|
84 | HRESULT hr;
|
---|
85 | TRACE("(%p) Relay\n", This);
|
---|
86 |
|
---|
87 | EnterCriticalSection(&d3d9_cs);
|
---|
88 | hr = IWineD3DTexture_GetDevice(This->wineD3DTexture, &wined3d_device);
|
---|
89 | if (SUCCEEDED(hr))
|
---|
90 | {
|
---|
91 | IWineD3DDevice_GetParent(wined3d_device, (IUnknown **)ppDevice);
|
---|
92 | IWineD3DDevice_Release(wined3d_device);
|
---|
93 | }
|
---|
94 | LeaveCriticalSection(&d3d9_cs);
|
---|
95 | return hr;
|
---|
96 | }
|
---|
97 |
|
---|
98 | static HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
---|
99 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
100 | HRESULT hr;
|
---|
101 | TRACE("(%p) Relay\n", This);
|
---|
102 |
|
---|
103 | EnterCriticalSection(&d3d9_cs);
|
---|
104 | hr = IWineD3DTexture_SetPrivateData(This->wineD3DTexture, refguid, pData, SizeOfData, Flags);
|
---|
105 | LeaveCriticalSection(&d3d9_cs);
|
---|
106 | return hr;
|
---|
107 | }
|
---|
108 |
|
---|
109 | static HRESULT WINAPI IDirect3DTexture9Impl_GetPrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
---|
110 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
111 | HRESULT hr;
|
---|
112 | TRACE("(%p) Relay\n", This);
|
---|
113 |
|
---|
114 | EnterCriticalSection(&d3d9_cs);
|
---|
115 | hr = IWineD3DTexture_GetPrivateData(This->wineD3DTexture, refguid, pData, pSizeOfData);
|
---|
116 | LeaveCriticalSection(&d3d9_cs);
|
---|
117 | return hr;
|
---|
118 | }
|
---|
119 |
|
---|
120 | static HRESULT WINAPI IDirect3DTexture9Impl_FreePrivateData(LPDIRECT3DTEXTURE9 iface, REFGUID refguid) {
|
---|
121 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
122 | HRESULT hr;
|
---|
123 | TRACE("(%p) Relay\n", This);
|
---|
124 |
|
---|
125 | EnterCriticalSection(&d3d9_cs);
|
---|
126 | hr = IWineD3DTexture_FreePrivateData(This->wineD3DTexture, refguid);
|
---|
127 | LeaveCriticalSection(&d3d9_cs);
|
---|
128 | return hr;
|
---|
129 | }
|
---|
130 |
|
---|
131 | static DWORD WINAPI IDirect3DTexture9Impl_SetPriority(LPDIRECT3DTEXTURE9 iface, DWORD PriorityNew) {
|
---|
132 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
133 | DWORD ret;
|
---|
134 | TRACE("(%p) Relay\n", This);
|
---|
135 |
|
---|
136 | EnterCriticalSection(&d3d9_cs);
|
---|
137 | ret = IWineD3DTexture_SetPriority(This->wineD3DTexture, PriorityNew);
|
---|
138 | LeaveCriticalSection(&d3d9_cs);
|
---|
139 | return ret;
|
---|
140 | }
|
---|
141 |
|
---|
142 | static DWORD WINAPI IDirect3DTexture9Impl_GetPriority(LPDIRECT3DTEXTURE9 iface) {
|
---|
143 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
144 | DWORD ret;
|
---|
145 | TRACE("(%p) Relay\n", This);
|
---|
146 |
|
---|
147 | EnterCriticalSection(&d3d9_cs);
|
---|
148 | ret = IWineD3DTexture_GetPriority(This->wineD3DTexture);
|
---|
149 | LeaveCriticalSection(&d3d9_cs);
|
---|
150 | return ret;
|
---|
151 | }
|
---|
152 |
|
---|
153 | static void WINAPI IDirect3DTexture9Impl_PreLoad(LPDIRECT3DTEXTURE9 iface) {
|
---|
154 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
155 | TRACE("(%p) Relay\n", This);
|
---|
156 |
|
---|
157 | EnterCriticalSection(&d3d9_cs);
|
---|
158 | IWineD3DTexture_PreLoad(This->wineD3DTexture);
|
---|
159 | LeaveCriticalSection(&d3d9_cs);
|
---|
160 | }
|
---|
161 |
|
---|
162 | static D3DRESOURCETYPE WINAPI IDirect3DTexture9Impl_GetType(LPDIRECT3DTEXTURE9 iface) {
|
---|
163 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
164 | HRESULT ret;
|
---|
165 | TRACE("(%p) Relay\n", This);
|
---|
166 |
|
---|
167 | EnterCriticalSection(&d3d9_cs);
|
---|
168 | ret = IWineD3DTexture_GetType(This->wineD3DTexture);
|
---|
169 | LeaveCriticalSection(&d3d9_cs);
|
---|
170 | return ret;
|
---|
171 | }
|
---|
172 |
|
---|
173 | /* IDirect3DTexture9 IDirect3DBaseTexture9 Interface follow: */
|
---|
174 | static DWORD WINAPI IDirect3DTexture9Impl_SetLOD(LPDIRECT3DTEXTURE9 iface, DWORD LODNew) {
|
---|
175 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
176 | DWORD ret;
|
---|
177 | TRACE("(%p) Relay\n", This);
|
---|
178 |
|
---|
179 | EnterCriticalSection(&d3d9_cs);
|
---|
180 | ret = IWineD3DTexture_SetLOD(This->wineD3DTexture, LODNew);
|
---|
181 | LeaveCriticalSection(&d3d9_cs);
|
---|
182 | return ret;
|
---|
183 | }
|
---|
184 |
|
---|
185 | static DWORD WINAPI IDirect3DTexture9Impl_GetLOD(LPDIRECT3DTEXTURE9 iface) {
|
---|
186 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
187 | DWORD ret;
|
---|
188 | TRACE("(%p) Relay\n", This);
|
---|
189 |
|
---|
190 | EnterCriticalSection(&d3d9_cs);
|
---|
191 | ret = IWineD3DTexture_GetLOD(This->wineD3DTexture);
|
---|
192 | LeaveCriticalSection(&d3d9_cs);
|
---|
193 | return ret;
|
---|
194 | }
|
---|
195 |
|
---|
196 | static DWORD WINAPI IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface) {
|
---|
197 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
198 | DWORD ret;
|
---|
199 | TRACE("(%p) Relay\n", This);
|
---|
200 |
|
---|
201 | EnterCriticalSection(&d3d9_cs);
|
---|
202 | ret = IWineD3DTexture_GetLevelCount(This->wineD3DTexture);
|
---|
203 | LeaveCriticalSection(&d3d9_cs);
|
---|
204 | return ret;
|
---|
205 | }
|
---|
206 |
|
---|
207 | static HRESULT WINAPI IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface, D3DTEXTUREFILTERTYPE FilterType) {
|
---|
208 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
209 | HRESULT hr;
|
---|
210 | TRACE("(%p) Relay\n", This);
|
---|
211 |
|
---|
212 | EnterCriticalSection(&d3d9_cs);
|
---|
213 | hr = IWineD3DTexture_SetAutoGenFilterType(This->wineD3DTexture, (WINED3DTEXTUREFILTERTYPE) FilterType);
|
---|
214 | LeaveCriticalSection(&d3d9_cs);
|
---|
215 | return hr;
|
---|
216 | }
|
---|
217 |
|
---|
218 | static D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LPDIRECT3DTEXTURE9 iface) {
|
---|
219 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
220 | D3DTEXTUREFILTERTYPE ret;
|
---|
221 | TRACE("(%p) Relay\n", This);
|
---|
222 |
|
---|
223 | EnterCriticalSection(&d3d9_cs);
|
---|
224 | ret = (D3DTEXTUREFILTERTYPE) IWineD3DTexture_GetAutoGenFilterType(This->wineD3DTexture);
|
---|
225 | LeaveCriticalSection(&d3d9_cs);
|
---|
226 | return ret;
|
---|
227 | }
|
---|
228 |
|
---|
229 | static void WINAPI IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9 iface) {
|
---|
230 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
231 | TRACE("(%p) Relay\n", This);
|
---|
232 |
|
---|
233 | EnterCriticalSection(&d3d9_cs);
|
---|
234 | IWineD3DTexture_GenerateMipSubLevels(This->wineD3DTexture);
|
---|
235 | LeaveCriticalSection(&d3d9_cs);
|
---|
236 | }
|
---|
237 |
|
---|
238 | /* IDirect3DTexture9 Interface follow: */
|
---|
239 | static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DSURFACE_DESC* pDesc) {
|
---|
240 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
241 | WINED3DSURFACE_DESC wined3ddesc;
|
---|
242 | HRESULT hr;
|
---|
243 |
|
---|
244 | TRACE("(%p) Relay\n", This);
|
---|
245 |
|
---|
246 | EnterCriticalSection(&d3d9_cs);
|
---|
247 | hr = IWineD3DTexture_GetLevelDesc(This->wineD3DTexture, Level, &wined3ddesc);
|
---|
248 | LeaveCriticalSection(&d3d9_cs);
|
---|
249 |
|
---|
250 | if (SUCCEEDED(hr))
|
---|
251 | {
|
---|
252 | pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.format);
|
---|
253 | pDesc->Type = wined3ddesc.resource_type;
|
---|
254 | pDesc->Usage = wined3ddesc.usage;
|
---|
255 | pDesc->Pool = wined3ddesc.pool;
|
---|
256 | pDesc->MultiSampleType = wined3ddesc.multisample_type;
|
---|
257 | pDesc->MultiSampleQuality = wined3ddesc.multisample_quality;
|
---|
258 | pDesc->Width = wined3ddesc.width;
|
---|
259 | pDesc->Height = wined3ddesc.height;
|
---|
260 | }
|
---|
261 |
|
---|
262 | return hr;
|
---|
263 | }
|
---|
264 |
|
---|
265 | static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE9 iface, UINT Level, IDirect3DSurface9** ppSurfaceLevel) {
|
---|
266 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
267 | HRESULT hrc = D3D_OK;
|
---|
268 | IWineD3DSurface *mySurface = NULL;
|
---|
269 |
|
---|
270 | TRACE("(%p) Relay\n", This);
|
---|
271 | EnterCriticalSection(&d3d9_cs);
|
---|
272 | hrc = IWineD3DTexture_GetSurfaceLevel(This->wineD3DTexture, Level, &mySurface);
|
---|
273 | if (hrc == D3D_OK && NULL != ppSurfaceLevel) {
|
---|
274 | IWineD3DSurface_GetParent(mySurface, (IUnknown **)ppSurfaceLevel);
|
---|
275 | IWineD3DSurface_Release(mySurface);
|
---|
276 | }
|
---|
277 | LeaveCriticalSection(&d3d9_cs);
|
---|
278 | return hrc;
|
---|
279 | }
|
---|
280 |
|
---|
281 | static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
|
---|
282 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
283 | HRESULT hr;
|
---|
284 | TRACE("(%p) Relay\n", This);
|
---|
285 |
|
---|
286 | EnterCriticalSection(&d3d9_cs);
|
---|
287 | hr = IWineD3DTexture_LockRect(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
|
---|
288 | LeaveCriticalSection(&d3d9_cs);
|
---|
289 | return hr;
|
---|
290 | }
|
---|
291 |
|
---|
292 | static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface, UINT Level) {
|
---|
293 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
294 | HRESULT hr;
|
---|
295 | TRACE("(%p) Relay\n", This);
|
---|
296 |
|
---|
297 | EnterCriticalSection(&d3d9_cs);
|
---|
298 | hr = IWineD3DTexture_UnlockRect(This->wineD3DTexture, Level);
|
---|
299 | LeaveCriticalSection(&d3d9_cs);
|
---|
300 | return hr;
|
---|
301 | }
|
---|
302 |
|
---|
303 | static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(LPDIRECT3DTEXTURE9 iface, CONST RECT* pDirtyRect) {
|
---|
304 | IDirect3DTexture9Impl *This = (IDirect3DTexture9Impl *)iface;
|
---|
305 | HRESULT hr;
|
---|
306 | TRACE("(%p) Relay\n", This);
|
---|
307 |
|
---|
308 | EnterCriticalSection(&d3d9_cs);
|
---|
309 | hr = IWineD3DTexture_AddDirtyRect(This->wineD3DTexture, pDirtyRect);
|
---|
310 | LeaveCriticalSection(&d3d9_cs);
|
---|
311 | return hr;
|
---|
312 | }
|
---|
313 |
|
---|
314 | static const IDirect3DTexture9Vtbl Direct3DTexture9_Vtbl =
|
---|
315 | {
|
---|
316 | /* IUnknown */
|
---|
317 | IDirect3DTexture9Impl_QueryInterface,
|
---|
318 | IDirect3DTexture9Impl_AddRef,
|
---|
319 | IDirect3DTexture9Impl_Release,
|
---|
320 | /* IDirect3DResource9 */
|
---|
321 | IDirect3DTexture9Impl_GetDevice,
|
---|
322 | IDirect3DTexture9Impl_SetPrivateData,
|
---|
323 | IDirect3DTexture9Impl_GetPrivateData,
|
---|
324 | IDirect3DTexture9Impl_FreePrivateData,
|
---|
325 | IDirect3DTexture9Impl_SetPriority,
|
---|
326 | IDirect3DTexture9Impl_GetPriority,
|
---|
327 | IDirect3DTexture9Impl_PreLoad,
|
---|
328 | IDirect3DTexture9Impl_GetType,
|
---|
329 | /* IDirect3dBaseTexture9 */
|
---|
330 | IDirect3DTexture9Impl_SetLOD,
|
---|
331 | IDirect3DTexture9Impl_GetLOD,
|
---|
332 | IDirect3DTexture9Impl_GetLevelCount,
|
---|
333 | IDirect3DTexture9Impl_SetAutoGenFilterType,
|
---|
334 | IDirect3DTexture9Impl_GetAutoGenFilterType,
|
---|
335 | IDirect3DTexture9Impl_GenerateMipSubLevels,
|
---|
336 | /* IDirect3DTexture9 */
|
---|
337 | IDirect3DTexture9Impl_GetLevelDesc,
|
---|
338 | IDirect3DTexture9Impl_GetSurfaceLevel,
|
---|
339 | IDirect3DTexture9Impl_LockRect,
|
---|
340 | IDirect3DTexture9Impl_UnlockRect,
|
---|
341 | IDirect3DTexture9Impl_AddDirtyRect
|
---|
342 | };
|
---|
343 |
|
---|
344 |
|
---|
345 | /* IDirect3DDevice9 IDirect3DTexture9 Methods follow: */
|
---|
346 | HRESULT WINAPI IDirect3DDevice9Impl_CreateTexture(LPDIRECT3DDEVICE9EX iface, UINT Width, UINT Height, UINT Levels, DWORD Usage,
|
---|
347 | D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
|
---|
348 | IDirect3DTexture9Impl *object;
|
---|
349 | IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
|
---|
350 | HRESULT hrc = D3D_OK;
|
---|
351 |
|
---|
352 | TRACE("(%p) : W(%d) H(%d), Lvl(%d) d(%d), Fmt(%#x), Pool(%d)\n", This, Width, Height, Levels, Usage, Format, Pool);
|
---|
353 |
|
---|
354 | /* Allocate the storage for the device */
|
---|
355 | object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DTexture9Impl));
|
---|
356 |
|
---|
357 | if (NULL == object) {
|
---|
358 | ERR("Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY\n");
|
---|
359 | return D3DERR_OUTOFVIDEOMEMORY;
|
---|
360 | }
|
---|
361 |
|
---|
362 | object->lpVtbl = &Direct3DTexture9_Vtbl;
|
---|
363 | object->ref = 1;
|
---|
364 | EnterCriticalSection(&d3d9_cs);
|
---|
365 | hrc = IWineD3DDevice_CreateTexture(This->WineD3DDevice, Width, Height, Levels, Usage & WINED3DUSAGE_MASK,
|
---|
366 | wined3dformat_from_d3dformat(Format), Pool, &object->wineD3DTexture, (IUnknown *)object);
|
---|
367 | LeaveCriticalSection(&d3d9_cs);
|
---|
368 | if (FAILED(hrc)) {
|
---|
369 |
|
---|
370 | /* free up object */
|
---|
371 | WARN("(%p) call to IWineD3DDevice_CreateTexture failed\n", This);
|
---|
372 | HeapFree(GetProcessHeap(), 0, object);
|
---|
373 | } else {
|
---|
374 | IDirect3DDevice9Ex_AddRef(iface);
|
---|
375 | object->parentDevice = iface;
|
---|
376 | *ppTexture= (LPDIRECT3DTEXTURE9) object;
|
---|
377 | TRACE("(%p) Created Texture %p, %p\n", This, object, object->wineD3DTexture);
|
---|
378 | }
|
---|
379 |
|
---|
380 | return hrc;
|
---|
381 | }
|
---|