diff options
author | sanine-a <sanine.not@pm.me> | 2020-05-20 22:40:44 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-05-20 22:40:44 -0500 |
commit | c3a41085272644709d891bf04137a6c2bd901230 (patch) | |
tree | 24a6b7e82af426428741f3f9cf2976509e9769c4 /include | |
parent | c6ec37cd355b313083af5be3435162224020fe5e (diff) |
add overridable update() and draw() callbacks
Diffstat (limited to 'include')
-rw-r--r-- | include/honey.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/honey.h b/include/honey.h index 9b048c0..7ae7789 100644 --- a/include/honey.h +++ b/include/honey.h @@ -1,6 +1,7 @@ #ifndef HONEY_ENGINE_H #define HONEY_ENGINE_H +/** @file Defines the basic loading and callback functions. */ #include "common.h" #include "mesh.h" #include "shader.h" @@ -8,8 +9,24 @@ typedef GLFWwindow* honey_window; +/** @brief Initialize Honey. + * + * @param[in] screen_width The desired width of the screen in pixels + * @param[in] screen_height The desired height of the screen in pixels + * @param[in] window_title Title to use for the window. + */ honey_window honey_setup(int screen_width, int screen_height, char* window_title); +static void (*honey_update_callback)(float dt); +static void (*honey_draw_callback)(); +static float honey_draw_dt = 0.16; + +void honey_set_update_callback(void (*update_callback)(float)); +void honey_set_draw_callback(void (*draw_callback)()); +void honey_set_fps(unsigned int); + +void honey_run(honey_window window); + #define honey_set_resize_callback glfwSetFramebufferSizeCallback #define honey_set_mouse_move_callback glfwSetCursorPosCallback |