This is a small object oriented GUI toolkit created by Jason Cupp, “forrestcupp” on the forums. It uses SFML as its primary back-end and is released under the zlib/libpng license , so you have the same freedoms with cpGUI that you have with SFML.
The library is currently C++ only. It's extremely easy to use and almost all of the work is done for you. In most controls, the colors, fonts, sizes, and position can all be customized.
Latest Release by pdusen and Recruit0
Download cpGUI v1.5.7 source code, compatible with SFML 1.6
Old Release by forrestcup
Download cpGUI v1.5.6 for SFML 1.5 (2.84MB)
Mirror provided by phear-
cpGUI_15_6.zip
This download includes all of the header files, cpp source code files, and static library files. You can either include the proper .cpp and header files in your project, or you can statically link to the libs. To statically link to the lib files, just unzip the cpGUI folder wherever you want, and set your IDE up to see the paths to the include and lib directories. This is done the same way that is described in the SFML "Getting Started" tutorials. Use the -d.lib files for debug mode. Use cpGUI.lib and cpGUI.h if you want to use all types of controls. To pick and choose, use cpGUI_base.lib and the proper lib files for each control you would like to use.
The download also includes license.txt and dragon.png (public domain) that are both used in the example code. Just set your project up for SFML, include the code files, and put license.txt and dragon.png in the correct directory, and it should all compile just fine.
When creating your own project, make sure to put the cpGUI.h & cpGUI.cpp files in your project and #include “cpGUI.h”.
Please see the example code to learn how to use cpGUI with SFML
8/27/10 - The major guts of the new API are almost complete. Once superclass “menu” is complete (75%), other (more practical) classes can be produced. At the moment, implementation is low priority (expect the next release to be glitchy). Most effort is towards constructing the header files at the moment.
6/18/10 - The original developer (Jason Cupp, “forrestcupp”) no longer has time to develop the library as stated here . Recruit0 and pdusen have taken up development. The current plan is to first make sure that cpGUI works with SFML-1.6 then rewrite a lot of the interface to automate more of the functions (which will shrink the amount of code in main()). Support for the old (current) interface will be dropped once we release the new interface. There may be a Python version eventually but the C++ version will be worked on first. Any other developers are welcome to join the team (within reason).
01:00 GMT - We've released the “legacy” version cpGUI-1.5.7. This release targets SFML 1.6, and should be the last release with this API (unless a major bug is found in the near future). After we release the new API we won't be supporting 1.5.x anymore.
9/29/09 - This update includes a tweak to the way the CheckState() function works. This tweak was pointed out to me by Meltra Bour on the forums. Since CheckState is called every frame, this could hopefully give considerable speed boosts. This update also includes a few minor bug fixes.
Also, with this update, cpGUI now includes a static library! The download includes a cpGUI directory with structured folders for includes, libs, samples, and also the cpp files, if you choose to use it the old way. See the Download section above for instructions.
9/27/09 Major Update - This update includes two of the requests from the forum. I have included SetMouseoverColor() and GetMouseoverColor() functions so that you can customize the “hot”/mouseover colors for each object. I have also separated each control type into its own header and cpp files so that you can include only the types of controls that you need. You have the choice of doing it the old way and lumping them all together, or using only the controls you need. If you want to include all control types, you just need to include cpGUI.cpp and cpGUI.h into your project. The download still includes the cpGUI-example.cpp file to show how to do things this way.
If you want to pick and choose, you must include cpGUI_base.h and cpGUI_base.cpp in your project; that is a requirement. These files include the classes for cpGuiContainer, cpObject, cpButton, and cpScrollBar. These are necessary because other controls depend on them. Aside from that, you may include the header and cpp files for any controls you choose to use. The classes for cpDropDownBox and cpSelectionBox are both in the cpSelection-DropDownBox.h and cpSelection-DropDownBox.cpp files because the drop down box depends on the selection box. There is now a cpGUI-example-partial.cpp file in the download to show you how to do it this way.
Again, if you want to include all of the controls and do it the old way, you don't need to include any of the new files.
Also, version 1.5.5b includes a bug fix with the selection box. Before, there was a bug that when you dynamically RemoveLastChoice() by clicking a certain selection, if the scrollbar is at the bottom, it would throw a runtime error. That bug is fixed now. Thanks to nacsasoft for pointing it out on the forum.
8/13/09 Major Update - I have added a built-in font manager to help save on resources. Now, rather than having a separate font for each object, new fonts are only loaded when necessary. Also, when a font is no longer used by any object, it is automatically deleted. Other than cpGUI's default font, you will never have an unused font in memory. This is all automatic, and it doesn't change how cpGUI is used. Thanks to “Meltra Bour” for pointing out the need on the forums. Thanks to “l0calh05t” & “Wavesonics” for helping me learn how to implement this. - There were also other minor bug fixes in this update.
8/11/09 - “redkiing” has graciously provided me with code to fix a bug where the coordinates weren't updated when the window is resized. This is now fixed, thanks to “redkiing”.
8/8/09 - I have updated my code to use a namespace of cp. The example code is updated showing the difference. I also fixed a small bug with the drop down box where you could click on a selection when the selection box wasn't showing
If you are using cpGUI in Windows, it will try to load the system font (Segoe UI, Tahoma, or Arial as a last resort) with a size of 20 as the default font. If you are not using Windows, you are stuck with SFML's default font until you call the SetFont() function.
Because of SFML's current limitations on setting the font size, cpGUI's SetFontSize() function will actually reload the current font at the new size for better quality. If the current font is SFML's default font, it will just use SFML's built-in SetSize() function. cpGUI has a built in font manager, so only the default font, and the fonts and sizes in use remain in memory.
With cpTextInputBoxes & cpDropDownBoxes, you can change the font, but the font size cannot be changed. The font size is determined by the size of the box.
NOTE: The current version of cpGUI behaves this way but this is planned to be removed in the API.