Kiss_sdl -- Simple generic GUI widget toolkit for SDL2


To let you all know, kiss_sdl is now at .

GitHub even refused to delete the entire repository, so that the old URL were available to me to upload my repository to the same URL again, in spite requested. After some person submitted a DMCA notice, because of asking help in building for Android, and after receiving help, requesting to delete the issue attachment file with the build of some files of unknown origin referred to somewhere in the Internet, that i cannot delete myself, and GitHub refused to delete that file. This is too much nonsense all at once, certainly it caused disruption. So you now know that the project it is at the new URL. I’m really sorry for the trouble it undoubtedly caused to all users, including to these 64 good people who gave a star to kiss_sdl in GitHub, trying to do all they can to promote the toolkit. Many thanks to all users of kiss_sdl, and sorry for inconvenience again.

The old thread of kiss_sdl is at Kiss_sdl - Simple universal GUI widget toolkit for SDL
kiss_sdl – Simple generic GUI widget toolkit for SDL2

The following is an example of using the widget toolkit in a game, this is a screenshot of the project by the permit of its author.
Notice that GUI has to be simple, to not interfere with the advanced background.


Takedown of the repository appeared to be a mistake, the kiss_sdl repository is now back at . The repository is good and up to date.
kiss_sdl - Simple generic GUI widget toolkit for SDL2


I think i should explain here very briefly what it is, so you would get some idea. There is immediate GUI, which you may prefer if you want a simpler and easily changeable GUI toolkit. It is also straightforward to use, so doesn’t mostly in practice make the code that uses it more complex, may make it even simpler. The original immediate GUI is imgui (also used in the OGRE game engine), the other is nuklear. kiss_sdl is what i call principal GUI, going further from immediate GUI, written only for SDL (SDL2), which makes it much simpler, it’s generic but it’s less than 2500 lines of easily changeable code. It is thus not “yet another” GUI toolkit, but one can see it only when one knows more about it.

No other generic GUI toolkit in C or C++ as much as it is known, is so simple. How much more complex are the others, is a matter of dispute, the only quantifiable measure is the number of lines of code, and they have at least 10 times more lines of code, though lines of code is certainly not the only parameter of complexity, and it can only be a parameter of complexity when there is a need to more easily change or understand the code. There are other parameters, it is also made to be easily changeable, with parts of the code also abstracted into different files, so it’s easy to change the libraries used or such. One more way how less than 2500 lines of code (normal and well written code) matters, is that it is an indication, a general and complete GUI toolkit with 2500 lines of code cannot be made with a bad design.

In spite it’s the simplest though, every GUI toolkit has some considerable learning curve. It evidently depends on one’s experience as a programmer, like some experienced programmers have learned kiss_sdl in a few hours or even in an hour. It has been made easy to learn, but it still takes some effort for a beginner. Although it is not a typical retained GUI, it is still very similar to a usual GUI toolkit what concerns the general features. Most of what you will learn though, will be general things about programming, that are important to know anyway, so learning kiss_sdl will not be a waste of time, even if you later want to use some more advanced GUI toolkit. Which you though may not need for any games, simulators, system tools or other software, that you may make, but it depends on what you want to do. For games at that you most likely need some very flexible and easily changeable GUI, whatever it may be.

Every effort has been made to make it high quality and reliable, and to eliminate all bugs or faults in the code and in compiling. For more than a year, no issue has been found, except one had a problem compiling it 64 bit in Visual Studio, it works faultlessly with 32 bit and in 64 bit Linux and macOS. I have only 32 bit Windows though, so testing it 64 bit in Visual Studio would be very welcome, and i would especially be thankful for 64 bit project files for Visual Studio, which can then be added to the repository. There is also a branch for high DPI displays and for Android, but for Android it is using ndk-build only.

Then also, is it a “niche product”, as some say? It is open source, so not a product, but it is not a niche thing, why did i need it then? No, it is a general software for its purpose. By some estimations it has more than 2000 users now, there are 1800 downloads in FreewareFiles only, so not “less than 1000” as some here have said. GitHub doesn’t show the downloads, all i know by now is 77 stars and in average 10 unique views in a day during two years. If a GUI toolkit is a “niche product”, then it has failed completely, different from other software or games, as some may not understand. Because GUI has a considerable learning curve, it thus cannot be just “tried”, and if not widely used, everyone would make a decision not to use it before trying it. But it can be said that kiss_sdl is widely used as a GUI toolkit, as GUI toolkits are not used by so many, at least for games. Which is exactly what i want to change, GUI toolkits are too complex, so that some evidently prefer to use not so good options such as command consoles instead, there is a need for a simple generic GUI toolkit.

