geDriver

Description: Takes care of some of the driver work.

Source file: ...\genesis3d\OpenSource\Engine\System.h
  Note: Interface for several mode & driver functions are in ...\genesis3d\OpenSource\Genesis.h (though implementation is in System.c)
           And declaration of Mesh types is in ...\genesis3d\OpenSource\PTRTYPES.

Contents:

Functions: GetName, GetNextMode, ModeGetName, ModeGetWidthHeight, SystemGetNextDriver

Types: geEngine_FrameState, Sys_String, Sys_FontInfo, Sys_CPUInfo, geDriver_Mode, geDriver, Sys_DriverInfo, Sys_DebugInfo, geEngine_WorldList, geEngine, Mesh_MeshInfo, Mesh_MeshDef, Mesh_RenderQ

Constants: view

Additions to Genesis3D v1.6: None

Types:

geEngine_FrameState

typedef enum {
      FrameState_None = 0,
      FrameState_Begin,
} geEngine_FrameState;

Return to Contents

 

Sys_String

typedef struct {
      int32       x,y;
      char        String[MAX_CLIENT_STRING_LEN];
} Sys_String;

Return to Contents

 

Sys_FontInfo

typedef struct {
      geBitmap*         FontBitmap;
       uint32               FontLUT1[256];
      Sys_String         ClientStrings[MAX_CLIENT_STRINGS];
      int32                  NumStrings;
} Sys_FontInfo;

Return to Contents

 

Sys_CPUInfo

typedef struct {
      int32              Freq;
} Sys_CPUInfo;

Return to Contents

 

geDriver_Mode

typedef struct geDriver_Mode {
      int32               Id;       // Driver assigned mode id
      char                Name[DRV_MODE_STR_SIZE];  // Driver assigned mode name
      int32               Width;      // Mode width
      int32               Height;      // Mode height
} geDriver_Mode;

 Return to Contents
 

geDriver

typedef struct geDriver {
      int32                    Id;       // Driver assigned Id
      char                     Name[DRV_STR_SIZE];   // Driver assigned name
      char                     FileName[256];    // FileName of driver
      geDriver_Mode   Modes[MAX_DRIVER_MODES]; // Modes for this driver
      int32                    NumModes;     // Num modes for this driver
} geDriver;

Return to Contents
 

Sys_DriverInfo

typedef struct {
      // Info the enuming fills in
      geDriver              SubDrivers[MAX_SUB_DRIVERS];
      int32                    NumSubDrivers;
      char*                    CurFileName;
       // Data for current driver
      geBoolean            Active;    // GE_TRUE if a driver and mode has been initialized
       HINSTANCE     DriverHandle;  // CurrentDriver Handle (for DLL)
       geDriver*            CurDriver;   // Current driver
      geDriver_Mode*  CurMode;   // Current mode
      DRV_Driver*       RDriver;   // Current driver function hook
} Sys_DriverInfo;

Return to Contents

 

Sys_DebugInfo

typedef struct {

      int32            TraversedPolys;  // Total Polys traversed
      int32            SentPolys;   // Total Polys sent to driver
      int32            RenderedPolys;  // Total Rendered polys reported by driver
       int32            NumModels;
      int32            NumMirrors;
     #ifdef MESHES
           int32   NumMeshes;
     #endif
      int32           NumActors;
      int32           NumDLights;
      int32           NumFog;
      int32           LMap1;    // Lmaps gone through first pass (reg light)
      int32           LMap2;    // LMaps gone through 2nd pass (fog)
} Sys_DebugInfo;

Return to Contents
 

geEngine_WorldList

typedef struct {
      geWorld*      World;
      int32              RefCount;
 } geEngine_WorldList;

Return to Contents
 

geEngine 

// System globals initialized by module it belongs to...
typedef struct geEngine {
      // System info
      Sys_DriverInfo              DriverInfo;   // Info about current driver (this should be enumed)
      Sys_CPUInfo                CPUInfo;   // Info about the Cpu
      Sys_DebugInfo              DebugInfo;
       LARGE_INTEGER     CurrentTic;
      Sys_FontInfo                 FontInfo;
      User_Info*                    UserInfo;   // Client loaded resources, etc...
      HWND                         hWnd;
      char                              AppName[200];
       // Global LUT's
      int16                              WaveTable[20];  // Global Wave table (for wavy effects, pumping, etc)
      int16                              WaveDir[20];
       // Global info that modules need to render world
      //geWorld*                     World;    // The global World
      geEngine_WorldList         WorldList[ENGINE_MAX_WORLDS];  // Current list of worlds renderable by the engine
       int32                               NumWorlds;      // Number of active worlds in world list
      geWorld*                        Worlds[ENGINE_MAX_WORLDS];  // Linear array of worlds contained in WorldList
       // Light module info
      uint8                                StyleLUT1[64][256]; // Style intensity table (StyleLUT1[Intensity][Number]);
      geBoolean                       Changed;   // == GE_TRUE if needs to be updated with Driver
      geBoolean                       DisplayFrameRateCounter; // Whether or not to display the FPS string
      char*                              DriverDirectory; // Path to load driver DLLs from
       BitmapList*                    AttachedBitmaps;
      geBoolean                       HasPixelFormat[ENGINE_PF_COUNT];
      geRDriver_PixelFormat   PixelFormats[ENGINE_PF_COUNT];
      float                                CurrentGamma;
      float                                BitmapGamma;
      geBoolean                       FogEnable;
      float                                FogR;
      float                                FogG;
      float                                FogB;
      float                                FogStart;
      float                                FogEnd;
      geEngine_FrameState     FrameState;
 } geEngine;

