Original Post
So, I've been talking with a friend for the past few days about a gui class design, namely updating it to take advantage of new features and be fully OpenGL 3.x compatible. And of course speeding it up from the standard glBegin()/glEnd that it is using currently. I would like your thoughts on my design and help figuring out some parts of it. Currently the gui is set up so that it has a manager, When this manager is created it calls a function (ThemeMgr_LoadTheme()) which loads a theme file which stores the location to a monolithic theme image and data for which type of gui object uses what range (close:10,10,40,40 would tell any button marked as close to have a topleft of 10,10 on the image and a bottom right of 40,40 [this would also set the default (1) scale to be 30x30]) once all this data is loaded a large vbo holding both the vertex data and the texure coord data. This VBO is bound as GL_STATIC_DRAW and indices will be created . I am currently trying to figure out a clean way to store the needed offset on a per gui-object-class (button, text edit.. etc) way (perhaps static?). Every frame a simple 2d shader is loaded, and a orthographic projection matrix is sent to it, this is done only once per frame as it is not needed more. from there guimgr->render() is called where the needed things are bound and for each object a new modelview matrix is created, this will be used to scale and translate the object, and glDrawElements() is called with the given objects offset. This should work for simple objects and for containers I can just draw all the objects inside it, however for things such as sliders, I can only guess I will need to actually draw two times. I am wondering what your thoughts are on this design, if any of you have tryed it or any flaws I am missing. And also if there is a better, or faster, way to go about doing this.