Would it be possible to port LWJGL to other languages?

Hello. I’ve recently became interested in perhaps using other, interpreted languages to write games in. I wonder, would it be possible to generate bindings for other programming languages? Thank you for your time.

Cheers :slight_smile:

lwjgl is a binding of the C libs opengl, openal and input (or whatever its called) in java… You wouldn’t make a binding to the java. Most langs do have some bindings at least for some of these libs.

If the other language is a JVM language such as Clojure or Scala, you can simply use LWJGL as-is, but you may want to check for more idiomatic libraries wrapping LWJGL first. Otherwise, just google for " opengl binding" and you’re likely to find one for almost any language. Hell there’s even opengl bindings for COBOL.

Although there are OpenGL bindings, I like the awesomeness of the LWJGL API and the OpenAL and OpenCL that comes with it. How much of LWJGL is Java-only?

Almost none of it.

Really its pretty close to the C. Sure the devs will tell you there is a bit of footwork in the background to keep performance up etc. But C opengl and java lwjgl gl look the same with static imports. I have even cut and past examples from NeHe with very little changes required.

The “awesomeness” of the LWJGL API is pretty much the OpenGL API (and you’re in a small minority if you think the C API is actually elegant). LWJGL is as close to an exact clone of it as you can possibly get, and the only things on top that could be called “higher level” would be utilities like the vector math libraries, which have equivalents in most other languages. As for OpenAL and OpenCL, you may have to look for separate bindings for those.

I recommend just trying out some other language’s opengl library, such as python+pyglet.

… dammit delt0r y u always gotta ninja me? :wink:

But I don’t want to change and I like the way LWJGL town is run :frowning:

Then use LWJGL. Seriously, what do you think the ‘J’ stands for?

I too prefer LWJGL to other bindings that I’ve used so far. It has lots of useful additions like the “glGenTextures()” overload and the ContextCapabilities class. Display is also super easy to set up compared to many other bindings.

You might want to look into Scala, Kotlin, Fantom and Groovy++. They are all “functional” languages that should yield higher performance than something like BeanShell, Jython, Rhino, etc.

I’ve been taking quick paranoid glances at functional programming a while here and there, so I’ll look into it.

I’m sorry. I was not asking you or anybody else to do it, I was asking if it would be possible or preferable over starting anew entirely.

Really. As already pretty often said here. There are lots of OpenGL bindings with sometimes very powerful (almost as powerful as awt) window libs out there. For python there is pygame, for C/C++ you use native OpenGL with SDL (not pretty… but that’s because of C :persecutioncomplex: ) and the awesome lib I’ve forgotten about… (Also: Qt, holy shit… it looks like it’s even got ported to windows)

No love for Pascal or Brainfukc? :persecutioncomplex:

Bunches of pascal bindings out there like these and these. None for brainf**k or befunge or unlambda tho … but hey there are interpreters for those in languages that do have bindings.

Why is brainfuck not getting any love? :stuck_out_tongue:

Because it fucks your brain.