Created
November 30, 2020 15:15
-
-
Save ertugrulcetin/9899af261db0f91dddf00dacbebf0bab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(ns jm-clj.core | |
(:import (com.jme3.app SimpleApplication) | |
(com.jme3.scene.shape Box) | |
(com.jme3.scene Geometry) | |
(com.jme3.material Material) | |
(com.jme3.math ColorRGBA))) | |
;(def ^:dynamic *app-settings* (doto (AppSettings. true) | |
; (.setFullscreen false) | |
; (.setTitle "jme_clj"))) | |
(defn my-logic [this] | |
(let [b (Box. 1 1 1) | |
geom (Geometry. "Box" b) | |
mat (Material. (.getAssetManager ^SimpleApplication this) "Common/MatDefs/Misc/Unshaded.j3md")] | |
(.setColor mat "Color" ColorRGBA/Green) | |
(.setMaterial geom mat) | |
(doto (.getRootNode this) | |
(.attachChild geom)))) | |
(def app (proxy [SimpleApplication] [] | |
(simpleInitApp [] | |
(my-logic this)))) | |
(defn -main [& args] | |
(doto app | |
(.setShowSettings false) | |
(.setPauseOnLostFocus false) | |
(.start))) | |
(comment | |
;; this fails | |
(.update app) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment