add gb_makepak
This commit is contained in:
parent
7ab8233fca
commit
b66cf8068a
16 changed files with 349 additions and 5 deletions
19
engine/include/GearBox/File.h
Normal file
19
engine/include/GearBox/File.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#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 GBFileClose(GBFile file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -11,5 +11,7 @@
|
|||
#include <GearBox/Server.h>
|
||||
#include <GearBox/Math.h>
|
||||
#include <GearBox/GL.h>
|
||||
#include <GearBox/File.h>
|
||||
#include <GearBox/Resource.h>
|
||||
|
||||
#endif
|
||||
|
|
|
|||
18
engine/include/GearBox/Resource.h
Normal file
18
engine/include/GearBox/Resource.h
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#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 GBResourceClose(GBResource resource);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
17
engine/include/GearBox/String.h
Normal file
17
engine/include/GearBox/String.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,16 +1,23 @@
|
|||
#ifndef __GEARBOX_TYPEDEFS_H__
|
||||
#define __GEARBOX_TYPEDEFS_H__
|
||||
|
||||
#include <GearBox/MachDep.h>
|
||||
|
||||
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 _GBClient* GBClient;
|
||||
typedef struct _GBServer* GBServer;
|
||||
typedef struct _GBEngine* GBEngine;
|
||||
typedef struct _GBFile* GBFile;
|
||||
typedef struct _GBResource* GBResource;
|
||||
#else
|
||||
typedef void* GBClient;
|
||||
typedef void* GBServer;
|
||||
typedef void* GBEngine;
|
||||
typedef void* GBFile;
|
||||
typedef void* GBResource;
|
||||
#endif
|
||||
|
||||
typedef void (*GBGLSwapBufferCallback)(void);
|
||||
|
|
@ -19,6 +26,11 @@ typedef void (*GBTickCallback)(void);
|
|||
typedef long (*GBGetTickCallback)(void);
|
||||
typedef void (*GBSleepCallback)(int ms);
|
||||
|
||||
struct _GBResourceKV {
|
||||
char* key;
|
||||
GBResource value;
|
||||
};
|
||||
|
||||
#ifdef _GEARBOX
|
||||
struct _GBClient {
|
||||
GBEngine engine;
|
||||
|
|
@ -32,6 +44,15 @@ struct _GBEngine {
|
|||
GBEngineParam* param;
|
||||
GBClient client;
|
||||
GBServer server;
|
||||
GBResourceKV* resource;
|
||||
};
|
||||
|
||||
struct _GBFile {
|
||||
FILE* fp;
|
||||
};
|
||||
|
||||
struct _GBResource {
|
||||
GBFile file;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue