Game interface panel always on screen?

Started by
16 comments, last by WoolyUK 22 years, 10 months ago
I found this cool article on GUI development:

http://www.gamedev.net/reference/programming/features/gui/

Although I haven''t read it, I plan to because I have pretty much the same question as you. The GUI stuff uses DirectX, but I think thats only for like DirectInput and stuff, not any graphics. I could be wrong, but I don''t think it would be hard to port the GUI graphics to OpenGL. The DirectInput stuff, on the other hand, is pretty much all you can use.

--SK
Advertisement
the only thing I see at the moment is that you enable cull_face, but you dont call glCullFace(GL_BACK), refer to chapter 2 of the redbook.

www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
But when I disable the world drawing bits and draw just the panel it is blue then - even with the current culling settings.

Could it still be that?

Adam
Not sure if this is the problem or not, but normally you want to disable texturing before you draw something that you want to be a solid color. Otherwise the last texture that was bound will be used when you draw, without any red or green components since your only non-zero color channel is set to blue.

add glDisable( GL_TEXTURE_2D ); before you draw your box and then:

glFlush();
glEnable( GL_TEXTURE_2D ); after you draw it.

if you don''t use glFlush() first then it might ignore when you disable texturing because you re-enabled it before the buffer is sent to the video card.

Hope this helps.

Seeya
Krippy
YAY!!

Krippy saves the day for me! (again)

Thanks dude, U have helped me about 5 times now! lol

You rock! And so does everyone else in this thread who helped me!

Thanks again!

Adam

Anytime
... or my personal favorite way, disable depth test and then draw it!
I would think that would be faster than doing translations... even if the translations came in at 0 cost, then the fact that it is still doing depth testing against other polygons probably comes in at a cost.
Disabling depth testing ought to be a fairly cheap state change since it probably only toggles a variable which determines whether or not it runs a check on the depths each time it draws!
Hmmm... Well turning off depth testing is always a good idea, but you still need to translate or you will need to do some expensive calculations to find the correct dimensions that you need to make your box for it to always look right.

And you still need to disable texture mapping (not sure if that was relevant to what you were trying to say or not... lol).

But the reason for turning off depth testing is not for speed concerns, todays hardware is real efficient on depth testing, but if you don''t and you get close to other objects they might draw over your interface.


Seeya
Krippy

This topic is closed to new replies.

Advertisement