Search code examples
c++user-interfaceopenglglfw

Creating a GUI in OpenGL, is it possible?


I'm trying to create a custom GUI in OpenGL from scratch in C++, but I was wondering is possible or not?

I'm getting started on some code right now, but I'm gonna stop until I get an answer.


Solution

  • YES.

    If you play a video game, in general, every UIs should be implemented by APIs like OpenGL, DXD, Metal or Vulkan. Since a rendering surface has higher frame rate than OS UI APIs, using them together slows down the game.

    Starting with making a view class as a base class, implement actual UI classes like button, table and so on inherited from the base class.

    Making UIs using a GFX API is similar to making a game in terms of using same graphics techniques such as Texture Compression, Mipmap, MSAA and some special effects and so on. However, handling a font is a sort of huge part, for this reason, many game developers use a game engine/UI libraries.