There are excellent Lazy Foo tutorials about SDL2, but Lazy Foo has not written a tutorial about GUI and may not do it as he is a busy man. kiss_sdl shows how to write a basic GUI in much of the Lazy Foo style, so one may also consider it for learning of how to make GUI.

The reasons why some don’t like this GUI toolkit, are evidently not technical, and also not theoretical. When anyone finds any real technical or theoretical reason why this toolkit is not good for its purpose, that is simple generic (which also means general purpose and complete) GUI toolkit for SDL2, then i will be thankful and very interested to know. But replacing theoretical talk with talk against me as a person is not what i consider competent, so please nothing such or i refuse to talk. The name kiss_sdl is sure a pun intended, but this pun comes from Peter Pan. I of course meant it to mean an acronym “Keep it Small and Simple”, to emphasize that it was made by that principle. As an acronym it should properly be in capital letters though, so KISS_SDL, but as C programmers are used to write everything in lower case letters, it’s thus kiss_sdl.

All that said above, there is no need for such talk for multimedia libraries likely, as they are straightforward, important only that they perform their functions well, and the functions that they have to perform are often self-evident. GUI toolkits are different, as all there depends on how the things are tied together, they are not usable if all that is not done right, more than implementing a separate functions correctly. So a call again for a separate forum for GUI development, as the things discussed here are so different from SDL core development, and thus look unnecessary in SDL development mailing list. Any feedback from any of you is welcome.
kiss_sdl - Simple generic GUI widget toolkit for SDL2


About how to use it, for these who may not know. I will explain how to use it in MinGW, which i think most use, it’s somewhat different for Visual Studio and for other platforms. First install MinGW from there under C:\ , then add C:\mingw-w64\mingw32\bin to Path. Then install 7-zip from (for 64 bit), you need it to extract tar.gz . At that remember to click on the archive name, to open the containing tar archive, and then extract, for the top directory of the repository to be the top directory of the library. The SDL2 libraries can be downloaded from , and , from all of these download the development libraries for MinGW. Now there are different ways of installing SDL2 libraries.

The “official” way is to extract the libraries as they are under C:\ , in the kiss_sdl makefile it is assumed that the libraries are installed in the official way. The other way is to extract the lib, include and bin directories from these libraries for x86_64 (or i686 for 32 bit) into the corresponding directories in MinGW. In that case no paths have to be written on the compiler command line, as the libraries are in standard places, with an additional benefit that all the dll-s of these libraries will be in Path too. This will be similar to how the libraries are installed in Linux, but it’s not the Windows way, as one then cannot see what libraries were installed and cannot use different versions of the libraries. After installing the libraries in the official way, either add the corresponding bin directories of the libraries to Path too, or then copy all dll-s from them to your project’s directory where your code is.

In the makefile it is assumed that the version of SDL is 2.0.7, it will be changed to later versions. If the version is any other than that, change in the makefile 2.0.7 to something else, or whatever the case may be. Also of course comment the lines in makefile for Linux and uncomment the lines for MinGW 64 bit (or 32 bit). When all that is done, the rest is simple. Go to your project’s directory in the cmd command line console, and type mingw32-make -f kiss_makefile , followed by Enter. Then typing kiss_example1.exe or kiss_example2.exe should run the examples. If you write your own makefile, just name it Makefile, and then you can simply run mingw32-make . When you use Code::Blocks, Eclipse, Dev-C++ or any other IDE, write the libraries and the paths from the compiler command line arguments for libraries and for headers (include files) from makefile to project properties somewhere, and you can build your project in the IDE.

Some say that the name kiss_sdl suggests that it is a library to use SDL in a simple way. It is partly true, indeed i found that a lot of the work i did when making kiss_sdl was really general, not special to GUI at all. But at that i thought that GUI is the most complex and thus it is the most important to make it simple. Then considering that the name has to be short, i couldn’t add anything more to it. If i had to name it to anything else, i would call it pgui, which stands for “principal gui”, but then it would not be seen from that name that it is made to be small and simple.

While there is no GUI Development forum, the most appropriate place to talk about GUI toolkits i think is the Game Development forum.
kiss_sdl - Simple generic GUI widget toolkit for SDL2