📄 genesis.h
字号:
// geDriver
GENESISAPI geDriver *geDriver_SystemGetNextDriver(geDriver_System *DriverSystem, geDriver *Start);
GENESISAPI geDriver_Mode *geDriver_GetNextMode(geDriver *Driver, geDriver_Mode *Start);
GENESISAPI geBoolean geDriver_GetName(geDriver *Driver, const char **Name);
GENESISAPI geBoolean geDriver_ModeGetName(geDriver_Mode *Mode, const char **Name);
GENESISAPI geBoolean geDriver_ModeGetWidthHeight(geDriver_Mode *Mode, int32 *Width, int32 *Height);
//================================================================================
// Sound Management functions
//================================================================================
#ifdef _INC_WINDOWS
// Windows.h must be included before genesis.h for this api to be exposed.
GENESISAPI geSound_System *geSound_CreateSoundSystem(HWND hWnd);
#endif
GENESISAPI void geSound_DestroySoundSystem(geSound_System *Sound);
GENESISAPI geSound_Def *geSound_LoadSoundDef(geSound_System *SoundS, geVFile *File);
GENESISAPI void geSound_FreeSoundDef(geSound_System *SoundS, geSound_Def *SoundDef);
GENESISAPI geSound *geSound_PlaySoundDef(geSound_System *SoundS,
geSound_Def *SoundDef,
geFloat Volume,
geFloat Pan,
geFloat Frequency,
geBoolean Loop);
GENESISAPI geBoolean geSound_StopSound(geSound_System *SoundS, geSound *Sound);
GENESISAPI geBoolean geSound_ModifySound(geSound_System *SoundS,
geSound *Sound,
geFloat Volume,
geFloat Pan,
geFloat Frequency);
GENESISAPI geBoolean geSound_SoundIsPlaying(geSound_System *SoundS, geSound *Sound);
GENESISAPI geBoolean geSound_SetMasterVolume( geSound_System *SoundS, geFloat Volume );
GENESISAPI void geSound3D_GetConfig(
const geWorld *World,
const geXForm3d *CameraTransform,
const geVec3d *SoundPos,
geFloat Min,
geFloat Ds,
geFloat *Volume,
geFloat *Pan,
geFloat *Frequency);
//================================================================================
// Path Support
//================================================================================
#include "Path.h"
//================================================================================
// Motion Support
//================================================================================
#include "Motion.h"
//================================================================================
// Actor Support
//================================================================================
#include "Actor.h"
//================================================================================
// World Management functions
//================================================================================
GENESISAPI geWorld *geWorld_Create(geVFile *File);
GENESISAPI void geWorld_Free(geWorld *World);
// World Actors
GENESISAPI geBoolean geWorld_RemoveActor (geWorld *World, geActor *Actor);
GENESISAPI geBoolean geWorld_AddActor (geWorld *World, geActor *Actor, uint32 Flags, uint32 UserFlags);
GENESISAPI geBoolean geWorld_SetActorFlags (geWorld *World, geActor *Actor, uint32 Flags);
// World Bitmaps
GENESISAPI geBoolean geWorld_AddBitmap( geWorld *World, geBitmap *Bitmap);
GENESISAPI geBoolean geWorld_RemoveBitmap( geWorld *World, geBitmap *Bitmap);
GENESISAPI geBoolean geWorld_HasBitmap(const geWorld *World, const geBitmap *Bitmap);
GENESISAPI geBitmap *geWorld_GetBitmapByName(geWorld *World, const char *BitmapName);
GENESISAPI geBoolean geWorld_BitmapIsVisible(geWorld *World, const geBitmap *Bitmap);
// World BModels
GENESISAPI geWorld_Model *geWorld_GetNextModel(geWorld *World, geWorld_Model *Start);
GENESISAPI geBoolean geWorld_SetModelXForm(geWorld *World, geWorld_Model *Model, const geXForm3d *XForm);
GENESISAPI geBoolean geWorld_GetModelXForm(const geWorld *World, const geWorld_Model *Model, geXForm3d *XForm);
GENESISAPI geBoolean geWorld_OpenModel(geWorld *World, geWorld_Model *Model, geBoolean Open);
GENESISAPI geBoolean geWorld_GetModelRotationalCenter(const geWorld *World, const geWorld_Model *Model, geVec3d *Center);
GENESISAPI geBoolean geWorld_ModelGetBBox(const geWorld *World, const geWorld_Model *Model, geVec3d *Mins, geVec3d *Maxs);
GENESISAPI geMotion * geWorld_ModelGetMotion(geWorld_Model *Model);
GENESISAPI void *geWorld_ModelGetUserData(const geWorld_Model *Model);
GENESISAPI void geWorld_ModelSetUserData(geWorld_Model *Model, void *UserData);
GENESISAPI void geWorld_ModelSetFlags(geWorld_Model *Model, uint32 ModelFlags);
GENESISAPI uint32 geWorld_ModelGetFlags(geWorld_Model *Model);
// World Lights
GENESISAPI geLight *geWorld_AddLight(geWorld *World);
GENESISAPI void geWorld_RemoveLight(geWorld *World, geLight *Light);
GENESISAPI geBoolean geWorld_SetLightAttributes( geWorld *World,
geLight *Light,
const geVec3d *Pos,
const GE_RGBA *RGBA,
float Radius,
geBoolean CastShadow);
GENESISAPI geBoolean geWorld_SetLTypeTable(geWorld *World, int32 LType, const char *Table);
// World fog
GENESISAPI geFog *geWorld_AddFog(geWorld *World);
GENESISAPI geBoolean geWorld_RemoveFog(geWorld *World, geFog *Fog);
GENESISAPI geBoolean geFog_SetAttributes( geFog *Fog,
const geVec3d *Pos,
GE_RGBA *Color,
float LightBrightness,
float VolumeBrightness,
float VolumeRadius);
// World Classes/Entities
GENESISAPI geEntity_EntitySet *geWorld_GetEntitySet(geWorld *World, const char *ClassName);
GENESISAPI geEntity *geEntity_EntitySetGetNextEntity(geEntity_EntitySet *EntitySet, geEntity *Entity);
GENESISAPI void *geEntity_GetUserData(geEntity *Entity);
GENESISAPI void geEntity_GetName(const geEntity *Entity, char *Buff, int MaxLen);
// World collision
GENESISAPI geBoolean geWorld_ModelCollision( geWorld *World,
geWorld_Model *Model,
const geXForm3d *DXForm,
GE_Collision *Collision);
GENESISAPI geBoolean geWorld_TestModelMove( geWorld *World,
geWorld_Model *Model,
const geXForm3d *DXForm,
const geVec3d *Mins, const geVec3d *Maxs,
const geVec3d *In, geVec3d *Out);
GENESISAPI geBoolean geWorld_Collision( geWorld *World, // World to collide with
const geVec3d *Mins, // Mins of object (in object-space). This CAN be NULL
const geVec3d *Maxs, // Maxs of object (in object-space). This CAN be NULL
const geVec3d *Front, // Front of line (in world-space)
const geVec3d *Back, // Back of line (in world-space)
uint32 Contents, // Contents to collide with (use GE_CONTENTS_SOLID_CLIP for default)
uint32 CollideFlags, // To mask out certain object types (GE_COLLIDE_ALL, etc...)
uint32 UserFlags, // To mask out actors (refer to geActor_SetUserFlags)
GE_CollisionCB *CollisionCB, // A callback to allow user to reject collisions with certain objects)
void *Context, // User data passed through above callback
GE_Collision *Col); // Structure filled with info about what was collided with
// NOTE - Mins/Maxs CAN be NULL. If you are just testing a point, then use NULL (it's faster!!!).
GENESISAPI geBoolean geWorld_GetContents(geWorld *World, const geVec3d *Pos, const geVec3d *Mins, const geVec3d *Maxs, uint32 Flags, uint32 UserFlags, GE_CollisionCB *CollisionCB, void *Context, GE_Contents *Contents);
// World Polys
GENESISAPI gePoly *geWorld_AddPolyOnce(geWorld *World,
GE_LVertex *Verts,
int32 NumVerts,
geBitmap *Bitmap,
gePoly_Type Type,
uint32 RenderFlags,
float Scale);
GENESISAPI gePoly *geWorld_AddPoly(geWorld *World,
GE_LVertex *Verts,
int32 NumVerts,
geBitmap *Bitmap,
gePoly_Type Type,
uint32 RenderFlags,
float Scale);
GENESISAPI void geWorld_RemovePoly(geWorld *World, gePoly *Poly);
GENESISAPI geBoolean gePoly_GetLVertex(gePoly *Poly, int32 Index, GE_LVertex *LVert);
GENESISAPI geBoolean gePoly_SetLVertex(gePoly *Poly, int32 Index, const GE_LVertex *LVert);
// World visibility
GENESISAPI geBoolean geWorld_GetLeaf(const geWorld *World, const geVec3d *Pos, int32 *Leaf);
GENESISAPI geBoolean geWorld_MightSeeLeaf(const geWorld *World, int32 Leaf);
GENESISAPI geBoolean geWorld_LeafMightSeeLeaf(const geWorld *World, int32 Leaf1, int32 Leaf2, uint32 VisFlags);
// Checks to see if Leaf1 can see Leaf2
// Currently VisFlags is not used yet. It could be used for checking against areas, etc...
// Eventually you could also pass in a VisObject, that is manipulated with a camera...
GENESISAPI geBoolean GENESISCC geWorld_IsActorPotentiallyVisible(const geWorld *World, const geActor *Actor, const geCamera *Camera);
//================================================================================
// Camera Management functions
//================================================================================
GENESISAPI geCamera *GENESISCC geCamera_Create(geFloat Fov, const geRect *Rect);
GENESISAPI void GENESISCC geCamera_Destroy(geCamera **pCamera);
GENESISAPI void GENESISCC geCamera_SetZScale(geCamera *Camera, geFloat ZScale);
GENESISAPI geFloat GENESISCC geCamera_GetZScale(const geCamera *Camera);
GENESISAPI void GENESISCC geCamera_SetAttributes(geCamera *Camera,geFloat Fov, const geRect *Rect);
GENESISAPI void GENESISCC geCamera_GetClippingRect(const geCamera *Camera, geRect *Rect);
GENESISAPI void GENESISCC geCamera_ScreenPointToWorld(const geCamera *Camera,
int32 ScreenX,
int32 ScreenY,
geVec3d *Vector );
GENESISAPI void GENESISCC geCamera_Project(const geCamera *Camera,
const geVec3d *PointInCameraSpace,
geVec3d *ProjectedPoint);
GENESISAPI void GENESISCC geCamera_Transform(const geCamera *Camera,
const geVec3d *WorldSpacePoint,
geVec3d *CameraSpacePoint);
GENESISAPI void GENESISCC geCamera_TransformArray(const geCamera *Camera,
const geVec3d *WorldSpacePointPtr,
geVec3d *CameraSpacePointPtr,
int count);
GENESISAPI void GENESISCC geCamera_TransformAndProject(const geCamera *Camera,
const geVec3d *Point,
geVec3d *ProjectedPoint);
GENESISAPI void GENESISCC geCamera_TransformAndProjectArray(const geCamera *Camera,
const geVec3d *WorldSpacePointPtr,
geVec3d *ProjectedSpacePointPtr,
int count);
GENESISAPI void GENESISCC geCamera_TransformAndProjectL(const geCamera *Camera,
const GE_LVertex *Point,
GE_TLVertex *ProjectedPoint);
GENESISAPI void GENESISCC geCamera_TransformAndProjectLArray(const geCamera *Camera,
const GE_LVertex *WorldSpacePointPtr,
GE_TLVertex *ProjectedSpacePointPtr,
int count);
GENESISAPI geBoolean GENESISCC geCamera_SetWorldSpaceXForm(geCamera *Camera, const geXForm3d *XForm);
GENESISAPI geBoolean GENESISCC geCamera_SetWorldSpaceVisXForm(geCamera *Camera, const geXForm3d *XForm);
GENESISAPI const geXForm3d *GENESISCC geCamera_GetWorldSpaceXForm( const geCamera *Camera);
GENESISAPI const geXForm3d * GENESISCC geCamera_GetWorldSpaceVisXForm( const geCamera *Camera);
GENESISAPI geBoolean GENESISCC geCamera_ConvertWorldSpaceToCameraSpace(const geXForm3d *WXForm, geXForm3d *CXForm);
//================================================================================
// NetPlay Management functions
//================================================================================
typedef uint32 geCSNetMgr_NetID;
// Types for messages received from GE_ReceiveSystemMessage
typedef enum
{
NET_MSG_USER, // User message
NET_MSG_CREATE_CLIENT, // A new client has joined in
NET_MSG_DESTROY_CLIENT, // An existing client has left
NET_MSG_HOST // We are the server now
} geCSNetMgr_NetMsgType;
typedef struct
{
char Name[32];
geCSNetMgr_NetID Id;
} geCSNetMgr_NetClient;
#ifdef _INC_WINDOWS
// Windows.h must be included before genesis.h for this api to be exposed.
typedef struct geCSNetMgr_NetSession
{
char SessionName[200]; // Description of Service provider
GUID Guid; // Service Provider GUID
} geCSNetMgr_NetSession;
GENESISAPI geBoolean GENESISCC geCSNetMgr_FindSession(geCSNetMgr *M, const char *IPAdress, geCSNetMgr_NetSession **SessionList, int32 *SessionNum );
GENESISAPI geBoolean GENESISCC geCSNetMgr_JoinSession(geCSNetMgr *M, const char *Name, const geCSNetMgr_NetSession* Session);
#endif
GENESISAPI geCSNetMgr * GENESISCC geCSNetMgr_Create(void);
GENESISAPI void GENESISCC geCSNetMgr_Destroy(geCSNetMgr **ppM);
GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveFromServer(geCSNetMgr *M, uint32 *Type, int32 *Size, uint8 **Data);
GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveFromClient(geCSNetMgr *M, geCSNetMgr_NetMsgType *Type, geCSNetMgr_NetID *IdClient, int32 *Size, uint8 **Data);
GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveSystemMessage(geCSNetMgr *M, geCSNetMgr_NetID IdFor, geCSNetMgr_NetMsgType *Type, geCSNetMgr_NetClient *Client);
GENESISAPI geBoolean GENESISCC geCSNetMgr_ReceiveAllMessages(geCSNetMgr *M, geCSNetMgr_NetID *IdFrom, geCSNetMgr_NetID *IdTo, geCSNetMgr_NetMsgType *Type, int32 *Size, uint8 **Data);
GENESISAPI geCSNetMgr_NetID GENESISCC geCSNetMgr_GetServerID(geCSNetMgr *M);
GENESISAPI geCSNetMgr_NetID GENESISCC geCSNetMgr_GetOurID(geCSNetMgr *M);
GENESISAPI geCSNetMgr_NetID GENESISCC geCSNetMgr_GetAllPlayerID(geCSNetMgr *M);
GENESISAPI geBoolean GENESISCC geCSNetMgr_WeAreTheServer(geCSNetMgr *M);
GENESISAPI geBoolean GENESISCC geCSNetMgr_StartSession(geCSNetMgr *M, const char *SessionName, const char *PlayerName );
GENESISAPI geBoolean GENESISCC geCSNetMgr_StopSession(geCSNetMgr *M);
GENESISAPI geBoolean GENESISCC geCSNetMgr_SendToServer(geCSNetMgr *M, geBoolean Guaranteed, uint8 *Data, int32 DataSize);
GENESISAPI geBoolean GENESISCC geCSNetMgr_SendToClient(geCSNetMgr *M, geCSNetMgr_NetID To, geBoolean Guaranteed, uint8 *Data, int32 DataSize);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -