Comment

Comment by kayamon

Try an immediate mode GUI. e.g. Dear Imgui[0].

[0] https://github.com/ocornut/imgui

Here's the code to draw a slider whose value is stored in a float:

    float f = 0.5f;  
    ImGui::SliderFloat("my float", &f, 0.0f, 1.0f);
edit: A lot of the problem with GUIs taking so much code is that they duplicate the application's state, requiring a large amount of effort to keep that state synced with their internal state. By instead binding directly against the user's state you can avoid much of the overhead.
parent kayamon 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton