Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I like LWJGL, but Java? Not so much. I recently found out a way to call Java methods from C++. But would this be inefficient? I mean, calling a C/C++ DLL from Java, just to be called back again into C++? I don't know the native method names in LWJGL. I find it better then GLFW, SDL, and all those libraries. But other than my preferences, how slow would it be?

share|improve this question
Isn't LWJGL just a Java "port" of the OpenGL API? In that case, why not use the standard C OpenGL API? I have never used LWJGL myself, so I might be completely wrong. – EClaesson May 16 '13 at 6:42
It's a multiplatform port of the native API for Windows, Mac, and Linux that handles the whole window with OpenGL. – LiquidFeline May 16 '13 at 6:54
Are there no C++ libraries that do the same LWJGL does? – Luke B. May 16 '13 at 13:09
@user1870398 There are FreeGLUT and SDL. – N1xx1 May 20 '13 at 21:39

Yes it would be inefficient. However it's up to you to decide if it is too inefficient. It depends on how often you would be calling LWJGL.

See and Chapter 9.2 Examining JNI Costs from the second link provides a benchmark result where Native->Java calls were almost 10 times slower than Java->Native calls.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.