initial commit; window opening
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 13 Dec 2021 00:52:12 +0000 (18:52 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 13 Dec 2021 00:52:12 +0000 (18:52 -0600)
.vscode/tasks.json [new file with mode: 0644]
CHANGELOG [new file with mode: 0644]
doc/design.md [new file with mode: 0644]
run_tree/lib/glfw3.dll [new file with mode: 0644]
run_tree/lib/onyx_glfw3.dll [new file with mode: 0644]
run_tree/lib/onyx_opengles.dll [new file with mode: 0644]
run_tree/lib/onyx_runtime.dll [new file with mode: 0644]
run_tree/run.bat [new file with mode: 0644]
src/build.onyx [new file with mode: 0644]
src/main.onyx [new file with mode: 0644]

diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644 (file)
index 0000000..fb21b08
--- /dev/null
@@ -0,0 +1,30 @@
+{
+    // See https://go.microsoft.com/fwlink/?LinkId=733558
+    // for the documentation about the tasks.json format
+    "version": "2.0.0",
+    "tasks": [
+        {
+            "label": "Run Game",
+            "type": "shell",
+            "problemMatcher": "$onyx",
+            "options": {
+                "cwd": "${workspaceFolder}/run_tree",
+            },
+            "presentation": {
+                "echo": true,
+                "reveal": "silent",
+                "focus": false,
+                "panel": "shared",
+                "showReuseMessage": false,
+                "clear": false
+            },
+            "windows": {
+                "command": "run.bat",
+            },
+            "group": {
+                "kind": "build",
+                "isDefault": true
+            }
+        }
+    ]
+}
\ No newline at end of file
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644 (file)
index 0000000..b417c6a
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,10 @@
+Version 0.0.1a - Initial Setup
+Getting the basic game engine working on Windows and Linux.
+
+ADDITIONS:
+
+REMOVALS:
+
+CHANGES:
+
+BUGFIXES:
\ No newline at end of file
diff --git a/doc/design.md b/doc/design.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/run_tree/lib/glfw3.dll b/run_tree/lib/glfw3.dll
new file mode 100644 (file)
index 0000000..1d9f9a2
Binary files /dev/null and b/run_tree/lib/glfw3.dll differ
diff --git a/run_tree/lib/onyx_glfw3.dll b/run_tree/lib/onyx_glfw3.dll
new file mode 100644 (file)
index 0000000..73650fa
Binary files /dev/null and b/run_tree/lib/onyx_glfw3.dll differ
diff --git a/run_tree/lib/onyx_opengles.dll b/run_tree/lib/onyx_opengles.dll
new file mode 100644 (file)
index 0000000..a168d51
Binary files /dev/null and b/run_tree/lib/onyx_opengles.dll differ
diff --git a/run_tree/lib/onyx_runtime.dll b/run_tree/lib/onyx_runtime.dll
new file mode 100644 (file)
index 0000000..53571c2
Binary files /dev/null and b/run_tree/lib/onyx_runtime.dll differ
diff --git a/run_tree/run.bat b/run_tree/run.bat
new file mode 100644 (file)
index 0000000..5e545a3
--- /dev/null
@@ -0,0 +1,3 @@
+@echo off
+
+\dev\onyx\onyx run ..\src\build.onyx -I ..\src
\ No newline at end of file
diff --git a/src/build.onyx b/src/build.onyx
new file mode 100644 (file)
index 0000000..9de9978
--- /dev/null
@@ -0,0 +1,19 @@
+#local runtime :: package runtime
+
+#load "core/std"
+
+// These paths are very specific to where I keep Onyx on my system.
+// In the short-term, Onyx modules should be copied locally to this
+// project.
+#if runtime.OS == runtime.OS_Windows {
+    #load_path "\\dev\\onyx\\"
+}
+#if runtime.OS == runtime.OS_Linux {
+    #load_path "/home/brendan/dev/c/onyx"
+}
+
+#library_path "./lib"
+#load "modules/glfw3/module"
+#load "modules/opengles/module"
+
+#load "main"
\ No newline at end of file
diff --git a/src/main.onyx b/src/main.onyx
new file mode 100644 (file)
index 0000000..4501425
--- /dev/null
@@ -0,0 +1,23 @@
+
+use package core
+use package glfw3
+use package opengles
+
+main :: (args) => {
+    if !glfwInit() {
+        println("Failed to initialize GLFW");
+        os.exit(1);
+    }
+
+    window := glfwCreateWindow(800, 600, #cstr "Voxel Shooter");
+    glfwMakeContextCurrent(window);
+    glInit(glfwGetLoadProcAddress());
+
+    while !glfwWindowShouldClose(window) {
+        glClearColor(.2, .2, .2, 1);
+        glClear(GL_COLOR_BUFFER_BIT);
+
+        glfwPollEvents();
+        glfwSwapBuffers(window);
+    }
+}
\ No newline at end of file