Skip to content

Instantly share code, notes, and snippets.

@jmingtan
Created August 23, 2013 13:57
Show Gist options
  • Save jmingtan/6319600 to your computer and use it in GitHub Desktop.
Save jmingtan/6319600 to your computer and use it in GitHub Desktop.
Setup libgdx in Clojure
; from https://github.com/SilverCrowBlog/Clojure-Libgdx
; project.clj
(defproject testing "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[com.badlogic.gdx/gdx "0.9.9-SNAPSHOT"]
[com.badlogic.gdx/gdx-backend-lwjgl "0.9.9-SNAPSHOT"]]
:repositories [["libgdx" "http://libgdx.badlogicgames.com/nightlies/maven/"]]
:main testing.core)
; testing/core.clj
(ns testing.core
(:gen-class)
(:import (com.badlogic.gdx ApplicationListener Gdx)
(com.badlogic.gdx.backends.lwjgl LwjglApplication)))
(def app
(proxy [ApplicationListener] []
(resize [w h])
(create [])
(render [])
(pause [])
(resume [])
(dispose [])))
(defn -main []
(let [title "My Game"
width 800
height 480
opengl-es? false]
(LwjglApplication. app title width height opengl-es?)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment