From: Brendan Hansen Date: Thu, 15 Oct 2020 14:47:51 +0000 (-0500) Subject: now using 4coder for editing X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=2c7c7c27c80e78979f9b15cd62e1060a9a4c69fc;p=csc718.git now using 4coder for editing --- diff --git a/.gitignore b/.gitignore index 7d983c8..5bd48bb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build/ tags sim .tags -.tags_sorted_by_file \ No newline at end of file +.tags_sorted_by_file +.vimspector.json \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..05b9f6a --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +make clean all \ No newline at end of file diff --git a/doc/plan b/doc/plan index e69de29..ca1d60e 100644 --- a/doc/plan +++ b/doc/plan @@ -0,0 +1,4 @@ +Things needed to create the initial sequential version: + - Rendering a circle + - Rendering many circles (instanced rendering) + - \ No newline at end of file diff --git a/project.4coder b/project.4coder new file mode 100644 index 0000000..f694913 --- /dev/null +++ b/project.4coder @@ -0,0 +1,41 @@ +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 diff --git a/src/sim.c b/src/sim.c index 8cf2031..f81b8c1 100644 --- a/src/sim.c +++ b/src/sim.c @@ -16,17 +16,17 @@ 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); } @@ -47,12 +47,12 @@ GLFWwindow* window; 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); @@ -77,16 +77,19 @@ void loop() { 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(); + } } } @@ -94,6 +97,6 @@ int main(int argc, char* argv[]) { init_opengl(); loop(); deinit_opengl(); - + return 0; } \ No newline at end of file