blob: b3494750cb11afb7b85d91174d48486a66134830 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#ifndef HONEY_ENGINE_H
#define HONEY_ENGINE_H
/** @file honey.h
*
* @brief Defines the basic loading and callback functions.
*/
#include "common.h"
#include "camera/camera.h"
#include "input/input.h"
#include "light/light.h"
#include "mesh/mesh.h"
#include "model/model.h"
#include "primitives/primitives.h"
#include "shader/shader.h"
#include "texture/texture.h"
/** @struct Helper struct to wrap command-line options. */
typedef struct {
bool verbose;
char* script_directory;
char* logfile;
} honey_options;
/** @brief Print usage help for honey. */
void honey_print_help();
/** @brief Parse command-line options for honey.
*
* This function returns false if the -h option was passed, for simplicity's sake.
*
* @param[in] argc The number of arguments passed to honey.
* @param[in] argv Argument string array.
* @param[out] options Pointer to the honey_options struct to populate.
*
* @returns true if parsing was successful and execution should continue;
* false otherwise.
*/
bool honey_parse_options(honey_options* options, int argc, char** argv);
/** @brief Initialize Honey and set up lua bindings.
*
* @param[out] L The lua state with honey configured.
* @param[out] window The GLFW window configured by honey.
* Also accessible from lua as honey.window.glfw_window.
*
* @returns true on a success; false otherwise.
*/
bool honey_setup(lua_State** L, honey_window* window);
/** @brief The main game loop.
*
* @param[in] window The window the game is running in, created with honey_setup()
*/
void honey_run(honey_window window);
/** @brief Get a registry reference to a given honey callback.
*
* @param[in] L The lua state to find the reference in.
* @param[in] callback Name of the callback to find.
*
* @returns Registry reference to the function if it exists;
* LUA_NOREF otherwise.
*/
int honey_get_callback(lua_State* L, char* callback);
#define honey_set_resize_callback glfwSetFramebufferSizeCallback
#define honey_set_mouse_move_callback glfwSetCursorPosCallback
#define honey_quit glfwTerminate
#endif
|