This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
23 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns game.main | ||
(:require [enoki.main :as enoki] | ||
[enoki.event :as e] | ||
[enoki.graphics :as g])) | ||
|
||
(defn render [state ctx] | ||
(-> ctx | ||
(g/clear!) | ||
(g/draw-text! "Hello again, world" 10 20))) | ||
|
||
(defn start [env] | ||
(e/subscribe! :render (fn [_ state ctx] (render state ctx))) | ||
(enoki/start env)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
(ns game.swing.main | ||
(:require [enoki.main :as enoki] | ||
(:require [game.main :as game] | ||
[enoki.graphics.java2d :as gfx])) | ||
|
||
|
||
(defn init [] | ||
(enoki/start {:display (gfx/create-display) | ||
:state {}})) | ||
(game/start {:display (gfx/create-display) | ||
:state {}})) | ||
|
||
(defn -main [& args] | ||
(init)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
(ns game.web.main | ||
(:require [enoki.main :as enoki] | ||
(:require [game.main :as game] | ||
[enoki.graphics.canvas :as gfx] | ||
[enoki.util.dom :as dom])) | ||
|
||
(defn ^:export init [] | ||
(enoki/start {:display (gfx/->CanvasDisplay (dom/get-element "screen")) | ||
:state {}})) | ||
(game/start {:display (gfx/->CanvasDisplay (dom/get-element "screen")) | ||
:state {}})) |