Return to Contents

typedef struct Mesh_MeshInfo Mesh_MeshInfo;
NOTE: The contents of this structure have been intentionally left out of the interface, by the designers of this module. Think of this as a handle only.

Return to Contents

typedef struct Mesh_MeshDef Mesh_MeshDef;
NOTE: The contents of this structure have been intentionally left out of the interface, by the designers of this module. Think of this as a handle only.

Return to Contents

typedef struct Mesh_RenderQ Mesh_RenderQ;
NOTE: The contents of this structure have been intentionally left out of the interface, by the designers of this module. Think of this as a handle only.

Return to Contents

 

Constants:

#define  MAX_SUB_DRIVERS    12
#define  MAX_DRIVER_MODES   32
#define  DRV_STR_SIZE    512
#define  DRV_MODE_STR_SIZE   512
#define MAX_CLIENT_STRING_LEN 80
#define MAX_CLIENT_STRINGS  20
 
#define ENGINE_PF_WORLD   (0)
#define ENGINE_PF_LIGHTMAP  (1)
#define ENGINE_PF_USER   (2)
#define ENGINE_PF_USER_ALPHA (3)
#define ENGINE_PF_DECAL   (4)
#define ENGINE_PF_PALETTE  (5)
#define ENGINE_PF_ALPHA_CHANNEL (6)
#define ENGINE_PF_COUNT   (7)
 
#define ENGINE_MAX_WORLDS  8
Return to Contents

Macros:

#define  VectorToSUB(a, b) (* ((( float* )&a) + b) )

Return to Contents

Functions:

GENESISAPI geBoolean geDriver_GetName(geDriver* Driver, const char** Name);

This function returns the name for the specified driver.
Returns:  GE_TRUE on success.
Return to Contents

GENESISAPI geDriver_Mode* geDriver_GetNextMode(geDriver* Driver, geDriver_Mode* Start);

This function iterates through the list of modes for the specified driver.  If* Start == NULL, it starts at the beginning of the list.
Returns: The geDriver_mode* .
 
Return to Contents

GENESISAPI geBoolean geDriver_ModeGetName(geDriver_Mode* Mode, const char** Name);

This function returns the name for the specified DriverMode.
Returns:  GE_TRUE on success.
 
Return to Contents

GENESISAPI geBoolean geDriver_ModeGetWidthHeight(geDriver_Mode* Mode, int32* Width, int32* Height);

This function returns the Width and Height for the specified DriverMode.
Returns:  GE_TRUE on success.

Return to Contents

GENESISAPI geDriver* geDriver_SystemGetNextDriver(geDriver_System* DriverSystem, geDriver* Start);

This function iterates through the list of driver for the specified DriverSystem.  If* Start == NULL, it starts at the beginning of the list.
Returns: The geDriver* .
Return to Contents

geEngine* Sys_EngineCreate(HWND hWnd, const char* AppName, const char* DriverDirectory, uint32 Version);

Return to Contents

geBoolean Sys_ShutdownDriver(geEngine* Engine);

Return to Contents

void Sys_EngineFree(geEngine* Engine);

Return to Contents

Mesh_RenderQ* Sys_WorldAddMesh(geWorld* World, Mesh_MeshDef* MeshDef, int32 Flags);
#ifdef MESHES

Return to Contents

Mesh_MeshDef* Sys_WorldCreateMesh(geWorld* World, const char* BitmapPath, const char* FileName);
#ifdef MESHES

Return to Contents

void Sys_WorldFreeMesh(geWorld* World, Mesh_MeshDef* MeshDef);
#ifdef MESHES

Return to Contents

// Misc system
geBoolean Sys_GetCPUFreq(Sys_CPUInfo* Info);

Return to Contents

geBoolean Sys_EnginePrint(geEngine* Engine, int32 x, int32 y, char* String);

Return to Contents

geBoolean Sys_EngineResetDecorators(geEngine* Engine);

Return to Contents