zaval wrote:
MollenOS wrote:
I'm building my GUI in OpenGL, but I've spent the last few months improving stability and robustness of the core itself. So I guess I would agree a strong core comes before GUI.
I'm a total noobass in graphics so I'm not ashamed to ask. Is that OpenGL suitable for GUI at all? Isn't it a 3D API? Even if it's a matter of subsetting (2D is a subset of 3D), it's going to be a huge overkill - to implement that monstrous API (that is getting outdated yet!), intended for drawing complex 3D objects (games, CAD etc) just for using its small subset of functions/objects/concepts. GUI is hell of complexity, but it's not 3D at all! And there is yet a question - will it be so efficient made this way? The very same standardization body, produced loads of other specifications, that tell about themselves as a 2D stuff, specifically targetting this area, GUI. Like what that OpenVG is for? EGL? Aren't these more suitable for GUI. Here, from
this page they talk about it as exactly the thing for GUI:
Code:
Target Applications
...
Scalable User Interfaces
OpenVG may be used to render scalable user interfaces, particularly for applications
that wish to present users with a unique look and feel that is consistent across different screen resolutions.
Low-Level Graphics Device Interface
OpenVG may be used as a low-level graphics device interface. Other graphical toolkits,
such as windowing systems, may be implemented above OpenVG.
Kinda this thing, eh? What one can do with OpenGL for Windowing?
![Smile :)](./images/smilies/icon_smile.gif)
It's completly true that using OpenGL could be considered 'overkill' to create a GUI, but who said that a GUI had to be 2D? However I don't just have OpenGL to create a GUI, I have OpenGL available for everything, which means I can get a lot of graphical software ported without having to do that much.
And yes, I agree that performance is a consideration, and one I'm still trying to figure out might be a problem with a software renderer. Currently I'm using llvmpipe as my software renderer and it gives me enough performance for now, but I am considering switching to OpenSWR as the backend renderer instead of llvmpipe as that should be faster.
Using other vector graphic libraries are a good choice if you don't wish to port both LLVM and mesa to your platform, and it would give you a much simpler API to use, but my recommandation is not to use OpenVG as that is obsolete by now. The standard is back from 2008 and noone seem to implement it anywhere, it was meant for embedded environments it seem, and has been superseeded by OpenGL ES, which again is meant for embedded environments. So the only real alternative is OpenGL itself, even though Vulkan is working hard to replace it. (But I don't have to care, as mesa both provide OpenGL and Vulkan environments for me!)