now using 4coder for editing
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 15 Oct 2020 14:47:51 +0000 (09:47 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Thu, 15 Oct 2020 14:47:51 +0000 (09:47 -0500)
.gitignore
build.sh [new file with mode: 0755]
doc/plan
project.4coder [new file with mode: 0644]
src/sim.c

index 7d983c8b4d505406d6369c119a4304b3e71473d4..5bd48bbffe3cf3647e2c71c6086930d01a5116b5 100644 (file)
@@ -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 (executable)
index 0000000..05b9f6a
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make clean all
\ No newline at end of file
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ca1d60ea7f979a8173efbcf4d87103aae319c011 100644 (file)
--- 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 (file)
index 0000000..f694913
--- /dev/null
@@ -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
index 8cf20316600a2c0b0d5a14951a573dfb30e159dd..f81b8c1738012b5b9315e1b5c54e29efc55a85bd 100644 (file)
--- a/src/sim.c
+++ b/src/sim.c
 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