0

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?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
GlassZee
  • 1,117
  • 2
  • 11
  • 22
  • 1
    Are you just drawing textures with quads? If you're doing orthographic 2D, You can use the 3rd vertex coordinate and the depth buffer to describe which quads are in front of others. Let me know if you need more explanation. – Tim Mar 28 '12 at 22:28
  • @Tim: That would require turning on depth tests. – Nicol Bolas Mar 28 '12 at 23:34
  • yea i'm drawing textures w/ quads and i've got depth tests turned off. if you have a link or a quick explanation, that would be great. if it requires a lot of explanation it may be too difficult to bother with at this point; i'm not too experienced yet. – GlassZee Mar 28 '12 at 23:55
  • actually, i'd really like that explanation please. the first image is the FPS count, and it looks like it won't work with Nicol's solution of drawing it afterward. – GlassZee Mar 29 '12 at 00:40

1 Answers1

2

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.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982