GBFileOpen can open resource now

This commit is contained in:
Nishi 2026-01-10 01:40:21 +09:00
commit cc46e0fc32
Signed by: nishi
GPG key ID: 27EF69B208EB9343
8 changed files with 174 additions and 38 deletions

View file

@ -8,9 +8,11 @@
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);
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
}

View file

@ -11,7 +11,7 @@ extern "C" {
#endif
/* gl_shader.c */
GBDECL int GBGLShaderPrepare(GLuint* shader, const char* vs, const char* fs);
GBDECL int GBGLShaderPrepare(GBEngine engine, GLuint* shader, const char* vs, const char* fs);
#ifdef __cplusplus
}

View file

@ -9,6 +9,7 @@ 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

View file

@ -48,7 +48,10 @@ struct _GBEngine {
};
struct _GBFile {
FILE* fp;
FILE* fp;
unsigned char* data;
unsigned int size;
unsigned int seek;
};
struct _GBResource {