Can I make UI using texel modification on OpenGL?

Can I make UI using texel modification on OpenGL?

I wonder how to make GUI like buttons, textbox, listbox and something like that.

I know I can manipulate texture pixel(texel). Have you tried that before?


Again, yes.

There are three possible things I can think of, having done that myself in the past:

[li]Roll your own GUI library and draw things “manually” (actually, the CPU does it, not you) into a buffer, upload changes to the texture (glTexSubImage2D) and “display” the texture by rendering a rectangle (i.e. your GUI window)[/li][LIST]
[li]Getting the things on the texture is the easy part. The harder part is implementing all the fancy widgets. Depending on your needs, the whole thing could be done quite fast.[/li][li]You could use an existing 2D drawing library (e.g. Cairo or Anti Grain Geometry) to draw stuff to the buffer[/li][/ul]

[li]Use an existing GUI library and convince it to draw to a buffer, then do the same thing as above[/li][ul]
[li]A few years back, I hacked together a canvas implementation for Qt 4 to render QT dialogs into a texture, paste it onto a 3D object, backproject the mouse position and send input to QT[/li][li]QT is extremely bloated. There are tons of other GUI libraries out there (GTK+, FLTK, Fox, xclass, … to name a few) that could probably be “convinced” to do the same thing[/li][li]There are already “game GUI” libraries out there[/li][/ul]

[li]Roll your own GUI library and drawing things on the fly using legacy/compatibillity profile functions (not what I would call “modifying texels”)[/li][/LIST]

Thank for you reply. Really Thanks. Sir.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.