GUI in OpenGL

Post: #1
OK, so I want to implement a GUI in openGL that can be animated. What is the best way to go about doing it? Just draw a textured 2D quad in front of the screen? If so, what size should the texture be so that it can scale properly? I've also heard from various sources that for compatibility textures should be no larger than 256x256.

Quote this message in a reply
Posts: 5,143
Joined: 2002.04
Post: #2
The 256x256 limit is rubbish -- from memory, even the Rage128 can handle 1024x1024. There are of course issues with such large textures (for example a 1024x1024 texture uses 4MB of VRAM, which may not be acceptable on low-end cards), but large sizes are widely supported.

I'd just draw a screen-aligned textured quad for each GUI element.
Quote this message in a reply
Posts: 177
Joined: 2002.08
Post: #3
The 256x256 limit definitely existed on Voodoo hardware.

As OSC said, it's much better to draw individual elements seperately than to draw the entire GUI as a single texture. You can set GL to map directly to screen coordinates if you call glOrtho2D() with the same numbers you passed to glViewport().
Quote this message in a reply
Posts: 834
Joined: 2002.09
Post: #4
If you're not too picky about the looks of you GUI, check into glUI... Do a Google on it.
Quote this message in a reply
Post Reply