2 * Copyright (c) 1998 Lionel ULMER
4 * This file contains the implementation of interface Direct3DTexture2.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "wine/obj_base.h"
30 #include "wine/debug.h"
32 #include "mesa_private.h"
34 #define D3DDPRIVATE(x) mesa_d3dd_private*odev=(mesa_d3dd_private*)(x)->private
35 #define D3DTPRIVATE(x) mesa_d3dt_private*dtpriv=(mesa_d3dt_private*)(x)->private
37 WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
39 /* Define this if you want to save to a file all the textures used by a game
40 (can be funny to see how they managed to cram all the pictures in
47 #define SNOOP_PALETTED() \
53 sprintf(buf, "%ld.pnm", dtpriv->tex_name); \
54 f = fopen(buf, "wb"); \
55 fprintf(f, "P6\n%ld %ld\n255\n", src_d->dwWidth, src_d->dwHeight); \
56 for (y = 0; y < src_d->dwHeight; y++) { \
57 for (x = 0; x < src_d->dwWidth; x++) { \
58 unsigned char c = ((unsigned char *) src_d->y.lpSurface)[y * src_d->dwWidth + x]; \
59 fputc(table[c][0], f); \
60 fputc(table[c][1], f); \
61 fputc(table[c][2], f); \
67 #define SNOOP_5650() \
73 sprintf(buf, "%ld.pnm", dtpriv->tex_name); \
74 f = fopen(buf, "wb"); \
75 fprintf(f, "P6\n%ld %ld\n255\n", src_d->dwWidth, src_d->dwHeight); \
76 for (y = 0; y < src_d->dwHeight; y++) { \
77 for (x = 0; x < src_d->dwWidth; x++) { \
78 unsigned short c = ((unsigned short *) src_d->y.lpSurface)[y * src_d->dwWidth + x]; \
79 fputc((c & 0xF800) >> 8, f); \
80 fputc((c & 0x07E0) >> 3, f); \
81 fputc((c & 0x001F) << 3, f); \
87 #define SNOOP_5551() \
93 sprintf(buf, "%ld.pnm", dtpriv->tex_name); \
94 f = fopen(buf, "wb"); \
95 fprintf(f, "P6\n%ld %ld\n255\n", src_d->dwWidth, src_d->dwHeight); \
96 for (y = 0; y < src_d->dwHeight; y++) { \
97 for (x = 0; x < src_d->dwWidth; x++) { \
98 unsigned short c = ((unsigned short *) src_d->y.lpSurface)[y * src_d->dwWidth + x]; \
99 fputc((c & 0xF800) >> 8, f); \
100 fputc((c & 0x07C0) >> 3, f); \
101 fputc((c & 0x003E) << 2, f); \
107 #define SNOOP_PALETTED()
112 extern ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable;
113 extern ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable;
115 /*******************************************************************************
116 * Texture2 Creation functions
118 LPDIRECT3DTEXTURE2 d3dtexture2_create(IDirectDrawSurfaceImpl* surf)
120 IDirect3DTexture2Impl* tex;
122 tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl));
124 ICOM_VTBL(tex) = &mesa_texture2_vtable;
127 tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private));
129 return (LPDIRECT3DTEXTURE2)tex;
132 /*******************************************************************************
133 * Texture Creation functions
135 LPDIRECT3DTEXTURE d3dtexture_create(IDirectDrawSurfaceImpl* surf)
137 IDirect3DTexture2Impl* tex;
139 tex = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DTexture2Impl));
141 ICOM_VTBL(tex) = (ICOM_VTABLE(IDirect3DTexture2)*)&mesa_texture_vtable;
144 tex->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dt_private));
146 return (LPDIRECT3DTEXTURE)tex;
149 /*******************************************************************************
150 * IDirectSurface callback methods
152 HRESULT WINAPI SetColorKey_cb(IDirect3DTexture2Impl *texture, DWORD dwFlags, LPDDCOLORKEY ckey )
154 DDSURFACEDESC *tex_d;
155 D3DTPRIVATE(texture);
157 GLuint current_texture;
159 TRACE("(%p) : colorkey callback\n", texture);
161 /* Get the texture description */
162 tex_d = (DDSURFACEDESC *)&(texture->surface->surface_desc);
163 bpp = (tex_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ?
164 1 /* 8 bit of palette index */:
165 tex_d->ddpfPixelFormat.u1.dwRGBBitCount / 8 /* RGB bits for each colors */ );
167 /* Now, save the current texture */
169 glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture);
171 /* If the GetHandle was not done yet, it's an error */
172 if (dtpriv->tex_name == 0) {
173 ERR("Unloaded texture !\n");
177 glBindTexture(GL_TEXTURE_2D, dtpriv->tex_name);
179 if (tex_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
180 FIXME("Todo Paletted\n");
181 } else if (tex_d->ddpfPixelFormat.dwFlags & DDPF_RGB) {
182 if (tex_d->ddpfPixelFormat.u1.dwRGBBitCount == 8) {
183 FIXME("Todo 3_3_2_0\n");
184 } else if (tex_d->ddpfPixelFormat.u1.dwRGBBitCount == 16) {
185 if (tex_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000000) {
186 /* Now transform the 5_6_5 into a 5_5_5_1 surface to support color keying */
187 unsigned short *dest = (unsigned short *) HeapAlloc(GetProcessHeap(),
189 tex_d->dwWidth * tex_d->dwHeight * bpp);
190 unsigned short *src = (unsigned short *) tex_d->lpSurface;
193 for (y = 0; y < tex_d->dwHeight; y++) {
194 for (x = 0; x < tex_d->dwWidth; x++) {
195 unsigned short cpixel = src[x + y * tex_d->dwWidth];
197 if ((dwFlags & DDCKEY_SRCBLT) &&
198 (cpixel >= ckey->dwColorSpaceLowValue) &&
199 (cpixel <= ckey->dwColorSpaceHighValue)) /* No alpha bit => this pixel is transparent */
200 dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0000;
201 else /* Alpha bit is set => this pixel will be seen */
202 dest[x + y * tex_d->dwWidth] = (cpixel & ~0x003F) | ((cpixel & 0x001F) << 1) | 0x0001;
206 glTexImage2D(GL_TEXTURE_2D,
209 tex_d->dwWidth, tex_d->dwHeight,
212 GL_UNSIGNED_SHORT_5_5_5_1,
215 /* Frees the temporary surface */
216 HeapFree(GetProcessHeap(),0,dest);
217 } else if (tex_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000001) {
218 FIXME("Todo 5_5_5_1\n");
219 } else if (tex_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x0000000F) {
220 FIXME("Todo 4_4_4_4\n");
222 ERR("Unhandled texture format (bad Aplha channel for a 16 bit texture)\n");
224 } else if (tex_d->ddpfPixelFormat.u1.dwRGBBitCount == 24) {
225 FIXME("Todo 8_8_8_0\n");
226 } else if (tex_d->ddpfPixelFormat.u1.dwRGBBitCount == 32) {
227 FIXME("Todo 8_8_8_8\n");
229 ERR("Unhandled texture format (bad RGB count)\n");
232 ERR("Unhandled texture format (neither RGB nor INDEX)\n");
239 /*******************************************************************************
240 * IDirect3DTexture2 methods
243 HRESULT WINAPI IDirect3DTexture2Impl_QueryInterface(LPDIRECT3DTEXTURE2 iface,
247 ICOM_THIS(IDirect3DTexture2Impl,iface);
249 FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
256 ULONG WINAPI IDirect3DTexture2Impl_AddRef(LPDIRECT3DTEXTURE2 iface)
258 ICOM_THIS(IDirect3DTexture2Impl,iface);
259 TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
261 return ++(This->ref);
266 ULONG WINAPI IDirect3DTexture2Impl_Release(LPDIRECT3DTEXTURE2 iface)
268 ICOM_THIS(IDirect3DTexture2Impl,iface);
270 FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
272 if (!--(This->ref)) {
273 /* Delete texture from OpenGL */
275 glDeleteTextures(1, &(dtpriv->tex_name));
278 /* Release surface */
279 IDirectDrawSurface4_Release((IDirectDrawSurface4*)This->surface);
281 HeapFree(GetProcessHeap(),0,This);
288 /*** IDirect3DTexture methods ***/
289 HRESULT WINAPI IDirect3DTextureImpl_GetHandle(LPDIRECT3DTEXTURE iface,
290 LPDIRECT3DDEVICE lpD3DDevice,
291 LPD3DTEXTUREHANDLE lpHandle)
293 ICOM_THIS(IDirect3DTexture2Impl,iface);
295 IDirect3DDeviceImpl* ilpD3DDevice=(IDirect3DDeviceImpl*)lpD3DDevice;
296 FIXME("(%p)->(%p,%p): stub\n", This, ilpD3DDevice, lpHandle);
298 *lpHandle = (D3DTEXTUREHANDLE) This;
300 /* Now, bind a new texture */
301 ilpD3DDevice->set_context(ilpD3DDevice);
302 This->D3Ddevice = (void *) ilpD3DDevice;
304 if (dtpriv->tex_name == 0)
305 glGenTextures(1, &(dtpriv->tex_name));
308 /* Associate the texture with the device and perform the appropriate AddRef/Release */
309 /* FIXME: Is there only one or several textures associated with the device ? */
310 if (ilpD3DDevice->current_texture)
311 IDirect3DTexture2Impl_Release((LPDIRECT3DTEXTURE2)ilpD3DDevice->current_texture);
312 IDirect3DTexture2Impl_AddRef((LPDIRECT3DTEXTURE2)iface);
313 ilpD3DDevice->current_texture = (IDirect3DTexture2Impl*)iface;
315 TRACE("OpenGL texture handle is : %d\n", dtpriv->tex_name);
320 HRESULT WINAPI IDirect3DTextureImpl_Initialize(LPDIRECT3DTEXTURE iface,
321 LPDIRECT3DDEVICE lpD3DDevice,
322 LPDIRECTDRAWSURFACE lpSurface)
324 ICOM_THIS(IDirect3DTexture2Impl,iface);
325 TRACE("(%p)->(%p,%p)\n", This, lpD3DDevice, lpSurface);
327 return DDERR_ALREADYINITIALIZED;
330 HRESULT WINAPI IDirect3DTextureImpl_Unload(LPDIRECT3DTEXTURE iface)
332 ICOM_THIS(IDirect3DTexture2Impl,iface);
333 FIXME("(%p)->(): stub\n", This);
338 /*** IDirect3DTexture2 methods ***/
339 HRESULT WINAPI IDirect3DTexture2Impl_GetHandle(LPDIRECT3DTEXTURE2 iface,
340 LPDIRECT3DDEVICE2 lpD3DDevice2,
341 LPD3DTEXTUREHANDLE lpHandle)
343 ICOM_THIS(IDirect3DTexture2Impl,iface);
345 IDirect3DDevice2Impl* ilpD3DDevice2=(IDirect3DDevice2Impl*)lpD3DDevice2;
346 TRACE("(%p)->(%p,%p)\n", This, ilpD3DDevice2, lpHandle);
348 /* For 32 bits OSes, handles = pointers */
349 *lpHandle = (D3DTEXTUREHANDLE) This;
351 /* Now, bind a new texture */
352 ilpD3DDevice2->set_context(ilpD3DDevice2);
353 This->D3Ddevice = (void *) ilpD3DDevice2;
355 if (dtpriv->tex_name == 0)
356 glGenTextures(1, &(dtpriv->tex_name));
359 /* Associate the texture with the device and perform the appropriate AddRef/Release */
360 /* FIXME: Is there only one or several textures associated with the device ? */
361 if (ilpD3DDevice2->current_texture)
362 IDirect3DTexture2Impl_Release((LPDIRECT3DTEXTURE2)ilpD3DDevice2->current_texture);
363 IDirect3DTexture2Impl_AddRef(iface);
364 ilpD3DDevice2->current_texture = (IDirect3DTexture2Impl*)iface;
366 TRACE("OpenGL texture handle is : %d\n", dtpriv->tex_name);
372 HRESULT WINAPI IDirect3DTexture2Impl_PaletteChanged(
373 LPDIRECT3DTEXTURE2 iface, DWORD dwStart, DWORD dwCount
375 ICOM_THIS(IDirect3DTexture2Impl,iface);
376 FIXME("(%p)->(%8ld,%8ld): stub\n", This, dwStart, dwCount);
381 /* NOTE : if you experience crashes in this function, you must have a buggy
382 version of Mesa. See the file d3dtexture.c for a cure */
383 HRESULT WINAPI IDirect3DTexture2Impl_Load(
384 LPDIRECT3DTEXTURE2 iface, LPDIRECT3DTEXTURE2 lpD3DTexture2
386 ICOM_THIS(IDirect3DTexture2Impl,iface);
388 IDirect3DTexture2Impl* ilpD3DTexture2=(IDirect3DTexture2Impl*)lpD3DTexture2;
389 DDSURFACEDESC *src_d, *dst_d;
390 static void (*ptr_ColorTableEXT) (GLenum target, GLenum internalformat,
391 GLsizei width, GLenum format, GLenum type, const GLvoid *table) = NULL;
393 static BOOL color_table_queried = FALSE;
396 TRACE("(%p)->(%p)\n", This, ilpD3DTexture2);
397 TRACE("Copied surface %p to surface %p\n", ilpD3DTexture2->surface, This->surface);
399 if ( This->surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD )
400 /* If the surface is not allocated and its location is not yet specified,
401 force it to video memory */
402 if ( !(This->surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_SYSTEMMEMORY|DDSCAPS_VIDEOMEMORY)) )
403 This->surface->surface_desc.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
405 /* Suppress the ALLOCONLOAD flag */
406 This->surface->surface_desc.ddsCaps.dwCaps &= ~DDSCAPS_ALLOCONLOAD;
408 /* Copy one surface on the other */
409 dst_d = (DDSURFACEDESC *)&(This->surface->surface_desc);
410 src_d = (DDSURFACEDESC *)&(ilpD3DTexture2->surface->surface_desc);
412 /* Install the callbacks to the destination surface */
413 This->surface->texture = This;
414 This->surface->SetColorKey_cb = SetColorKey_cb;
416 if ((src_d->dwWidth != dst_d->dwWidth) || (src_d->dwHeight != dst_d->dwHeight)) {
417 /* Should also check for same pixel format, lPitch, ... */
418 ERR("Error in surface sizes\n");
419 return D3DERR_TEXTURE_LOAD_FAILED;
421 /* LPDIRECT3DDEVICE2 d3dd = (LPDIRECT3DDEVICE2) This->D3Ddevice; */
422 /* I should put a macro for the calculus of bpp */
423 int bpp = (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8 ?
424 1 /* 8 bit of palette index */:
425 src_d->ddpfPixelFormat.u1.dwRGBBitCount / 8 /* RGB bits for each colors */ );
426 GLuint current_texture;
428 /* Copy the main memry texture into the surface that corresponds to the OpenGL
430 memcpy(dst_d->lpSurface, src_d->lpSurface, src_d->dwWidth * src_d->dwHeight * bpp);
434 /* Now, load the texture */
435 /* d3dd->set_context(d3dd); We need to set the context somehow.... */
436 glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_texture);
438 /* If the GetHandle was not done, get the texture name here */
439 if (dtpriv->tex_name == 0)
440 glGenTextures(1, &(dtpriv->tex_name));
441 glBindTexture(GL_TEXTURE_2D, dtpriv->tex_name);
443 if (src_d->ddpfPixelFormat.dwFlags & DDPF_PALETTEINDEXED8) {
447 IDirectDrawPaletteImpl* pal = ilpD3DTexture2->surface->palette;
452 if (color_table_queried == FALSE) {
454 ((Mesa_DeviceCapabilities *) ((x11_dd_private *) This->surface->s.ddraw->d->private)->device_capabilities)->ptr_ColorTableEXT;
459 ERR("Palettized texture Loading with a NULL palette !\n");
461 return D3DERR_TEXTURE_LOAD_FAILED;
464 /* Get the surface's palette */
465 for (i = 0; i < 256; i++) {
466 table[i][0] = pal->palents[i].peRed;
467 table[i][1] = pal->palents[i].peGreen;
468 table[i][2] = pal->palents[i].peBlue;
469 if ((This->surface->surface_desc.dwFlags & DDSD_CKSRCBLT) &&
470 (i >= This->surface->surface_desc.ddckCKSrcBlt.dwColorSpaceLowValue) &&
471 (i <= This->surface->surface_desc.ddckCKSrcBlt.dwColorSpaceHighValue))
477 /* Texture snooping */
480 if (ptr_ColorTableEXT != NULL) {
481 /* use Paletted Texture Extension */
482 ptr_ColorTableEXT(GL_TEXTURE_2D, /* target */
483 GL_RGBA, /* internal format */
484 256, /* table size */
485 GL_RGBA, /* table format */
486 GL_UNSIGNED_BYTE, /* table type */
487 table); /* the color table */
489 glTexImage2D(GL_TEXTURE_2D, /* target */
491 GL_COLOR_INDEX8_EXT, /* internal format */
492 src_d->dwWidth, src_d->dwHeight, /* width, height */
494 GL_COLOR_INDEX, /* texture format */
495 GL_UNSIGNED_BYTE, /* texture type */
496 src_d->lpSurface); /* the texture */
498 DWORD *surface = (DWORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, src_d->dwWidth * src_d->dwHeight * sizeof(DWORD));
500 BYTE *src = (BYTE *) src_d->lpSurface, *dst = (BYTE *) surface;
502 for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) {
504 *dst++ = table[color][0];
505 *dst++ = table[color][1];
506 *dst++ = table[color][2];
507 *dst++ = table[color][3];
510 glTexImage2D(GL_TEXTURE_2D,
513 src_d->dwWidth, src_d->dwHeight,
519 HeapFree(GetProcessHeap(), 0, surface);
521 } else if (src_d->ddpfPixelFormat.dwFlags & DDPF_RGB) {
525 if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 8) {
526 /* **********************
527 GL_UNSIGNED_BYTE_3_3_2
528 ********************** */
529 glTexImage2D(GL_TEXTURE_2D,
532 src_d->dwWidth, src_d->dwHeight,
535 GL_UNSIGNED_BYTE_3_3_2,
537 } else if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 16) {
538 if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000000) {
540 /* Texture snooping */
543 glTexImage2D(GL_TEXTURE_2D,
546 src_d->dwWidth, src_d->dwHeight,
549 GL_UNSIGNED_SHORT_5_6_5,
551 } else if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00000001) {
552 /* Texture snooping */
555 glTexImage2D(GL_TEXTURE_2D,
558 src_d->dwWidth, src_d->dwHeight,
561 GL_UNSIGNED_SHORT_5_5_5_1,
563 } else if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x0000000F) {
564 glTexImage2D(GL_TEXTURE_2D,
567 src_d->dwWidth, src_d->dwHeight,
570 GL_UNSIGNED_SHORT_4_4_4_4,
572 } else if (src_d->ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0x00008000) {
573 /* Converting the 1555 format in 5551 packed */
574 WORD *surface = (WORD *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, src_d->dwWidth * src_d->dwHeight * sizeof(WORD));
576 WORD *src = (WORD *) src_d->lpSurface, *dst = surface;
578 for (i = 0; i < src_d->dwHeight * src_d->dwWidth; i++) {
579 *dst++ = (((*src & 0x8000) >> 15) |
580 ((*src & 0x7FFF) << 1));
584 glTexImage2D(GL_TEXTURE_2D,
587 src_d->dwWidth, src_d->dwHeight,
590 GL_UNSIGNED_SHORT_5_5_5_1,
593 HeapFree(GetProcessHeap(), 0, surface);
595 ERR("Unhandled texture format (bad Aplha channel for a 16 bit texture)\n");
597 } else if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 24) {
598 glTexImage2D(GL_TEXTURE_2D,
601 src_d->dwWidth, src_d->dwHeight,
606 } else if (src_d->ddpfPixelFormat.u1.dwRGBBitCount == 32) {
607 glTexImage2D(GL_TEXTURE_2D,
610 src_d->dwWidth, src_d->dwHeight,
616 ERR("Unhandled texture format (bad RGB count)\n");
619 ERR("Unhandled texture format (neither RGB nor INDEX)\n");
622 glBindTexture(GL_TEXTURE_2D, current_texture);
631 /*******************************************************************************
632 * IDirect3DTexture2 VTable
634 ICOM_VTABLE(IDirect3DTexture2) mesa_texture2_vtable =
636 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
637 /*** IUnknown methods ***/
638 IDirect3DTexture2Impl_QueryInterface,
639 IDirect3DTexture2Impl_AddRef,
640 IDirect3DTexture2Impl_Release,
641 /*** IDirect3DTexture methods ***/
642 IDirect3DTexture2Impl_GetHandle,
643 IDirect3DTexture2Impl_PaletteChanged,
644 IDirect3DTexture2Impl_Load
647 /*******************************************************************************
648 * IDirect3DTexture VTable
650 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
651 # define XCAST(fun) (typeof(mesa_texture_vtable.fun))
653 # define XCAST(fun) (void*)
656 ICOM_VTABLE(IDirect3DTexture) mesa_texture_vtable =
658 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
659 /*** IUnknown methods ***/
660 XCAST(QueryInterface)IDirect3DTexture2Impl_QueryInterface,
661 XCAST(AddRef)IDirect3DTexture2Impl_AddRef,
662 XCAST(Release)IDirect3DTexture2Impl_Release,
663 /*** IDirect3DTexture methods ***/
664 IDirect3DTextureImpl_Initialize,
665 IDirect3DTextureImpl_GetHandle,
666 XCAST(PaletteChanged)IDirect3DTexture2Impl_PaletteChanged,
667 XCAST(Load)IDirect3DTexture2Impl_Load,
668 IDirect3DTextureImpl_Unload
671 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)