summaryrefslogtreecommitdiff
path: root/demo.c
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-06-01 13:22:08 -0500
committersanine-a <sanine.not@pm.me>2020-06-01 13:22:08 -0500
commitea197a4459f3dc8ad885e5134e6358173650901f (patch)
treeca2749291fc3e60697413764615588b68834d0c4 /demo.c
parent2b6ddb0810a60b159501d60dbeaea5fd1b24daa7 (diff)
refactor: unify error handling
Diffstat (limited to 'demo.c')
-rw-r--r--demo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/demo.c b/demo.c
index 17ef747..8f5b7c9 100644
--- a/demo.c
+++ b/demo.c
@@ -155,11 +155,15 @@ int main() {
return 1;
}
- if (honey_shader_load(&cube_shader, "demo.vs", "demo.fs") != SHADER_OK) {
+ honey_error result = honey_shader_load(&cube_shader, "demo.vs", "demo.fs");
+ if (result != HONEY_OK) {
+ char error_message[3*HONEY_ERROR_DATA_STRING_LENGTH];
+ honey_human_readable_error(error_message, result);
+ fprintf(stderr, "%s\n", error_message);
return 1;
}
- if (honey_shader_load(&light_shader, "light.vs", "light.fs") != SHADER_OK) {
+ if (honey_shader_load(&light_shader, "light.vs", "light.fs") != HONEY_OK) {
return 1;
}
@@ -180,8 +184,8 @@ int main() {
vec3 camera_pos = { -4, 0, 0 };
vec3 camera_angle = { 0, 0, 0 };
float camera_near = 0.1;
- float camera_far = 100;
- float camera_fov = glm_rad(45);
+ float camera_far = 1000;
+ float camera_fov = glm_rad(100);
float camera_aspect_ratio = ((float) screen_width)/screen_height;
honey_camera_new_perspective(&camera,
camera_pos,