1 /****************************************************************************************/
\r
4 /* Author: John Pollard, Ken Baird */
\r
5 /* Description: Texture Handle code header file */
\r
7 /* The contents of this file are subject to the Genesis3D Public License */
\r
8 /* Version 1.01 (the "License"); you may not use this file except in */
\r
9 /* compliance with the License. You may obtain a copy of the License at */
\r
10 /* http://www.genesis3d.com */
\r
12 /* Software distributed under the License is distributed on an "AS IS" */
\r
13 /* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See */
\r
14 /* the License for the specific language governing rights and limitations */
\r
15 /* under the License. */
\r
17 /* The Original Code is Genesis3D, released March 25, 1999. */
\r
18 /* Genesis3D Version 1.1 released November 15, 1999 */
\r
19 /* Copyright (C) 1999 WildTangent, Inc. All Rights Reserved */
\r
21 /****************************************************************************************/
\r
25 #include <Windows.h>
\r
29 #include "DCommon.h"
\r
31 #define MAX_TEXTURE_HANDLES 15000
\r
34 #define THANDLE_UPDATE (1<<0) // Force a thandle to be uploaded to the card
\r
35 #define THANDLE_TRANS (1<<2) // Texture has transparency
\r
36 #define THANDLE_LOCKED (1<<3) // THandle is currently locked (invalid for rendering etc)
\r
38 typedef struct geRDriver_THandle
\r
40 int32 Active, Width, Height, MipLevels;
\r
41 geRDriver_PixelFormat PixelFormat;
\r
42 uint16 *BitPtr[16];//8 or 16
\r
43 geRDriver_THandle *PalHandle;
\r
44 geRDriver_THandle *AlphaHandle;
\r
47 } geRDriver_THandle;
\r
49 extern geRDriver_THandle TextureHandles[MAX_TEXTURE_HANDLES];
\r
51 geBoolean DRIVERCC DrvResetAll(void);
\r
52 geRDriver_THandle *DRIVERCC CreateTexture(int32 Width, int32 Height, int32 NumMipLevels, const geRDriver_PixelFormat *PixelFormat);
\r
53 geBoolean DRIVERCC DestroyTexture(geRDriver_THandle *THandle);
\r
55 geBoolean DRIVERCC LockTextureHandle(geRDriver_THandle *THandle, int32 MipLevel, void **Data);
\r
56 geBoolean DRIVERCC UnLockTextureHandle(geRDriver_THandle *THandle, int32 MipLevel);
\r
57 geBoolean DRIVERCC THandle_GetInfo(geRDriver_THandle *THandle, int32 MipLevel, geRDriver_THandleInfo *Info);
\r
59 geBoolean DRIVERCC SetPalette(geRDriver_THandle *THandle, geRDriver_THandle *PalHandle);
\r
60 geRDriver_THandle *DRIVERCC GetPalette(geRDriver_THandle *THandle);
\r
61 geBoolean DRIVERCC SetAlpha(geRDriver_THandle *THandle, geRDriver_THandle *PalHandle);
\r
62 geRDriver_THandle *DRIVERCC GetAlpha(geRDriver_THandle *THandle);
\r