This commit is contained in:
Nishi 2026-01-20 14:07:56 +09:00
commit f86e26cddd
11 changed files with 69 additions and 46 deletions

View file

@ -26,6 +26,8 @@ GSClient GSClientCreate(GSEngine engine) {
client->light0[2] = 5;
client->light0[3] = 1;
client->skybox_enabled = GSFalse;
client->gl = GSGLCreate(client);
client->skybox = GSSkyBoxTry(client, "default");
@ -43,20 +45,8 @@ void GSClientDestroy(GSClient client) {
GSLog(GSLogInfo, "Destroyed client");
}
GSModel m = NULL;
GSVector3 rot = {0, 0, 0};
static void scene(GSClient client) {
if(m == NULL) m = GSModelOpen(client->engine, "game:/mdl/crate.gsm");
rot[0]++;
rot[1]++;
rot[2]++;
GSGLPushMatrix(client->gl);
GSGLSetRotation(client->gl, rot);
GSModelDraw(m);
GSGLPopMatrix(client->gl);
if(client->engine->param->render != NULL) client->engine->param->render(client->engine);
}
void GSClientStep(GSClient client) {
@ -71,17 +61,21 @@ void GSClientStep(GSClient client) {
GSGLShadowAfterMapping(client->gl);
}
if(client->skybox != NULL) GSSkyBoxDraw(client->skybox);
if(client->skybox_enabled){
if(client->skybox != NULL) GSSkyBoxDraw(client->skybox);
}
scene(client);
GSGLShadowEnd(client->gl);
client->engine->param->gl_swapbuffer();
client->look_at[0] = 5 + cos(r) * 5;
client->look_at[2] = 5 + sin(r) * 5;
client->look_at[0] = 0;
client->look_at[2] = 0;
r += 0.1;
if(client->engine->param->after_render != NULL) client->engine->param->after_render(client->engine);
}
GSGL GSClientGetGL(GSClient client){
return client->gl;
}
void GSClientToggleSkybox(GSClient client, GSBool toggle){
client->skybox_enabled = toggle;
}