summaryrefslogtreecommitdiff
path: root/frontend/2d
diff options
context:
space:
mode:
authorMatthew Kosarek <mattkae@protonmail.com>2021-03-22 20:54:51 -0400
committerMatthew Kosarek <mattkae@protonmail.com>2021-03-22 20:54:51 -0400
commitc36d05d5aed2f8f7c6342b174692146e2d11c386 (patch)
tree8e54047d7b6db7e3d21ccfad6b8c4965d42c09fa /frontend/2d
parentc29a911cd1a3f23f66478f205cace14487aadc56 (diff)
Refactored frontend, beginnings of general cpp layer, and beginning roadmap
Diffstat (limited to 'frontend/2d')
-rw-r--r--frontend/2d/_collisions/pill_line/pill_line.cpp25
-rw-r--r--frontend/2d/_collisions/pill_line/pill_line.html42
2 files changed, 67 insertions, 0 deletions
diff --git a/frontend/2d/_collisions/pill_line/pill_line.cpp b/frontend/2d/_collisions/pill_line/pill_line.cpp
new file mode 100644
index 0000000..7b85695
--- /dev/null
+++ b/frontend/2d/_collisions/pill_line/pill_line.cpp
@@ -0,0 +1,25 @@
+#include "../../shared_cpp/OrthographicRenderer.h"
+#include "../../shared_cpp/types.h"
+#include "../../WebglContext.h"
+#include <emscripten/html5.h>
+
+type TriangleShape = OrthographicShape<3>;
+
+EM_BOOL run(int eventType, const EmscriptenMouseEvent* mouseEvent, void* userData);
+
+
+int main() {
+ WebglContext context;
+ context.init("#gl_canvas");
+
+ OrthographicRenderer renderer;
+ renderer.load();
+
+ TriangleShape shape;
+ shape.vertices = { { -1, -1, 0 },
+ { 0, 1, 0 },
+ { 1, -1, 0 } };
+ shape.load(&renderer);
+
+ return 0;
+}
diff --git a/frontend/2d/_collisions/pill_line/pill_line.html b/frontend/2d/_collisions/pill_line/pill_line.html
new file mode 100644
index 0000000..04efd38
--- /dev/null
+++ b/frontend/2d/_collisions/pill_line/pill_line.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <script src="/scripts/jquery-3.5.1.min.js"></script>
+ <script src="/index.js"></script>
+ <link rel="stylesheet" href="/index.css">
+ <link rel="shortcut icon" href="/favicon/favicon.ico" type="image/x-icon">
+ <script src="dist/output.js"></script>
+
+ <title>Physics for Games</title>
+ </head>
+ <body>
+ <header>
+ <h1>Physics for Games</h1>
+ </header>
+ <main>
+ <nav>
+ </nav>
+ <section>
+ <h1>Pill-Line</h1>
+ <article>
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+ <div class="opengl_canvas_container">
+ <canvas id="gl_canvas" width="640" height="480"></canvas>
+ <div class="opengl_canvas_sidebar">
+
+ </div>
+ <button id="play_button" class="play_button">
+ Play
+ </button>
+ <button id="stop_button" class="stop_button">
+ Stop
+ </button>
+ </div>
+ </article>
+ </section>
+ </main>
+ </body>
+</html>