Dear people, I'm involved on a project where I have to create an user Interface (GUI system) that must to run across multiple platforms.
I did some research and found that there is plenty of libraries out there, like GiGi, GLUI, CEGUI, and a lot of others, including QT.
Most of the Libraries that I found are built upon OpenGL and SDL but I'm not confident of using any of them yet. Maybe because they are little confusing, but for sure because in one of the target plataforms , there is nothing more that openGL-ES. The libraries I found are simply not ready for the platform.
So, I started thinking on implementing the Gui system from scratch, even because the requirements are not so big. I need some buttons and other basic controls, editable text fields, and maybe a window to show 3D objects. I would be convinced of implementig the Gui upon OpenGL, maybe SDL to increase portability. But I'm still in doubt between two approaches I imagined.
Ipproach 1: Creating GUI elements as textured 3D rectangles.
I could have a sprite sheet to contain the graphics for most of the basic GUI elements, and a reusable mesh , so It would not have too many draw calls. I'm affraid of using this approach because the editable text fields. I think the texture for those elements must be procedural and unique for each text field, And I will have a lot of them, So it will increase the number of draw calls per frame as I need to redraw all the scene in openGL ( Of course there is the option of not clear the buffer and redraw only the object that changed. but I´m not sure if it is a good Idea in OpenGL )
Ipproach 2: Using OpenGL only as a flipping multiplatform surface.
I could build the entire GUI as single texture. The GUI would be rasterized on a big buffer, and than used as a texture for a 3D rectangle that covers all openGL viewport. Using this approach, despite the Window would be flipped at a great frame rate, the texture that actually contains the Gui can be redrawn only when something changes. In fact , the only part that must be redrawn is the element that changed, and its children. That approach was proven at the old days of Graphic interfacing, using Win32 GDI. But in those days we did not rasterize in HD.
So, I would like to ask you people, if anyone have built a GUI from scratch like the ways above , or something completly different. Iḿ just trying to choose the best patch here . .