aboutsummaryrefslogtreecommitdiff
path: root/src/renderer.effekt
diff options
context:
space:
mode:
authorCan2024-12-19 12:48:33 +0100
committerCan2024-12-19 12:48:33 +0100
commit14a59dd1313e8ade8c108c52e3879b25f6e5b671 (patch)
tree44f270aca22db49a62ab977123819a69656c2462 /src/renderer.effekt
parent32c3cd70d157166d0ddf8c18833788f0c69533e3 (diff)
feat: implement Renderer interface for Chip8 emulator
Diffstat (limited to 'src/renderer.effekt')
-rw-r--r--src/renderer.effekt18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/renderer.effekt b/src/renderer.effekt
new file mode 100644
index 0000000..7a78321
--- /dev/null
+++ b/src/renderer.effekt
@@ -0,0 +1,18 @@
+module src/renderer
+
+/*
+The Renderer for the Chip8 emulator.
+To support multiple backends, we define a Renderer interface.
+Every backend must implement this interface.
+*/
+
+import bytearray
+effect start(rom: ByteArray): Unit
+
+interface Renderer {
+ def init(): Unit / start
+ def clear(): Unit
+ def draw(x: Int, y: Int): Unit
+ def update(): Unit
+ def log(msg: String): Unit
+}