--- /dev/null
+version(1);
+
+project_name = "CSC718_Project";
+
+patterns = {
+"*.c",
+"*.h",
+"*.4coder",
+};
+
+blacklist_patterns = {
+"*.git",
+};
+
+load_paths_custom = {
+ {"."},
+};
+
+load_paths = {
+ { load_paths_custom, .os = "linux" },
+};
+
+command_list = {
+ { .name = "build",
+ .out = "*compilation*",
+ .footer_panel = true,
+ .save_dirty_files = true,
+ .cursor_at_end = false,
+ .cmd = { { "./build.sh", .os = "linux" } },
+ },
+ { .name = "run",
+ .out = "*run*",
+ .footer_panel = true,
+ .save_dirty_files = false,
+ .cursor_at_end = true,
+ .cmd = { { "./sim", .os = "linux" } },
+ }
+};
+
+fkey_command[5] = "build";
+fkey_command[6] = "run";
\ No newline at end of file
void panic_and_die(const char* msg, ...) __attribute__((noreturn));
void panic_and_die(const char* msg, ...) {
puts("************ PANIC ************");
-
+
va_list va;
va_start(va, msg);
vprintf(msg, va);
va_end(va);
-
+
#ifdef DEBUG
// NOTE: This allows for a debugger to stop here.
__asm("int $3");
#endif
-
+
exit(1);
}
void init_opengl() {
if (!glfwInit()) panic_and_die("Failed to initalize GLFW.");
glfwSetErrorCallback(glfw_error_handler);
-
+
window = glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE, NULL, NULL);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwMakeContextCurrent(window);
-
+
glfwSwapInterval(1);
glfwSetKeyCallback(window, glfw_key_handler);
glfwSetFramebufferSizeCallback(window, glfw_resize_handler);
double last_time = glfwGetTime();
double curr_time = last_time;
double delta;
-
+
while (!glfwWindowShouldClose(window)) {
glfwPollEvents();
-
+
curr_time = glfwGetTime();
delta = curr_time - last_time;
last_time = curr_time;
-
- update(delta);
- draw();
+
+ if (delta > 0.0) {
+
+ update(delta);
+ draw();
+ }
}
}
init_opengl();
loop();
deinit_opengl();
-
+
return 0;
}
\ No newline at end of file