Jump to content
  • Advertisement
Sign in to follow this  
actsl

kiss_sdl -- Simple generic GUI widget toolkit for SDL2

This topic is 793 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I repeat this announcement here now, because kiss_sdl has become mature, and now for almost two months there was no need for any changes, and quite likely it will stay the way it is.

 

It is not directly game related, they mostly use SDL for games, but it is a universal library. The main place to discuss it, is the SDL development forum, this thread http://forums.libsdl.org/viewtopic.php?t=11772&sid=e7757c27c21438e8deceef94bddc7f63 . I think the people who use SDL, also read the SDL forum, but this is for these who may not read, or then it maybe may give a reason to start to use SDL.To not to forget to say that, KISS is an acronym, and a software development principle, which stands for "Keep it Small and Simple".

 

By the information in the SDL development forum, there are some 10 GUI widget toolkits altogether that work with SDL. Most of these, no one could make to work with SDL2, SDL2 is not compatible with SDL1. So i went ahead to write one. kiss_sdl is by far the smallest of all known GUI widget toolkits for SDL, by the number of lines of code, many others are some 10 times more complex. Some say that the number of lines of code doesn't matter at all, but if you want a code that is easily changeable, then that matters. This is a software written by the paradigm "Unnecessary complexity is evil", this paradigm i think should be applied more in the future. It is tested by people in the SDL development forum, used in at least one game and one application by users, and found to compile and work well.

 

This is a low level GUI toolkit. It is only 2437 lines of code, and only 1124 lines of code that actually implement the widgets and do all graphics. One should understand the differences between a low level widget toolkit (immediate GUI) and an advanced widget toolkit such as GTK, maybe reading that thread in the SDL forum helps to understand that. It is made to be easily changeable, and all the drawing functions and general functions are abstractied to different files, so by rewriting these functions one can use different libraries for drawing, fonts, etc. It implements a window, multiline label, button, select button, vertical scrollbar, horizontal scrollbar, progress bar, entry box, textbox, and a combo box. Yes it can implement overlapping dialog windows. But it is intended to be changed when there is not anything that does exactly what you want, by user added functionality or by rewriting the functions. This makes it generic. And this is why it is not just another widget toolkit.

 

There is a manual, i also wrote a hello world example in that SDL forum thread. This is a general low level widget toolkit, so when deciding to use it, you cannot go wrong. It takes a bit of effort to learn it, but this knowledge shall no way be wasted, for understanding whatever widget toolkit. But you don't have to learn a complex widget toolkit like GTK, when you just want to do the most common things with a graphical user interface.

 

kiss_sdl is in GitHub at the following link.

 

https://github.com/actsl/kiss_sdl

 

The default look of it may seem somewhat primitive, but it is easily changeable, and by default there is only rudimentary graphics. Screenshots of the two examples included in the library.

 

kiss_ss1.jpg

 

kiss_ss2.jpg

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!