Search code examples
javaopengltextureslwjgl

How to 'send to back/front' or in other words change 'priority' of textures?


I'm making a 2D Java program with LWJGL and its OpenGL. It uses LWJGL's display.

I would like one image to show above the second image on screen, but it's blocked out, I assume by default. Does LWJGL have a setting so that the image has 'priority' over the background, so that it sends the image in front of it?


Solution

  • OpenGL has no concept of "priority" in the way you mean. If there is no depth testing (or other testing), then what you see is in the order you gave it to OpenGL. So if you want something to appear on top of something else, it is up to you to draw it after what it should appear on top of.