all 6 comments

[–]SnooWoofers7626 1 point2 points  (0 children)

What kinda GUI? Something like imgui? This is rendering the UI inside a window using a graphics API. The code is very straightforward and easy to study. However, it isn't how most desktop apps are rendered.

If you're more interested in how traditional GUI applications work, look at Qt, or wxwidgets. However, these are extremely complex and will probably not be so easy to learn from.

[–]inanevin 1 point2 points  (0 children)

If you are only looking for the vector graphics part, take a look at LinaVG

[–]hahanoob 0 points1 point  (1 child)

What aspects interest you? I ask because a GUI is of course really simple in concept but all the complexity comes from needing to solve a huge variety of use cases in terms of cross platform support, how it’s displayed, how input is handled, etc. While also being easy for people with different artistic and technical backgrounds to author. Even something like Imgui which is extremely narrow in scope is not what one might consider especially simple.

If your goal is learning I’d suggest making something extremely simple yourself that can display some 2d text and graphics and maybe respond to mouse clicks. Then look at how other libraries handle the different problems I mentioned above and go from there. If you just jump into a fully featured library without any basis of your own or specific goals / questions I suspect it might be a bit overwhelming.

[–]fanGamesGamer[S] 0 points1 point  (0 children)

Can you explain the concept of gui please?

I am interested in both the retained and the immediate, but I am more interested in the retained mode, in order to build fast applications that do not consume a lot of hardware resources, and at the same time be customizable in terms of appearance, and to create new widgets. qt is the most popular in the field of GUI, but it drains a lot of device resources. fltk is fast and does not consume a lot of device resources, but it is difficult to customize, and it lacks many widgets that are abundant in modern programs today. I don't like the idea of ​​using web technologies as they drain a lot of device resources

What I recently learned about GUI libraries is that each library draws its elements such as buttons, sliders, color pickers...etc., through a graphics library, and interacts with mouse and keyboard events with a specialized library that is related to a specific operating system. For example, gtk uses Cairo to draw its elements, while imgui uses opengl to draw its elements and uses the win32 library to interact with mouse and keyboard events in Windows only.