diff --git a/src/display/camera.c b/src/display/camera.c index cf5a5f5..3a665d0 100644 --- a/src/display/camera.c +++ b/src/display/camera.c @@ -16,7 +16,7 @@ void cameraInit(camera_t *camera) { camera->projType = CAMERA_PROJECTION_TYPE_PERSPECTIVE; camera->perspective.fov = glm_rad(45.0f); camera->nearClip = 0.1f; - camera->farClip = 1000.0f; + camera->farClip = 100.0f; camera->viewType = CAMERA_VIEW_TYPE_LOOKAT; glm_vec3_copy((vec3){ 5.0f, 5.0f, 5.0f }, camera->lookat.position); diff --git a/src/display/display.c b/src/display/display.c index ceea8b3..96b0222 100644 --- a/src/display/display.c +++ b/src/display/display.c @@ -79,14 +79,31 @@ errorret_t displayUpdate(void) { SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { - case SDL_QUIT: + case SDL_QUIT: { consoleExec("quit"); break; + } - default: + case SDL_WINDOWEVENT: { + switch(event.window.event) { + case SDL_WINDOWEVENT_CLOSE: { + consoleExec("quit"); + break; + } + + default: { + break; + } + } + } + + default: { break; + } } } + + SDL_GL_MakeCurrent(DISPLAY.window, DISPLAY.glContext); #endif spriteBatchClear(); diff --git a/src/display/mesh/quad.h b/src/display/mesh/quad.h index 1ee1712..b98c82e 100644 --- a/src/display/mesh/quad.h +++ b/src/display/mesh/quad.h @@ -28,10 +28,7 @@ void quadInit(); * @param minY The minimum Y coordinate of the quad. * @param maxX The maximum X coordinate of the quad. * @param maxY The maximum Y coordinate of the quad. - * @param r The red color component (0-255). - * @param g The green color component (0-255). - * @param b The blue color component (0-255). - * @param a The alpha color component (0-255). + * @param color The color of the quad. * @param u0 The U texture coordinate for the first vertex. * @param v0 The V texture coordinate for the first vertex. * @param u1 The U texture coordinate for the second vertex. diff --git a/src/display/scene/overworld/sceneoverworld.c b/src/display/scene/overworld/sceneoverworld.c index 732235a..1f746d8 100644 --- a/src/display/scene/overworld/sceneoverworld.c +++ b/src/display/scene/overworld/sceneoverworld.c @@ -24,6 +24,7 @@ errorret_t sceneOverworldInit(void) { cameraInit(&SCENE_OVERWORLD.camera); glm_vec3_copy((vec3){ 0.0f, 1.0f, 0.0f }, SCENE_OVERWORLD.camera.lookat.up); SCENE_OVERWORLD.camera.perspective.fov = 45; + SCENE_OVERWORLD.camera.farClip = 10000.0f; scene_t *scene = &SCENE_MANAGER_SCENES[SCENE_TYPE_OVERWORLD]; scene->flags |= SCENE_FLAG_ACTIVE | SCENE_FLAG_VISIBLE;