Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

THandle.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  THandle.h                                                                           */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description: THandle manager for D3DDrv                                             */
00006 /*                                                                                      */
00007 /*   07/16/2000 Wendell Buckner
00008 /*    Convert to Directx7...    
00009 /*                                                                                      */
00010 /*  The contents of this file are subject to the Genesis3D Public License               */
00011 /*  Version 1.01 (the "License"); you may not use this file except in                   */
00012 /*  compliance with the License. You may obtain a copy of the License at                */
00013 /*  http://www.genesis3d.com                                                            */
00014 /*                                                                                      */
00015 /*  Software distributed under the License is distributed on an "AS IS"                 */
00016 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */
00017 /*  the License for the specific language governing rights and limitations              */
00018 /*  under the License.                                                                  */
00019 /*                                                                                      */
00020 /*  The Original Code is Genesis3D, released March 25, 1999.                            */
00021 /*  Genesis3D Version 1.1 released November 15, 1999                                 */
00022 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */
00023 /*                                                                                      */
00024 /****************************************************************************************/
00025 #ifndef THANDLE_H
00026 #define THANDLE_H
00027 
00028 #include <Windows.h>
00029 
00030 #include "BaseType.h"
00031 #include "DCommon.h"
00032 #include "D3DCache.h"
00033 
00034 #include "TPage.h"
00035 
00036 //============================================================================================
00037 //============================================================================================
00038 #define THANDLE_MAX_MIP_LEVELS          255
00039 //#define       MAX_LMAP_LOG_SIZE                       8                       // Max lightmap size in pixels will be 128x128
00040 //#define       MAX_LMAP_LOG_SIZE                       7                       // Max lightmap size in pixels will be 64x64
00041 #define MAX_LMAP_LOG_SIZE                       6                       // Max lightmap size in pixels will be 32x32
00042 
00043 typedef struct
00044 {
00045 /* 07/16/2000 Wendell Buckner
00046     Convert to Directx7...    
00047         LPDIRECTDRAWSURFACE4    Surface;                        // The DD surface*/
00048         LPDIRECTDRAWSURFACE7    Surface;                        // The DD surface
00049 
00050         D3DCache_Type                   *CacheType;
00051         D3DCache_Slot                   *Slot;
00052 
00053 /* 07/16/2000 Wendell Buckner
00054     Convert to Directx7...    
00055         LPDIRECT3DTEXTURE2          Texture;                    // The DD surface*/
00056         LPDIRECTDRAWSURFACE7    Texture;                        // The texture interface to the surface 
00057 
00058         uint8                                   Flags;
00059 } THandle_MipData;
00060 
00061 // THandle flags
00062 #define THANDLE_LOCKED                                  (1<<0)
00063 #define THANDLE_UPDATE                                  (1<<1)
00064 
00065 typedef struct geRDriver_THandle
00066 {
00067         uint8                                   Active;
00068         int32                                   Width;
00069         int32                                   Height;
00070         int32                                   Stride;
00071         uint8                                   NumMipLevels;
00072         uint8                                   Log;
00073 
00074         THandle_MipData                 *MipData;                               // A mipdata per miplevel
00075 
00076         geRDriver_PixelFormat   PixelFormat;
00077 
00078 #ifdef USE_TPAGES
00079         TPage_Block                             *Block;
00080 #endif
00081 
00082 } geRDriver_THandle;
00083 
00084 extern geRDriver_THandle        TextureHandles[];
00085 
00086 extern D3DCache                         *TextureCache;
00087 extern D3DCache                         *LMapCache;
00088 
00089 extern TPage_Mgr                        *TPageMgr;
00090 
00091 extern THandle_MipData          SystemToVideo[];
00092 
00093 extern CacheNeedsUpdate;
00094 
00095 //============================================================================================
00096 //============================================================================================
00097 void FreeAllCaches(void);
00098 geRDriver_THandle *FindTextureHandle(void);
00099 geBoolean FreeAllTextureHandles(void);
00100 geBoolean THandle_Startup(void);
00101 void THandle_Shutdown(void);
00102 geRDriver_THandle *Create3DTHandle(geRDriver_THandle *THandle, int32 Width, int32 Height, int32 NumMipLevels, const geRDriver_PixelFormat *PixelFormat);
00103 geRDriver_THandle *CreateLightmapTHandle(geRDriver_THandle *THandle, int32 Width, int32 Height, int32 NumMipLevels, const geRDriver_PixelFormat *PixelFormat);
00104 geRDriver_THandle *Create2DTHandle(geRDriver_THandle *THandle, int32 Width, int32 Height, int32 NumMipLevels, const geRDriver_PixelFormat *PixelFormat);
00105 geRDriver_THandle *DRIVERCC THandle_Create(int32 Width, int32 Height, int32 NumMipLevels, const geRDriver_PixelFormat *PixelFormat);
00106 geBoolean DRIVERCC THandle_Destroy(geRDriver_THandle *THandle);
00107 geBoolean DRIVERCC THandle_Lock(geRDriver_THandle *THandle, int32 MipLevel, void **Bits);
00108 geBoolean DRIVERCC THandle_UnLock(geRDriver_THandle *THandle, int32 MipLevel);
00109 geBoolean DRIVERCC THandle_GetInfo(geRDriver_THandle *THandle, int32 MipLevel, geRDriver_THandleInfo *Info);
00110 geBoolean CreateSystemToVideoSurfaces(void);
00111 void DestroySystemToVideoSurfaces(void);
00112 geBoolean THandle_CreateSurfaces(THandle_MipData *MipData, int32 Width, int32 Height, DDSURFACEDESC2 *SurfDesc, geBoolean ColorKey, int32 Stage);
00113 void THandle_DestroySurfaces(THandle_MipData *MipData);
00114 geBoolean THandle_CheckCache(void);
00115 
00116 #endif

Generated on Tue Sep 30 12:36:30 2003 for GTestAndEngine by doxygen 1.3.2