0

I'm looking forward to try to build a really simple GUI framework in OpenGL ES 2.

I have noticed that probably the two main pieces of my framework could be a collection of Vertex Shaders and a collection of Geometry Shaders, but I was wondering if there are platform specific extensions for that, because OpenGL is just a rendering technology and having to deal with a GUI also involves the input part that OpenGL clearly doesn't manage nor care about.

I was wondering that maybe there are some extensions for the most popular graphical servers out there like X11 on linux. There is a similar technology that can help me with building the building blocks for a GUI ?

genpfault
  • 51,148
  • 11
  • 85
  • 139
juio
  • 154
  • 2
  • 9
  • Don't think so, i did it myself ( and depending on your features wanted its a lot of work ). – Felix K. Mar 29 '13 at 23:43
  • @FelixK. can you expand your answer ? A lot of work in what directions ? application design ? writing the shaders ? Have you done this with a fixed or a programmable pipeline ? – juio Mar 29 '13 at 23:45
  • I going to expand it later. But in short: writing the shaders is done in no time, but the application design is heavy. – Felix K. Mar 29 '13 at 23:49
  • OpenGL ES 2.0 doesn't have geometry shaders. – Nicol Bolas Mar 30 '13 at 03:15
  • @NicolBolas I really was convinced about that, I was thinking about making simple shapes for the widgets with vertex shaders and add some visuals with GS; can you suggest your idea about the design of this GUI ? – juio Mar 30 '13 at 07:24
  • @juio: You can't use a GS in OpenGL ES 2.0; that functionality *does not exist* in ES 2.0. So you can't "add some visuals with GS". – Nicol Bolas Mar 30 '13 at 10:19

1 Answers1

0

Beside of using a existing framework i don't know any extensions for OpenGL/OpenGL ES which make the life of UI programming easier.

I'm using programmable pipeline only.

Writing shaders is really simple and you should be able to do it in a short time because for the most purposes there are only 2 shaders required:

  • Texture shader with or without rotation
  • Color shader with or without rotation

Rotation makes the UI much more complex, especially clipping is hard without additional techniques. Also register touches/clicks onto a control is more complex and slower than using non-rotated elements.

For special cases i allowed the user to override the controls Draw-method and use own shaders, this keeps the original code really simple, i've in every control a UIGraphics-object which allows the user to draw the UI by providing a lot of different methods and overloads ( DrawTexture, DrawRectangle, DrawCharacter, DrawText, ... )

The heaviest part is definitly designing the hole UI controls and code them. Buttons are quite easy but there are some containers which really require a lot of finetuning like a slideable container. Then you have to care about databinding, event handling, animations, etc....

Community
  • 1
  • 1
Felix K.
  • 6,201
  • 2
  • 38
  • 71
  • JFY: The drawing code is just about 6% of my UI code, this doesn't include the XML parser, the loading of the textures ( you are using C++ so you could use the PVR library and don't need to do it all by hand ) and the setup of the graphic classes for OpenGL/OpenGL ES. – Felix K. Mar 30 '13 at 00:43