mtl support

This commit is contained in:
Nishi 2026-01-18 23:42:29 +09:00
commit 76bbf980eb
Signed by: nishi
GPG key ID: 27EF69B208EB9343
9 changed files with 194 additions and 54 deletions

View file

@ -18,9 +18,12 @@ GSDECL int GSGLShaderPrepare(GSGL gl, GLuint* shader, const char* vs, const char
/* 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_common.c */
GSDECL int GSGLTextureLoadFile(GSGL gl, GLuint* texture, int* width, int* height, const char* filename);
GSDECL int GSGLTextureTry(GSGL gl, GLuint* texture, int* width, int* height, const char* prefix);
/* gl_shadow.c */
GSDECL void GSGLShadowInit(GSGL gl);
GSDECL int GSGLShadowBeforeMapping(GSGL gl);

View file

@ -50,7 +50,9 @@ typedef struct _GSGL* GSGL;
typedef struct _GSSkyBox* GSSkyBox;
typedef struct _GSModel* GSModel;
typedef struct _GSModelFace GSModelFace;
typedef struct _GSModelFace GSModelFace;
typedef struct _GSModelMaterial GSModelMaterial;
typedef struct _GSModelUseMaterial GSModelUseMaterial;
#else
typedef void* GSClient;
typedef void* GSServer;
@ -121,12 +123,24 @@ struct _GSModelFace {
GSVector2* texcoord;
};
struct _GSModelMaterial {
char* key;
GLuint value;
};
struct _GSModelUseMaterial {
int key;
char* value;
};
struct _GSModel {
GSEngine engine;
GLuint texture;
GLuint call_list;
GSModelMaterial* material;
GSModelUseMaterial* usemtl;
float* vertex;
float* texcoord;
GSModelFace* face;