#include "engine.h" #define STB_DS_IMPLEMENTATION #include #define STB_TRUETYPE_IMPLEMENTATION #include #define STB_IMAGE_IMPLEMENTATION #define STBI_FAILURE_USERMSG #include "stb_image.h" #define PL_MPEG_IMPLEMENTATION #include #ifdef EDITOR #include "editor.h" #endif #include "render.h" #include "openglrender.h" #include "window.h" #include "camera.h" #include "input.h" #include "sprite.h" #include "2dphysics.h" #include "gameobject.h" #include "registry.h" #include "log.h" #include "resources.h" #include "timer.h" #include "script.h" #include "sound.h" // TODO: Init on the heap #include "engine.h" void error_callback(int error, const char *description) { fprintf(stderr, "Error: %s\n", description); YughError("GLFW Error: %s", description); } void engine_init() { glfwSetErrorCallback(error_callback); /* Initialize GLFW */ if (!glfwInit()) { printf("Could not init GLFW\n"); } glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); resources_init(); script_init(); registry_init(); //stbi_set_flip_vertically_on_load(1); phys2d_init(); sound_init(); } void engine_stop() { glfwTerminate(); }