30 lines
1.1 KiB
Clojure
30 lines
1.1 KiB
Clojure
(ns advent.core.desktop-launcher
|
|
(:require [advent.core :refer :all]
|
|
[clojure.tools.nrepl.server])
|
|
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication LwjglApplicationConfiguration]
|
|
[org.lwjgl.input Keyboard])
|
|
(:gen-class))
|
|
|
|
(defmacro start-nrepl-expr [port]
|
|
`(let [{port# :port} (clojure.tools.nrepl.server/start-server :port ~port)]
|
|
(doseq [port-file# ["target/repl-port" ".nrepl-port"]]
|
|
(-> port-file#
|
|
java.io.File.
|
|
(doto .deleteOnExit)
|
|
(spit port#)))
|
|
(println "Started nREPL server on port" port#)))
|
|
|
|
(defn -main
|
|
[& [port]]
|
|
(when port (start-nrepl-expr (Integer/parseInt port)))
|
|
(if false
|
|
(let [cfg (LwjglApplicationConfiguration.)]
|
|
(set! (.width cfg) (doto (.width (LwjglApplicationConfiguration/getDesktopDisplayMode)) println))
|
|
(set! (.height cfg) (doto (.height (LwjglApplicationConfiguration/getDesktopDisplayMode)) println))
|
|
(set! (.fullscreen cfg) true)
|
|
(LwjglApplication. advent cfg))
|
|
(LwjglApplication. advent "advent" 1280 960))
|
|
|
|
|
|
(Keyboard/enableRepeatEvents true))
|