| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef __TR_PUBLIC_H |
| 23 |
#define __TR_PUBLIC_H |
| 24 |
|
| 25 |
#include "tr_types.h" |
| 26 |
|
| 27 |
#define REF_API_VERSION 8 |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
typedef struct { |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
void (*Shutdown)( qboolean destroyWindow ); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
void (*BeginRegistration)( glconfig_t *config ); |
| 48 |
qhandle_t (*RegisterModel)( const char *name ); |
| 49 |
qhandle_t (*RegisterSkin)( const char *name ); |
| 50 |
qhandle_t (*RegisterShader)( const char *name ); |
| 51 |
qhandle_t (*RegisterShaderNoMip)( const char *name ); |
| 52 |
void (*LoadWorld)( const char *name ); |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
void (*SetWorldVisData)( const byte *vis ); |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
void (*EndRegistration)( void ); |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
void (*ClearScene)( void ); |
| 65 |
void (*AddRefEntityToScene)( const refEntity_t *re ); |
| 66 |
void (*AddPolyToScene)( qhandle_t hShader , int numVerts, const polyVert_t *verts, int num ); |
| 67 |
int (*LightForPoint)( vec3_t point, vec3_t ambientLight, vec3_t directedLight, vec3_t lightDir ); |
| 68 |
void (*AddLightToScene)( const vec3_t org, float intensity, float r, float g, float b ); |
| 69 |
void (*AddAdditiveLightToScene)( const vec3_t org, float intensity, float r, float g, float b ); |
| 70 |
void (*RenderScene)( const refdef_t *fd ); |
| 71 |
|
| 72 |
void (*SetColor)( const float *rgba ); |
| 73 |
void (*DrawStretchPic) ( float x, float y, float w, float h, |
| 74 |
float s1, float t1, float s2, float t2, qhandle_t hShader ); |
| 75 |
|
| 76 |
|
| 77 |
void (*DrawStretchRaw) (int x, int y, int w, int h, int cols, int rows, const byte *data, int client, qboolean dirty); |
| 78 |
void (*UploadCinematic) (int w, int h, int cols, int rows, const byte *data, int client, qboolean dirty); |
| 79 |
|
| 80 |
void (*BeginFrame)( stereoFrame_t stereoFrame ); |
| 81 |
|
| 82 |
|
| 83 |
void (*EndFrame)( int *frontEndMsec, int *backEndMsec ); |
| 84 |
|
| 85 |
|
| 86 |
int (*MarkFragments)( int numPoints, const vec3_t *points, const vec3_t projection, |
| 87 |
int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer ); |
| 88 |
|
| 89 |
int (*LerpTag)( orientation_t *tag, qhandle_t model, int startFrame, int endFrame, |
| 90 |
float frac, const char *tagName ); |
| 91 |
void (*ModelBounds)( qhandle_t model, vec3_t mins, vec3_t maxs ); |
| 92 |
|
| 93 |
#ifdef __USEA3D |
| 94 |
void (*A3D_RenderGeometry) (void *pVoidA3D, void *pVoidGeom, void *pVoidMat, void *pVoidGeomStatus); |
| 95 |
#endif |
| 96 |
void (*RegisterFont)(const char *fontName, int pointSize, fontInfo_t *font); |
| 97 |
void (*RemapShader)(const char *oldShader, const char *newShader, const char *offsetTime); |
| 98 |
qboolean (*GetEntityToken)( char *buffer, int size ); |
| 99 |
qboolean (*inPVS)( const vec3_t p1, const vec3_t p2 ); |
| 100 |
|
| 101 |
void (*TakeVideoFrame)( int h, int w, byte* captureBuffer, byte *encodeBuffer, qboolean motionJpeg ); |
| 102 |
} refexport_t; |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
typedef struct { |
| 108 |
|
| 109 |
void (QDECL *Printf)( int printLevel, const char *fmt, ...) Q_PRINTF_FUNC(2, 3); |
| 110 |
|
| 111 |
|
| 112 |
void (QDECL *Error)( int errorLevel, const char *fmt, ...) Q_NO_RETURN Q_PRINTF_FUNC(2, 3); |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
int (*Milliseconds)( void ); |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
#ifdef HUNK_DEBUG |
| 121 |
void *(*Hunk_AllocDebug)( int size, ha_pref pref, char *label, char *file, int line ); |
| 122 |
#else |
| 123 |
void *(*Hunk_Alloc)( int size, ha_pref pref ); |
| 124 |
#endif |
| 125 |
void *(*Hunk_AllocateTempMemory)( int size ); |
| 126 |
void (*Hunk_FreeTempMemory)( void *block ); |
| 127 |
|
| 128 |
|
| 129 |
void *(*Malloc)( int bytes ); |
| 130 |
void (*Free)( void *buf ); |
| 131 |
|
| 132 |
cvar_t *(*Cvar_Get)( const char *name, const char *value, int flags ); |
| 133 |
void (*Cvar_Set)( const char *name, const char *value ); |
| 134 |
void (*Cvar_SetValue) (const char *name, float value); |
| 135 |
void (*Cvar_CheckRange)( cvar_t *cv, float minVal, float maxVal, qboolean shouldBeIntegral ); |
| 136 |
void (*Cvar_SetDescription)( cvar_t *cv, const char *description ); |
| 137 |
|
| 138 |
int (*Cvar_VariableIntegerValue) (const char *var_name); |
| 139 |
|
| 140 |
void (*Cmd_AddCommand)( const char *name, void(*cmd)(void) ); |
| 141 |
void (*Cmd_RemoveCommand)( const char *name ); |
| 142 |
|
| 143 |
int (*Cmd_Argc) (void); |
| 144 |
char *(*Cmd_Argv) (int i); |
| 145 |
|
| 146 |
void (*Cmd_ExecuteText) (int exec_when, const char *text); |
| 147 |
|
| 148 |
byte *(*CM_ClusterPVS)(int cluster); |
| 149 |
|
| 150 |
|
| 151 |
void (*CM_DrawDebugSurface)( void (*drawPoly)(int color, int numPoints, float *points) ); |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
int (*FS_FileIsInPAK)( const char *name, int *pCheckSum ); |
| 156 |
long (*FS_ReadFile)( const char *name, void **buf ); |
| 157 |
void (*FS_FreeFile)( void *buf ); |
| 158 |
char ** (*FS_ListFiles)( const char *name, const char *extension, int *numfilesfound ); |
| 159 |
void (*FS_FreeFileList)( char **filelist ); |
| 160 |
void (*FS_WriteFile)( const char *qpath, const void *buffer, int size ); |
| 161 |
qboolean (*FS_FileExists)( const char *file ); |
| 162 |
|
| 163 |
|
| 164 |
void (*CIN_UploadCinematic)(int handle); |
| 165 |
int (*CIN_PlayCinematic)( const char *arg0, int xpos, int ypos, int width, int height, int bits); |
| 166 |
e_status (*CIN_RunCinematic) (int handle); |
| 167 |
|
| 168 |
void (*CL_WriteAVIVideoFrame)( const byte *buffer, int size ); |
| 169 |
|
| 170 |
|
| 171 |
void (*IN_Init)( void *windowData ); |
| 172 |
void (*IN_Shutdown)( void ); |
| 173 |
void (*IN_Restart)( void ); |
| 174 |
|
| 175 |
|
| 176 |
long (*ftol)(float f); |
| 177 |
|
| 178 |
|
| 179 |
void (*Sys_SetEnv)( const char *name, const char *value ); |
| 180 |
void (*Sys_GLimpSafeInit)( void ); |
| 181 |
void (*Sys_GLimpInit)( void ); |
| 182 |
qboolean (*Sys_LowPhysicalMemory)( void ); |
| 183 |
} refimport_t; |
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
#ifdef USE_RENDERER_DLOPEN |
| 190 |
typedef refexport_t* (QDECL *GetRefAPI_t) (int apiVersion, refimport_t * rimp); |
| 191 |
#else |
| 192 |
refexport_t*GetRefAPI( int apiVersion, refimport_t *rimp ); |
| 193 |
#endif |
| 194 |
|
| 195 |
#endif |