rename
This commit is contained in:
parent
472e21e389
commit
2d6ed53abc
56 changed files with 746 additions and 746 deletions
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __GEARBOX_CLIENT_H__
|
||||
#define __GEARBOX_CLIENT_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL GBClient GBClientCreate(GBEngine engine);
|
||||
GBDECL void GBClientDestroy(GBClient client);
|
||||
GBDECL void GBClientStep(GBClient client);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef __GEARBOX_CORE_H__
|
||||
#define __GEARBOX_CORE_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL void GBInit(void);
|
||||
|
||||
GBDECL GBEngine GBEngineCreate(GBEngineParam* param);
|
||||
GBDECL void GBEngineDestroy(GBEngine engine);
|
||||
GBDECL void GBEngineParamInit(GBEngineParam* param);
|
||||
GBDECL void GBEngineLoop(GBEngine engine);
|
||||
GBDECL GBClient GBEngineGetClient(GBEngine engine);
|
||||
GBDECL GBServer GBEngineGetServer(GBEngine engine);
|
||||
GBDECL int GBEngineRegisterResource(GBEngine engine, const char* name, const char* path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
#ifndef __GEARBOX_ENDIAN_H__
|
||||
#define __GEARBOX_ENDIAN_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)
|
||||
#define GBEndianHostLittle
|
||||
#else
|
||||
#define GBEndianHostBig
|
||||
#endif
|
||||
|
||||
#ifdef GBEndianHostLittle
|
||||
GBDECL GBI16 GBEndianSwapI16BE(GBI16 in);
|
||||
GBDECL GBI32 GBEndianSwapI32BE(GBI32 in);
|
||||
GBDECL GBI64 GBEndianSwapI64BE(GBI64 in);
|
||||
|
||||
GBDECL GBU16 GBEndianSwapU16BE(GBU16 in);
|
||||
GBDECL GBU32 GBEndianSwapU32BE(GBU32 in);
|
||||
GBDECL GBU64 GBEndianSwapU64BE(GBU64 in);
|
||||
#else
|
||||
#define GBEndianSwapI16BE(in) (in)
|
||||
#define GBEndianSwapI32BE(in) (in)
|
||||
#define GBEndianSwapI64BE(in) (in)
|
||||
|
||||
#define GBEndianSwapU16BE(in) (in)
|
||||
#define GBEndianSwapU32BE(in) (in)
|
||||
#define GBEndianSwapU64BE(in) (in)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
#ifndef __GEARBOX_FILE_H__
|
||||
#define __GEARBOX_FILE_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL GBFile GBFileOpen(GBEngine engine, const char* path);
|
||||
GBDECL int GBFileRead(GBFile file, void* out, int size);
|
||||
GBDECL void GBFileSeek(GBFile file, int pos);
|
||||
GBDECL unsigned int GBFileSize(GBFile file);
|
||||
GBDECL void GBFileClose(GBFile file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __GEARBOX_FOUNDATION_H__
|
||||
#define __GEARBOX_FOUNDATION_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#include <GearBox/Core.h>
|
||||
#include <GearBox/Version.h>
|
||||
#include <GearBox/Log.h>
|
||||
#include <GearBox/Client.h>
|
||||
#include <GearBox/Server.h>
|
||||
#include <GearBox/Math.h>
|
||||
#include <GearBox/GL.h>
|
||||
#include <GearBox/File.h>
|
||||
#include <GearBox/Resource.h>
|
||||
#include <GearBox/Endian.h>
|
||||
#include <GearBox/SkyBox.h>
|
||||
|
||||
#endif
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#ifndef __GEARBOX_GL_H__
|
||||
#define __GEARBOX_GL_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#include <GearBox/GL/GL.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GBGLMaxDistance 100.0
|
||||
|
||||
/* gl_shader.c */
|
||||
GBDECL int GBGLShaderPrepare(GBGL gl, GLuint* shader, const char* vs, const char* fs);
|
||||
|
||||
/* gl_texture.c */
|
||||
GBDECL void GBGLTexturePrepare(GBGL gl, GLuint* texture, unsigned char* rgba, int width, int height);
|
||||
GBDECL void GBGLTextureSet(GBGL gl, GLuint texture);
|
||||
GBDECL int GBGLTextureLoadFile(GBGL gl, GLuint* texture, int* width, int* height, const char* filename);
|
||||
GBDECL void GBGLTextureDelete(GBGL gl, GLuint texture);
|
||||
|
||||
/* gl_shadow.c */
|
||||
GBDECL void GBGLShadowInit(GBGL gl);
|
||||
GBDECL int GBGLShadowBeforeMapping(GBGL gl);
|
||||
GBDECL void GBGLShadowAfterMapping(GBGL gl);
|
||||
GBDECL void GBGLShadowEnd(GBGL gl);
|
||||
GBDECL void GBGLShadowDeinit(GBGL gl);
|
||||
GBDECL void GBGLShadowDisable(GBGL gl);
|
||||
GBDECL void GBGLShadowEnable(GBGL gl);
|
||||
|
||||
/* gl.c */
|
||||
GBDECL GBGL GBGLCreate(GBClient client);
|
||||
GBDECL void GBGLDestroy(GBGL gl);
|
||||
GBDECL void GBGLClear(GBGL gl);
|
||||
GBDECL void GBGLIgnoreDepth(GBGL gl);
|
||||
GBDECL void GBGLCareDepth(GBGL gl);
|
||||
GBDECL void GBGLSetLight(GBGL gl);
|
||||
GBDECL void GBGLPolygon(GBGL gl, int pairs, GBVector3* vert, GBVector2* tex);
|
||||
|
||||
/* gl_camera.c */
|
||||
GBDECL void GBGLCameraPerspective(GBGL gl, GBNumber width, GBNumber height);
|
||||
GBDECL void GBGLCameraSet(GBGL gl);
|
||||
GBDECL void GBGLCameraLookAt(GBGL gl, GBVector3 camera, GBVector3 look_at);
|
||||
GBDECL void GBGLCameraSetup(GBGL gl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef __GEARBOX_LOG_H__
|
||||
#define __GEARBOX_LOG_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum GBLogLevel {
|
||||
GBLogInfo = 0,
|
||||
GBLogWarn,
|
||||
GBLogError
|
||||
};
|
||||
|
||||
GBDECL void GBLog(int level, const char* fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
#ifndef __GEARBOX_MATH_H__
|
||||
#define __GEARBOX_MATH_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GBMathPi 3.14159265358979323846
|
||||
|
||||
GBDECL void GBMathCross3(GBVector3 r, GBVector3 v0, GBVector3 v1);
|
||||
GBDECL void GBMathNormalize3(GBVector3 vec);
|
||||
GBDECL void GBMathSubtract3(GBVector3 r, GBVector3 v0, GBVector3 v1);
|
||||
GBDECL void GBMathAdd3(GBVector3 r, GBVector3 v0, GBVector3 v1);
|
||||
GBDECL void GBMathNormal3x3(GBVector3 r, GBVector3 v0, GBVector3 v1, GBVector3 v2);
|
||||
GBDECL void GBMathNormal3x4(GBVector3 r, GBVector3 v0, GBVector3 v1, GBVector3 v2, GBVector3 v3);
|
||||
GBDECL void GBMathInvert4x4(GBMatrix4x4 out, GBMatrix4x4 in);
|
||||
GBDECL GBNumber GBMathCot(GBNumber x);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __GEARBOX_RESOURCE_H__
|
||||
#define __GEARBOX_RESOURCE_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL GBResource GBResourceOpen(GBEngine engine, const char* path);
|
||||
GBDECL void* GBResourceGet(GBResource resource, const char* name, unsigned int* size);
|
||||
GBDECL void GBResourceClose(GBResource resource);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __GEARBOX_SERVER_H__
|
||||
#define __GEARBOX_SERVER_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL GBServer GBServerCreate(GBEngine engine);
|
||||
GBDECL void GBServerDestroy(GBServer server);
|
||||
GBDECL void GBServerStep(GBServer server);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef __GEARBOX_SKYBOX_H__
|
||||
#define __GEARBOX_SKYBOX_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL GBSkyBox GBSkyBoxOpen(GBClient client, const char* base);
|
||||
GBDECL void GBSkyBoxDraw(GBSkyBox skybox);
|
||||
GBDECL void GBSkyBoxClose(GBSkyBox skybox);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#ifndef __GEARBOX_STRING_H__
|
||||
#define __GEARBOX_STRING_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL char* GBStringDuplicate(const char* str);
|
||||
GBDECL char* GBStringConcat(const char* str1, const char* str2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
#ifndef __GEARBOX_TYPEDEFS_H__
|
||||
#define __GEARBOX_TYPEDEFS_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
|
||||
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
||||
typedef __int8_t GBI8;
|
||||
typedef __int16_t GBI16;
|
||||
typedef __int32_t GBI32;
|
||||
typedef __int64_t GBI64;
|
||||
|
||||
typedef unsigned __int8_t GBU8;
|
||||
typedef unsigned __int16_t GBU16;
|
||||
typedef unsigned __int32_t GBU32;
|
||||
typedef unsigned __int64_t GBU64;
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int8_t GBI8;
|
||||
typedef int16_t GBI16;
|
||||
typedef int32_t GBI32;
|
||||
typedef int64_t GBI64;
|
||||
|
||||
typedef uint8_t GBU8;
|
||||
typedef uint16_t GBU16;
|
||||
typedef uint32_t GBU32;
|
||||
typedef uint64_t GBU64;
|
||||
#else
|
||||
typedef signed char GBI8;
|
||||
typedef short GBI16;
|
||||
typedef int GBI32;
|
||||
typedef long GBI64;
|
||||
|
||||
typedef unsigned char GBU8;
|
||||
typedef unsigned short GBU16;
|
||||
typedef unsigned int GBU32;
|
||||
typedef unsigned long GBU64;
|
||||
#endif
|
||||
|
||||
typedef struct _GBVersion GBVersion;
|
||||
typedef struct _GBEngineParam GBEngineParam;
|
||||
typedef struct _GBResourceKV GBResourceKV;
|
||||
#ifdef _GEARBOX
|
||||
typedef struct _GBClient* GBClient;
|
||||
typedef struct _GBServer* GBServer;
|
||||
typedef struct _GBEngine* GBEngine;
|
||||
typedef struct _GBFile* GBFile;
|
||||
typedef struct _GBResource* GBResource;
|
||||
typedef struct _GBGL* GBGL;
|
||||
typedef struct _GBSkyBox* GBSkyBox;
|
||||
#else
|
||||
typedef void* GBClient;
|
||||
typedef void* GBServer;
|
||||
typedef void* GBEngine;
|
||||
typedef void* GBFile;
|
||||
typedef void* GBResource;
|
||||
typedef void* GBGL;
|
||||
typedef void* GBSkyBox;
|
||||
#endif
|
||||
typedef float GBNumber;
|
||||
typedef GBNumber GBVector2[2];
|
||||
typedef GBNumber GBVector3[3];
|
||||
typedef GBNumber GBVector4[4];
|
||||
typedef GBNumber GBMatrix4x4[16];
|
||||
|
||||
typedef void (*GBGLSwapBufferCallback)(void);
|
||||
typedef void (*GBReadyCallback)(int width, int height);
|
||||
typedef void (*GBTickCallback)(void);
|
||||
typedef long (*GBGetTickCallback)(void);
|
||||
typedef void (*GBSleepCallback)(int ms);
|
||||
|
||||
struct _GBResourceKV {
|
||||
char* key;
|
||||
GBResource value;
|
||||
};
|
||||
|
||||
#ifdef _GEARBOX
|
||||
#include <GearBox/GL/GL.h>
|
||||
|
||||
struct _GBGL {
|
||||
GBEngine engine;
|
||||
|
||||
int shadow_use_shader;
|
||||
GLuint shadow_texture;
|
||||
GLuint shadow_shader;
|
||||
GLdouble shadow_modelview[16];
|
||||
GLdouble shadow_projection[16];
|
||||
GLdouble shadow_old_projection[16];
|
||||
GLdouble shadow_old_modelview[16];
|
||||
};
|
||||
|
||||
struct _GBClient {
|
||||
GBEngine engine;
|
||||
|
||||
GBGL gl;
|
||||
GBVector3 look_at;
|
||||
GBVector3 camera;
|
||||
GBVector4 light0;
|
||||
GBSkyBox skybox;
|
||||
};
|
||||
|
||||
struct _GBSkyBox {
|
||||
GBEngine engine;
|
||||
|
||||
GLuint left;
|
||||
GLuint right;
|
||||
GLuint front;
|
||||
GLuint back;
|
||||
GLuint up;
|
||||
GLuint down;
|
||||
};
|
||||
|
||||
struct _GBServer {
|
||||
GBEngine engine;
|
||||
};
|
||||
|
||||
struct _GBEngine {
|
||||
GBEngineParam* param;
|
||||
GBClient client;
|
||||
GBServer server;
|
||||
GBResourceKV* resource;
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
struct _GBFile {
|
||||
FILE* fp;
|
||||
unsigned char* data;
|
||||
unsigned int size;
|
||||
unsigned int seek;
|
||||
};
|
||||
|
||||
struct _GBResource {
|
||||
GBFile file;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _GBVersion {
|
||||
char string[64];
|
||||
int majorlevel;
|
||||
int minorlevel;
|
||||
int patchlevel;
|
||||
};
|
||||
|
||||
struct _GBEngineParam {
|
||||
int client;
|
||||
int server;
|
||||
GBGLSwapBufferCallback gl_swapbuffer;
|
||||
GBReadyCallback ready;
|
||||
GBTickCallback tick;
|
||||
GBGetTickCallback get_tick;
|
||||
GBSleepCallback sleep;
|
||||
};
|
||||
|
||||
#endif
|
||||
19
engine/include/GearSrc/Client.h
Normal file
19
engine/include/GearSrc/Client.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __GEARBOX_CLIENT_H__
|
||||
#define __GEARBOX_CLIENT_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL GSClient GSClientCreate(GSEngine engine);
|
||||
GSDECL void GSClientDestroy(GSClient client);
|
||||
GSDECL void GSClientStep(GSClient client);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
25
engine/include/GearSrc/Core.h
Normal file
25
engine/include/GearSrc/Core.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef __GEARBOX_CORE_H__
|
||||
#define __GEARBOX_CORE_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL void GSInit(void);
|
||||
|
||||
GSDECL GSEngine GSEngineCreate(GSEngineParam* param);
|
||||
GSDECL void GSEngineDestroy(GSEngine engine);
|
||||
GSDECL void GSEngineParamInit(GSEngineParam* param);
|
||||
GSDECL void GSEngineLoop(GSEngine engine);
|
||||
GSDECL GSClient GSEngineGetClient(GSEngine engine);
|
||||
GSDECL GSServer GSEngineGetServer(GSEngine engine);
|
||||
GSDECL int GSEngineRegisterResource(GSEngine engine, const char* name, const char* path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
39
engine/include/GearSrc/Endian.h
Normal file
39
engine/include/GearSrc/Endian.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#ifndef __GEARBOX_ENDIAN_H__
|
||||
#define __GEARBOX_ENDIAN_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_M_IX86) || defined(__x86_64__) || defined(__i386__)
|
||||
#define GSEndianHostLittle
|
||||
#else
|
||||
#define GSEndianHostBig
|
||||
#endif
|
||||
|
||||
#ifdef GSEndianHostLittle
|
||||
GSDECL GSI16 GSEndianSwapI16BE(GSI16 in);
|
||||
GSDECL GSI32 GSEndianSwapI32BE(GSI32 in);
|
||||
GSDECL GSI64 GSEndianSwapI64BE(GSI64 in);
|
||||
|
||||
GSDECL GSU16 GSEndianSwapU16BE(GSU16 in);
|
||||
GSDECL GSU32 GSEndianSwapU32BE(GSU32 in);
|
||||
GSDECL GSU64 GSEndianSwapU64BE(GSU64 in);
|
||||
#else
|
||||
#define GSEndianSwapI16BE(in) (in)
|
||||
#define GSEndianSwapI32BE(in) (in)
|
||||
#define GSEndianSwapI64BE(in) (in)
|
||||
|
||||
#define GSEndianSwapU16BE(in) (in)
|
||||
#define GSEndianSwapU32BE(in) (in)
|
||||
#define GSEndianSwapU64BE(in) (in)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
21
engine/include/GearSrc/File.h
Normal file
21
engine/include/GearSrc/File.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef __GEARBOX_FILE_H__
|
||||
#define __GEARBOX_FILE_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL GSFile GSFileOpen(GSEngine engine, const char* path);
|
||||
GSDECL int GSFileRead(GSFile file, void* out, int size);
|
||||
GSDECL void GSFileSeek(GSFile file, int pos);
|
||||
GSDECL unsigned int GSFileSize(GSFile file);
|
||||
GSDECL void GSFileClose(GSFile file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
19
engine/include/GearSrc/Foundation.h
Normal file
19
engine/include/GearSrc/Foundation.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __GEARBOX_FOUNDATION_H__
|
||||
#define __GEARBOX_FOUNDATION_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#include <GearSrc/Core.h>
|
||||
#include <GearSrc/Version.h>
|
||||
#include <GearSrc/Log.h>
|
||||
#include <GearSrc/Client.h>
|
||||
#include <GearSrc/Server.h>
|
||||
#include <GearSrc/Math.h>
|
||||
#include <GearSrc/GL.h>
|
||||
#include <GearSrc/File.h>
|
||||
#include <GearSrc/Resource.h>
|
||||
#include <GearSrc/Endian.h>
|
||||
#include <GearSrc/SkyBox.h>
|
||||
|
||||
#endif
|
||||
52
engine/include/GearSrc/GL.h
Normal file
52
engine/include/GearSrc/GL.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#ifndef __GEARBOX_GL_H__
|
||||
#define __GEARBOX_GL_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#include <GearSrc/GL/GL.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GSGLMaxDistance 100.0
|
||||
|
||||
/* gl_shader.c */
|
||||
GSDECL int GSGLShaderPrepare(GSGL gl, GLuint* shader, const char* vs, const char* fs);
|
||||
|
||||
/* gl_texture.c */
|
||||
GSDECL void GSGLTexturePrepare(GSGL gl, GLuint* texture, unsigned char* rgba, int width, int height);
|
||||
GSDECL void GSGLTextureSet(GSGL gl, GLuint texture);
|
||||
GSDECL int GSGLTextureLoadFile(GSGL gl, GLuint* texture, int* width, int* height, const char* filename);
|
||||
GSDECL void GSGLTextureDelete(GSGL gl, GLuint texture);
|
||||
|
||||
/* gl_shadow.c */
|
||||
GSDECL void GSGLShadowInit(GSGL gl);
|
||||
GSDECL int GSGLShadowBeforeMapping(GSGL gl);
|
||||
GSDECL void GSGLShadowAfterMapping(GSGL gl);
|
||||
GSDECL void GSGLShadowEnd(GSGL gl);
|
||||
GSDECL void GSGLShadowDeinit(GSGL gl);
|
||||
GSDECL void GSGLShadowDisable(GSGL gl);
|
||||
GSDECL void GSGLShadowEnable(GSGL gl);
|
||||
|
||||
/* gl.c */
|
||||
GSDECL GSGL GSGLCreate(GSClient client);
|
||||
GSDECL void GSGLDestroy(GSGL gl);
|
||||
GSDECL void GSGLClear(GSGL gl);
|
||||
GSDECL void GSGLIgnoreDepth(GSGL gl);
|
||||
GSDECL void GSGLCareDepth(GSGL gl);
|
||||
GSDECL void GSGLSetLight(GSGL gl);
|
||||
GSDECL void GSGLPolygon(GSGL gl, int pairs, GSVector3* vert, GSVector2* tex);
|
||||
|
||||
/* gl_camera.c */
|
||||
GSDECL void GSGLCameraPerspective(GSGL gl, GSNumber width, GSNumber height);
|
||||
GSDECL void GSGLCameraSet(GSGL gl);
|
||||
GSDECL void GSGLCameraLookAt(GSGL gl, GSVector3 camera, GSVector3 look_at);
|
||||
GSDECL void GSGLCameraSetup(GSGL gl);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
23
engine/include/GearSrc/Log.h
Normal file
23
engine/include/GearSrc/Log.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef __GEARBOX_LOG_H__
|
||||
#define __GEARBOX_LOG_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum GSLogLevel {
|
||||
GSLogInfo = 0,
|
||||
GSLogWarn,
|
||||
GSLogError
|
||||
};
|
||||
|
||||
GSDECL void GSLog(int level, const char* fmt, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -12,11 +12,11 @@
|
|||
#endif
|
||||
|
||||
#if defined(_GEARBOX) && defined(_WIN32)
|
||||
#define GBDECL extern __declspec(dllexport)
|
||||
#define GSDECL extern __declspec(dllexport)
|
||||
#elif defined(_WIN32)
|
||||
#define GBDECL extern __declspec(dllimport)
|
||||
#define GSDECL extern __declspec(dllimport)
|
||||
#else
|
||||
#define GBDECL extern
|
||||
#define GSDECL extern
|
||||
#endif
|
||||
|
||||
#endif
|
||||
26
engine/include/GearSrc/Math.h
Normal file
26
engine/include/GearSrc/Math.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef __GEARBOX_MATH_H__
|
||||
#define __GEARBOX_MATH_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GSMathPi 3.14159265358979323846
|
||||
|
||||
GSDECL void GSMathCross3(GSVector3 r, GSVector3 v0, GSVector3 v1);
|
||||
GSDECL void GSMathNormalize3(GSVector3 vec);
|
||||
GSDECL void GSMathSubtract3(GSVector3 r, GSVector3 v0, GSVector3 v1);
|
||||
GSDECL void GSMathAdd3(GSVector3 r, GSVector3 v0, GSVector3 v1);
|
||||
GSDECL void GSMathNormal3x3(GSVector3 r, GSVector3 v0, GSVector3 v1, GSVector3 v2);
|
||||
GSDECL void GSMathNormal3x4(GSVector3 r, GSVector3 v0, GSVector3 v1, GSVector3 v2, GSVector3 v3);
|
||||
GSDECL void GSMathInvert4x4(GSMatrix4x4 out, GSMatrix4x4 in);
|
||||
GSDECL GSNumber GSMathCot(GSNumber x);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
19
engine/include/GearSrc/Resource.h
Normal file
19
engine/include/GearSrc/Resource.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __GEARBOX_RESOURCE_H__
|
||||
#define __GEARBOX_RESOURCE_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL GSResource GSResourceOpen(GSEngine engine, const char* path);
|
||||
GSDECL void* GSResourceGet(GSResource resource, const char* name, unsigned int* size);
|
||||
GSDECL void GSResourceClose(GSResource resource);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
19
engine/include/GearSrc/Server.h
Normal file
19
engine/include/GearSrc/Server.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __GEARBOX_SERVER_H__
|
||||
#define __GEARBOX_SERVER_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL GSServer GSServerCreate(GSEngine engine);
|
||||
GSDECL void GSServerDestroy(GSServer server);
|
||||
GSDECL void GSServerStep(GSServer server);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
19
engine/include/GearSrc/SkyBox.h
Normal file
19
engine/include/GearSrc/SkyBox.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __GEARBOX_SKYBOX_H__
|
||||
#define __GEARBOX_SKYBOX_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL GSSkyBox GSSkyBoxOpen(GSClient client, const char* base);
|
||||
GSDECL void GSSkyBoxDraw(GSSkyBox skybox);
|
||||
GSDECL void GSSkyBoxClose(GSSkyBox skybox);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
18
engine/include/GearSrc/String.h
Normal file
18
engine/include/GearSrc/String.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#ifndef __GEARBOX_STRING_H__
|
||||
#define __GEARBOX_STRING_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL char* GSStringDuplicate(const char* str);
|
||||
GSDECL char* GSStringConcat(const char* str1, const char* str2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
155
engine/include/GearSrc/TypeDefs.h
Normal file
155
engine/include/GearSrc/TypeDefs.h
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
#ifndef __GEARBOX_TYPEDEFS_H__
|
||||
#define __GEARBOX_TYPEDEFS_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
|
||||
#if defined(_MSC_VER) || defined(__WATCOMC__)
|
||||
typedef __int8_t GSI8;
|
||||
typedef __int16_t GSI16;
|
||||
typedef __int32_t GSI32;
|
||||
typedef __int64_t GSI64;
|
||||
|
||||
typedef unsigned __int8_t GSU8;
|
||||
typedef unsigned __int16_t GSU16;
|
||||
typedef unsigned __int32_t GSU32;
|
||||
typedef unsigned __int64_t GSU64;
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int8_t GSI8;
|
||||
typedef int16_t GSI16;
|
||||
typedef int32_t GSI32;
|
||||
typedef int64_t GSI64;
|
||||
|
||||
typedef uint8_t GSU8;
|
||||
typedef uint16_t GSU16;
|
||||
typedef uint32_t GSU32;
|
||||
typedef uint64_t GSU64;
|
||||
#else
|
||||
typedef signed char GSI8;
|
||||
typedef short GSI16;
|
||||
typedef int GSI32;
|
||||
typedef long GSI64;
|
||||
|
||||
typedef unsigned char GSU8;
|
||||
typedef unsigned short GSU16;
|
||||
typedef unsigned int GSU32;
|
||||
typedef unsigned long GSU64;
|
||||
#endif
|
||||
|
||||
typedef struct _GSVersion GSVersion;
|
||||
typedef struct _GSEngineParam GSEngineParam;
|
||||
typedef struct _GSResourceKV GSResourceKV;
|
||||
#ifdef _GEARBOX
|
||||
typedef struct _GSClient* GSClient;
|
||||
typedef struct _GSServer* GSServer;
|
||||
typedef struct _GSEngine* GSEngine;
|
||||
typedef struct _GSFile* GSFile;
|
||||
typedef struct _GSResource* GSResource;
|
||||
typedef struct _GSGL* GSGL;
|
||||
typedef struct _GSSkyBox* GSSkyBox;
|
||||
#else
|
||||
typedef void* GSClient;
|
||||
typedef void* GSServer;
|
||||
typedef void* GSEngine;
|
||||
typedef void* GSFile;
|
||||
typedef void* GSResource;
|
||||
typedef void* GSGL;
|
||||
typedef void* GSSkyBox;
|
||||
#endif
|
||||
typedef float GSNumber;
|
||||
typedef GSNumber GSVector2[2];
|
||||
typedef GSNumber GSVector3[3];
|
||||
typedef GSNumber GSVector4[4];
|
||||
typedef GSNumber GSMatrix4x4[16];
|
||||
|
||||
typedef void (*GSGLSwapBufferCallback)(void);
|
||||
typedef void (*GSReadyCallback)(int width, int height);
|
||||
typedef void (*GSTickCallback)(void);
|
||||
typedef long (*GSGetTickCallback)(void);
|
||||
typedef void (*GSSleepCallback)(int ms);
|
||||
|
||||
struct _GSResourceKV {
|
||||
char* key;
|
||||
GSResource value;
|
||||
};
|
||||
|
||||
#ifdef _GEARBOX
|
||||
#include <GearSrc/GL/GL.h>
|
||||
|
||||
struct _GSGL {
|
||||
GSEngine engine;
|
||||
|
||||
int shadow_use_shader;
|
||||
GLuint shadow_texture;
|
||||
GLuint shadow_shader;
|
||||
GLdouble shadow_modelview[16];
|
||||
GLdouble shadow_projection[16];
|
||||
GLdouble shadow_old_projection[16];
|
||||
GLdouble shadow_old_modelview[16];
|
||||
};
|
||||
|
||||
struct _GSClient {
|
||||
GSEngine engine;
|
||||
|
||||
GSGL gl;
|
||||
GSVector3 look_at;
|
||||
GSVector3 camera;
|
||||
GSVector4 light0;
|
||||
GSSkyBox skybox;
|
||||
};
|
||||
|
||||
struct _GSSkyBox {
|
||||
GSEngine engine;
|
||||
|
||||
GLuint left;
|
||||
GLuint right;
|
||||
GLuint front;
|
||||
GLuint back;
|
||||
GLuint up;
|
||||
GLuint down;
|
||||
};
|
||||
|
||||
struct _GSServer {
|
||||
GSEngine engine;
|
||||
};
|
||||
|
||||
struct _GSEngine {
|
||||
GSEngineParam* param;
|
||||
GSClient client;
|
||||
GSServer server;
|
||||
GSResourceKV* resource;
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
struct _GSFile {
|
||||
FILE* fp;
|
||||
unsigned char* data;
|
||||
unsigned int size;
|
||||
unsigned int seek;
|
||||
};
|
||||
|
||||
struct _GSResource {
|
||||
GSFile file;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct _GSVersion {
|
||||
char string[64];
|
||||
int majorlevel;
|
||||
int minorlevel;
|
||||
int patchlevel;
|
||||
};
|
||||
|
||||
struct _GSEngineParam {
|
||||
int client;
|
||||
int server;
|
||||
GSGLSwapBufferCallback gl_swapbuffer;
|
||||
GSReadyCallback ready;
|
||||
GSTickCallback tick;
|
||||
GSGetTickCallback get_tick;
|
||||
GSSleepCallback sleep;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
#ifndef __GEARBOX_VERSION_H__
|
||||
#define __GEARBOX_VERSION_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
#include <GearBox/TypeDefs.h>
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GBDECL void GBVersionGet(GBVersion* version);
|
||||
GSDECL void GSVersionGet(GSVersion* version);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue