From ea197a4459f3dc8ad885e5134e6358173650901f Mon Sep 17 00:00:00 2001 From: sanine-a Date: Mon, 1 Jun 2020 13:22:08 -0500 Subject: refactor: unify error handling --- include/shader.h | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'include/shader.h') diff --git a/include/shader.h b/include/shader.h index 552af5d..9a567f5 100644 --- a/include/shader.h +++ b/include/shader.h @@ -8,17 +8,6 @@ #include "common.h" -enum honey_shader_result { - SHADER_OK, - VERTEX_SHADER_NOT_FOUND, - VERTEX_SHADER_TOO_LARGE, - VERTEX_SHADER_FAILED, - FRAGMENT_SHADER_NOT_FOUND, - FRAGMENT_SHADER_TOO_LARGE, - FRAGMENT_SHADER_FAILED, - SHADER_LINK_FAILED, - N_SHADER_STATES }; - typedef int honey_shader; /** @brief Load a shader. @@ -30,9 +19,9 @@ typedef int honey_shader; * * @return The result of the shader load. */ -enum honey_shader_result honey_shader_load(honey_shader* shader, - char* vertex_shader_path, - char* fragment_shader_path); +honey_error honey_shader_load(honey_shader* shader, + char* vertex_shader_path, + char* fragment_shader_path); /** @brief Create a shader from code strings. * @@ -42,9 +31,9 @@ enum honey_shader_result honey_shader_load(honey_shader* shader, * * @return The result of the shader creation. */ -enum honey_shader_result honey_shader_new(honey_shader* shader, - char* vertex_shader_code, - char* fragment_shader_code); +honey_error honey_shader_new(honey_shader* shader, + char* vertex_shader_code, + char* fragment_shader_code); /** @brief Set an integer uniform. * -- cgit v1.2.1