Gave up on editor

This commit is contained in:
2025-09-15 09:53:34 -05:00
parent cafeda4368
commit 07ab2b4b02
4 changed files with 22 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ void cameraInit(camera_t *camera) {
camera->projType = CAMERA_PROJECTION_TYPE_PERSPECTIVE; camera->projType = CAMERA_PROJECTION_TYPE_PERSPECTIVE;
camera->perspective.fov = glm_rad(45.0f); camera->perspective.fov = glm_rad(45.0f);
camera->nearClip = 0.1f; camera->nearClip = 0.1f;
camera->farClip = 1000.0f; camera->farClip = 100.0f;
camera->viewType = CAMERA_VIEW_TYPE_LOOKAT; camera->viewType = CAMERA_VIEW_TYPE_LOOKAT;
glm_vec3_copy((vec3){ 5.0f, 5.0f, 5.0f }, camera->lookat.position); glm_vec3_copy((vec3){ 5.0f, 5.0f, 5.0f }, camera->lookat.position);

View File

@@ -79,14 +79,31 @@ errorret_t displayUpdate(void) {
SDL_Event event; SDL_Event event;
while(SDL_PollEvent(&event)) { while(SDL_PollEvent(&event)) {
switch(event.type) { switch(event.type) {
case SDL_QUIT: case SDL_QUIT: {
consoleExec("quit"); consoleExec("quit");
break; break;
}
default: case SDL_WINDOWEVENT: {
switch(event.window.event) {
case SDL_WINDOWEVENT_CLOSE: {
consoleExec("quit");
break;
}
default: {
break;
}
}
}
default: {
break; break;
}
} }
} }
SDL_GL_MakeCurrent(DISPLAY.window, DISPLAY.glContext);
#endif #endif
spriteBatchClear(); spriteBatchClear();

View File

@@ -28,10 +28,7 @@ void quadInit();
* @param minY The minimum Y coordinate of the quad. * @param minY The minimum Y coordinate of the quad.
* @param maxX The maximum X coordinate of the quad. * @param maxX The maximum X coordinate of the quad.
* @param maxY The maximum Y coordinate of the quad. * @param maxY The maximum Y coordinate of the quad.
* @param r The red color component (0-255). * @param color The color of the quad.
* @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 u0 The U texture coordinate for the first vertex. * @param u0 The U texture coordinate for the first vertex.
* @param v0 The V 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. * @param u1 The U texture coordinate for the second vertex.

View File

@@ -24,6 +24,7 @@ errorret_t sceneOverworldInit(void) {
cameraInit(&SCENE_OVERWORLD.camera); cameraInit(&SCENE_OVERWORLD.camera);
glm_vec3_copy((vec3){ 0.0f, 1.0f, 0.0f }, SCENE_OVERWORLD.camera.lookat.up); glm_vec3_copy((vec3){ 0.0f, 1.0f, 0.0f }, SCENE_OVERWORLD.camera.lookat.up);
SCENE_OVERWORLD.camera.perspective.fov = 45; SCENE_OVERWORLD.camera.perspective.fov = 45;
SCENE_OVERWORLD.camera.farClip = 10000.0f;
scene_t *scene = &SCENE_MANAGER_SCENES[SCENE_TYPE_OVERWORLD]; scene_t *scene = &SCENE_MANAGER_SCENES[SCENE_TYPE_OVERWORLD];
scene->flags |= SCENE_FLAG_ACTIVE | SCENE_FLAG_VISIBLE; scene->flags |= SCENE_FLAG_ACTIVE | SCENE_FLAG_VISIBLE;