A question about LWJGL.

Started by SHsuperCM, November 06, 2019, 07:08:17

Previous topic - Next topic

SHsuperCM

I have started developing a 2D game and hoped to use LWJGL, The LWJGL website seems to really advertise
using LWJGL3 so that's what I started using. I have worked in the past with LWJGL2.9 and understood it easily
using immediate mode and everything was fine back then.

Now the new LWJGL requires weird VAO and VBO which I understand what they are and what they do but it
seems really unintuitive as well as not very friendly to Java's Object Oriented approach.

There are barely any usable modern LWJGL3 tutorials that work and each one contradicts eachother so It's
a lot harder to learn how to use it properly than it should be.

I am looking for opinions on what I should do.
Is there any performance benefit from LWJGL3? Is it really worth the trouble?
(I am talking about a 2d pixelated game that will not require more than 60 fps and will contain multiple
moving objects as well as a camera that follows the player)
Why shouldn't I just work in LWJGL2 which seems to have a ton of tutorials, worked perfectly, managed to
run a complex game like Minecraft up until 1.13 perfectly even on potatoes.
Should I just abandon LWJGL?
If I should stay on LWJGL3, where can I find an example/tutorial that is good and works well for my situation?

Thanks for taking your time to read/help.

KaiHH

Let me start with an observation that we make with everyone new to LWJGL and/or OpenGL: Your problems/confusions stem from the fact that you confuse what LWJGL actually is and what information ("LWJGL tutorials") you are seeking.
LWJGL is a Java/native binding library (plus some infrastructure functionality such as loading native libraries and handling native memory). That means its primary focus lies on providing direct Java bindings for native libraries, such as OpenGL, GLFW, OpenAL, Vulkan and many others.

When you program against the OpenGL API, LWJGL itself does not require or make use of any particular style or version of OpenGL. You can decide whether you want to use immediate mode, retained mode, with or without shaders, etc.
Nothing in LWJGL will limit you to using any particular library or any way how to use a particular library, such as OpenGL.

The main lwjgl3-wiki GitHub page makes this also clear. Please read this thoroughly: https://github.com/LWJGL/lwjgl3-wiki/wiki#welcome

overlisted

Modern OpenGL gives you ability to do very cool tricks (and much more performance) if you understand it.
Do you want to get some classes that makes modern OpenGL object-oriented? They was made by me.

The best modern OpenGL tutorial (it's easy to read it being a java dev): learnopengl.com. You can begin learning from "'Hello Window" page. Also don't forget to replace GLM classes with JOML's ones (mat4 = Matrix4f, vec3 = Vector3f)

btw, do you understand the matrix (vector) math? If you don't it will be very hard to use OpenGL


Sorry for my bad English if it is. It is so hard to talk about math and GL in not your native language.