iDevGames Forums
GL_DEPTH_TEST and or Blending - Printable Version

+- iDevGames Forums (
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: GL_DEPTH_TEST and or Blending (/thread-1330.html)

GL_DEPTH_TEST and or Blending - Volte - May 7, 2009 02:40 PM

'lo folks.

I've got a user interface library (C++) which allows me to create a bunch of elements such as textfields, buttons, windows etc.

The way I have it now, I've assigned a background texture to my interface, and then a few game elements such as a chatbox etc.

Now, the problem is, I would like to be able to draw my game elements (planets, ships etc) in between the background, and the user interface objects.


for each gameobject, gameobject.draw();

is there a way I can use a combination of zindices, GL_DEPTH_TEST and or blending to accomplish this? I don't exactly have the luxury of order of draw, but I can manipulate zindecies.



GL_DEPTH_TEST and or Blending - AnotherJake - May 7, 2009 04:49 PM

Sure you can use depth testing. But if I understand your description, why not just draw the background texture yourself first, then the game objects, then the UI without a background?