4 This files contains the implementation of interface Direct3DTexture2. */
11 #include "interfaces.h"
17 #include "d3d_private.h"
21 static IDirect3DTexture2_VTable texture2_vtable
;
22 static IDirect3DTexture_VTable texture_vtable
;
24 /*******************************************************************************
25 * Texture2 Creation functions
27 LPDIRECT3DTEXTURE2
d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf
)
29 LPDIRECT3DTEXTURE2 mat
;
31 mat
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(IDirect3DTexture2
));
33 mat
->lpvtbl
= &texture2_vtable
;
39 /*******************************************************************************
40 * Texture Creation functions
42 LPDIRECT3DTEXTURE
d3dtexture_create(LPDIRECTDRAWSURFACE3 surf
)
44 LPDIRECT3DTEXTURE mat
;
46 mat
= HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY
,sizeof(IDirect3DTexture
));
48 mat
->lpvtbl
= (IDirect3DTexture2_VTable
*) &texture_vtable
;
55 /*******************************************************************************
56 * IDirect3DTexture2 methods
59 static HRESULT WINAPI
IDirect3DTexture2_QueryInterface(LPDIRECT3DTEXTURE2
this,
65 WINE_StringFromCLSID((LPCLSID
)riid
,xrefiid
);
66 FIXME(ddraw
, "(%p)->(%s,%p): stub\n", this, xrefiid
,ppvObj
);
73 static ULONG WINAPI
IDirect3DTexture2_AddRef(LPDIRECT3DTEXTURE2
this)
75 TRACE(ddraw
, "(%p)->()incrementing from %lu.\n", this, this->ref
);
82 static ULONG WINAPI
IDirect3DTexture2_Release(LPDIRECT3DTEXTURE2
this)
84 FIXME( ddraw
, "(%p)->() decrementing from %lu.\n", this, this->ref
);
87 HeapFree(GetProcessHeap(),0,this);
94 /*** IDirect3DTexture methods ***/
95 static HRESULT WINAPI
IDirect3DTexture_GetHandle(LPDIRECT3DTEXTURE
this,
96 LPDIRECT3DDEVICE lpD3DDevice
,
97 LPD3DTEXTUREHANDLE lpHandle
)
99 FIXME(ddraw
, "(%p)->(%p,%p): stub\n", this, lpD3DDevice
, lpHandle
);
101 *lpHandle
= (DWORD
) this->surface
;
106 static HRESULT WINAPI
IDirect3DTexture_Initialize(LPDIRECT3DTEXTURE
this,
107 LPDIRECT3DDEVICE lpD3DDevice
,
108 LPDIRECTDRAWSURFACE lpSurface
)
110 TRACE(ddraw
, "(%p)->(%p,%p)\n", this, lpD3DDevice
, lpSurface
);
112 return DDERR_ALREADYINITIALIZED
;
115 static HRESULT WINAPI
IDirect3DTexture_Unload(LPDIRECT3DTEXTURE
this)
117 FIXME(ddraw
, "(%p)->(): stub\n", this);
122 /*** IDirect3DTexture2 methods ***/
123 static HRESULT WINAPI
IDirect3DTexture2_GetHandle(LPDIRECT3DTEXTURE2
this,
124 LPDIRECT3DDEVICE2 lpD3DDevice2
,
125 LPD3DTEXTUREHANDLE lpHandle
)
127 FIXME(ddraw
, "(%p)->(%p,%p): stub\n", this, lpD3DDevice2
, lpHandle
);
129 *lpHandle
= (DWORD
) this->surface
; /* lpD3DDevice2->store_texture(this); */
135 static HRESULT WINAPI
IDirect3DTexture2_PaletteChanged(LPDIRECT3DTEXTURE2
this,
139 FIXME(ddraw
, "(%p)->(%8ld,%8ld): stub\n", this, dwStart
, dwCount
);
144 static HRESULT WINAPI
IDirect3DTexture2_Load(LPDIRECT3DTEXTURE2
this,
145 LPDIRECT3DTEXTURE2 lpD3DTexture2
)
147 FIXME(ddraw
, "(%p)->(%p): stub\n", this, lpD3DTexture2
);
150 FIXME(ddraw
, "Sthis %p / Sload %p\n", this->surface
, lpD3DTexture2
->surface
);
151 this->surface
->s
.surface_desc
.ddsCaps
.dwCaps
&= ~DDSCAPS_ALLOCONLOAD
;
157 /*******************************************************************************
158 * IDirect3DTexture2 VTable
160 static IDirect3DTexture2_VTable texture2_vtable
= {
161 /*** IUnknown methods ***/
162 IDirect3DTexture2_QueryInterface
,
163 IDirect3DTexture2_AddRef
,
164 IDirect3DTexture2_Release
,
165 /*** IDirect3DTexture methods ***/
166 IDirect3DTexture2_GetHandle
,
167 IDirect3DTexture2_PaletteChanged
,
168 IDirect3DTexture2_Load
171 /*******************************************************************************
172 * IDirect3DTexture VTable
174 static IDirect3DTexture_VTable texture_vtable
= {
175 /*** IUnknown methods ***/
176 IDirect3DTexture2_QueryInterface
,
177 IDirect3DTexture2_AddRef
,
178 IDirect3DTexture2_Release
,
179 /*** IDirect3DTexture methods ***/
180 IDirect3DTexture_Initialize
,
181 IDirect3DTexture_GetHandle
,
182 IDirect3DTexture2_PaletteChanged
,
183 IDirect3DTexture2_Load
,
184 IDirect3DTexture_Unload
187 #else /* HAVE_MESAGL */
189 /* These function should never be called if MesaGL is not present */
190 LPDIRECT3DTEXTURE2
d3dtexture2_create(LPDIRECTDRAWSURFACE3 surf
) {
191 ERR(ddraw
, "Should not be called...\n");
195 LPDIRECT3DTEXTURE
d3dtexture_create(LPDIRECTDRAWSURFACE3 surf
) {
196 ERR(ddraw
, "Should not be called...\n");
200 #endif /* HAVE_MESAGL */