teto pear
This commit is contained in:
parent
5c041e0320
commit
e02687863f
18 changed files with 3484 additions and 19 deletions
|
|
@ -17,6 +17,7 @@ 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);
|
||||
GSDECL void GSEngineUnregisterResource(GSEngine engine, const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ GSDECL GSI64 GSEndianSwapI64BE(GSI64 in);
|
|||
GSDECL GSU16 GSEndianSwapU16BE(GSU16 in);
|
||||
GSDECL GSU32 GSEndianSwapU32BE(GSU32 in);
|
||||
GSDECL GSU64 GSEndianSwapU64BE(GSU64 in);
|
||||
|
||||
GSDECL GSNumber GSEndianSwapNumberBE(GSNumber in);
|
||||
#else
|
||||
#define GSEndianSwapI16BE(in) (in)
|
||||
#define GSEndianSwapI32BE(in) (in)
|
||||
|
|
@ -30,6 +32,8 @@ GSDECL GSU64 GSEndianSwapU64BE(GSU64 in);
|
|||
#define GSEndianSwapU16BE(in) (in)
|
||||
#define GSEndianSwapU32BE(in) (in)
|
||||
#define GSEndianSwapU64BE(in) (in)
|
||||
|
||||
#define GSEndianSwapNumberBE(in) (in)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -16,5 +16,6 @@
|
|||
#include <GearSrc/Endian.h>
|
||||
#include <GearSrc/SkyBox.h>
|
||||
#include <GearSrc/CRC.h>
|
||||
#include <GearSrc/Model.h>
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -31,16 +31,22 @@ 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, GSVector3 norm);
|
||||
GSDECL void GSGLPolygon2D(GSGL gl, int pairs, GSVector2* vert, GSVector2* tex);
|
||||
GSDECL void GSGLBegin2D(GSGL gl);
|
||||
GSDECL void GSGLEnd2D(GSGL gl);
|
||||
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, GSVector3 norm);
|
||||
GSDECL void GSGLPolygon2D(GSGL gl, int pairs, GSVector2* vert, GSVector2* tex);
|
||||
GSDECL void GSGLBegin2D(GSGL gl);
|
||||
GSDECL void GSGLEnd2D(GSGL gl);
|
||||
GSDECL void GSGLSetPosition(GSGL gl, GSVector3 pos, GSVector3 rot);
|
||||
GSDECL void GSGLPushMatrix(GSGL gl);
|
||||
GSDECL void GSGLPopMatrix(GSGL gl);
|
||||
GSDECL GLuint GSGLBeginList(GSGL gl);
|
||||
GSDECL void GSGLEndList(GSGL gl);
|
||||
GSDECL void GSGLCallList(GSGL gl, GLuint list);
|
||||
|
||||
/* gl_camera.c */
|
||||
GSDECL void GSGLCameraPerspective(GSGL gl, GSNumber width, GSNumber height);
|
||||
|
|
|
|||
19
engine/include/GearSrc/Model.h
Normal file
19
engine/include/GearSrc/Model.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __GEARSRC_MODEL_H__
|
||||
#define __GEARSRC_MODEL_H__
|
||||
|
||||
#include <GearSrc/MachDep.h>
|
||||
#include <GearSrc/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
GSDECL GSModel GSModelOpen(GSEngine engine, const char* path);
|
||||
GSDECL void GSModelDraw(GSModel model, GSVector3 pos, GSVector3 rot);
|
||||
GSDECL void GSModelClose(GSModel model);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -48,6 +48,9 @@ typedef struct _GSFile* GSFile;
|
|||
typedef struct _GSResource* GSResource;
|
||||
typedef struct _GSGL* GSGL;
|
||||
typedef struct _GSSkyBox* GSSkyBox;
|
||||
typedef struct _GSModel* GSModel;
|
||||
|
||||
typedef struct _GSModelFace GSModelFace;
|
||||
#else
|
||||
typedef void* GSClient;
|
||||
typedef void* GSServer;
|
||||
|
|
@ -56,6 +59,7 @@ typedef void* GSFile;
|
|||
typedef void* GSResource;
|
||||
typedef void* GSGL;
|
||||
typedef void* GSSkyBox;
|
||||
typedef void* GSModel;
|
||||
#endif
|
||||
typedef float GSNumber;
|
||||
typedef GSNumber GSVector2[2];
|
||||
|
|
@ -110,6 +114,24 @@ struct _GSSkyBox {
|
|||
GLuint down;
|
||||
};
|
||||
|
||||
struct _GSModelFace {
|
||||
int count;
|
||||
GSVector3 normal;
|
||||
GSVector3* vertex;
|
||||
GSVector2* texcoord;
|
||||
};
|
||||
|
||||
struct _GSModel {
|
||||
GSEngine engine;
|
||||
|
||||
GLuint texture;
|
||||
GLuint call_list;
|
||||
|
||||
float* vertex;
|
||||
float* texcoord;
|
||||
GSModelFace* face;
|
||||
};
|
||||
|
||||
struct _GSServer {
|
||||
GSEngine engine;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue