Initial import
This commit is contained in:
8
desktop/project.clj
Normal file
8
desktop/project.clj
Normal file
@@ -0,0 +1,8 @@
|
||||
(defproject play-clj-desktop "0.1.0-SNAPSHOT"
|
||||
:description "Library for making desktop games"
|
||||
:license {:name "Public Domain"
|
||||
:url "http://unlicense.org/UNLICENSE"}
|
||||
:dependencies [[com.badlogicgames.gdx/gdx-backend-lwjgl "0.9.9"]
|
||||
[com.badlogicgames.gdx/gdx-platform "0.9.9"
|
||||
:classifier "natives-desktop"]
|
||||
[play-clj "0.1.0-SNAPSHOT"]])
|
||||
17
desktop/src/play_clj/desktop.clj
Normal file
17
desktop/src/play_clj/desktop.clj
Normal file
@@ -0,0 +1,17 @@
|
||||
(ns play-clj.desktop
|
||||
(:require [play-clj.core :refer :all])
|
||||
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
|
||||
[org.lwjgl.input Keyboard]))
|
||||
|
||||
(defmacro defgame
|
||||
[name & {:keys [title width height]
|
||||
:as options}]
|
||||
(let [title (or title "")
|
||||
width (or width 800)
|
||||
height (or height 600)]
|
||||
`(do
|
||||
(def ~name (create-game ~options))
|
||||
(defn ~'-main
|
||||
[]
|
||||
(LwjglApplication. ~name ~title ~width ~height true)
|
||||
(Keyboard/enableRepeatEvents true)))))
|
||||
Reference in New Issue
Block a user