This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-20
Channels
- # announcements (3)
- # babashka (7)
- # beginners (43)
- # biff (19)
- # calva (39)
- # cider (16)
- # clerk (2)
- # clj-yaml (32)
- # cljs-dev (37)
- # clojure (129)
- # clojure-australia (1)
- # clojure-china (1)
- # clojure-europe (46)
- # clojure-filipino (1)
- # clojure-gamedev (25)
- # clojure-hk (1)
- # clojure-indonesia (1)
- # clojure-japan (2)
- # clojure-korea (1)
- # clojure-my (1)
- # clojure-nl (5)
- # clojure-norway (8)
- # clojure-sg (1)
- # clojure-sweden (12)
- # clojure-taiwan (1)
- # clojure-uk (9)
- # clojurescript (14)
- # core-typed (136)
- # cursive (18)
- # duct (9)
- # emacs (12)
- # etaoin (7)
- # events (1)
- # graalvm (3)
- # gratitude (2)
- # humbleui (7)
- # hyperfiddle (99)
- # introduce-yourself (5)
- # jobs (2)
- # leiningen (1)
- # missionary (14)
- # nrepl (2)
- # off-topic (12)
- # polylith (21)
- # rdf (29)
- # re-frame (8)
- # releases (1)
- # shadow-cljs (264)
- # spacemacs (21)
- # sql (7)
- # vscode (1)
Recently I’ve been trying my hand at some clojure gamedev, but I’m on a mac so recent versions of opengl don’t work. Anyone have suggestions for cross platform gamedev frameworks?
what kind of game are you interested in making?
2d of whatever style, haven’t decided yet. I prefer to not use large frameworks like Godot or Unity.
My opinion is that most 2d games don't really push the hardware so any option that seems comfortable: • swing • processing • skija/humbleui I've started to prefer swing more since it's dependency free and works well enough.
2d games typically only need a few drawing primitives: • shapes • text • images In general, you usually want to have a model that's agnostic of the graphics library and it's pretty easy to write your game in terms of the model and provide drawing implementations for the graphics and window library you care about.
i saw your posts, mx2000, gdl looks cool! looks much more fleshed out than it did 10 months ago, so congrats on that. do you have any walkthroughs or tutorials yet on how to get started? i see the sample project
I am struggling at the moment with the exact purpose of gdl.
On the one hand it is a wrapper for some libgdx code and on the other hand it contains some state handling (like setting up sprite-batch, shape-drawer, ui-default-skin, viewports, etc.)
Basically it is the backend of the action RPG mentioned there (cyber dungeon quest linked in the repo).
Nowadays I am opinionated away from wrapper libraries and more using plain interop for newer projects. I would just recommend the libgdx documentation, it is well worth learning! libgdx is over 1000 classes and utilizing good abstractions.
On the other hand, what kind of questions do you have about getting started? The test example in gdl (start with lein dev
shows how to set up a window and render something)
yeah that makes sense, it's hard to know exactly what to put into such a library
the libgdx documentation is very java oriented, hard to know where to start or how to construct a clojure library that doesn't involve a lot of :gen-class
, which i find unreasonably challenging to use
But please try to think of some questions about getting started, I would love to update the readme. as I said libgdx its such a huge project its hard to know where to start.
Does libgdx offer anything particular for building specific genres of games?
I see the example here is using :gen-class
: https://libgdx.com/wiki/jvm-langs/using-libgdx-with-clojure
Maybe it can be updated just to use a proxy/reify.
I'm curious what kinds of features of libgdx that you leverage compared to trying simple libraries for state, graphics, audio, networking, etc
Thats exactly what libgdx is, a collection of utilities for all this! See here which classes are used: https://github.com/search?q=repo%3Adamn%2Fgdl%20com.badlogic&type=code
Right, how does that compare to using simple libraries for each rather than using libgdx's options?
What simple libraries do you mean? Using plain lwjgl ? I guess using libgdx allows you to work at a higher abstraction level by having everything included. Also the scene2d.ui package is very nice for building GUI elements like buttons/layouting/etc.
If you're doing 2d I highly recommend making your game in the browser with cljs.
i played around with libgdx directly last night and could not get it to work on my mac. for some reason, -XstartOnFirstThread
never made it to the jvm no matter how I passed it in and libgdx failed to work.
I was able to get live reloads + open-glish workflow going on an M1 mac with https://medium.com/@kadirmalak/interactive-opengl-development-with-clojure-and-lwjgl-2066e9e48b52
The only change I needed to do was changing dependencies in project.clj:
:classifier "natives-macos" -> :classifier "natives-macos-arm64"
for
[org.lwjgl/lwjgl "3.3.3" :classifier "natives-macos"]
[org.lwjgl/lwjgl-opengl "3.3.3" :classifier "natives-macos"]
[org.lwjgl/lwjgl-glfw "3.3.3" :classifier "natives-macos"]