Skip to content

Repository files navigation

cpp-Utilities

C++ utility classes that I have made during other projects and think would be useful for other applications

Some of the classes are built for the "Simple and Fast Multimedia Library" (SFML) and the "Texus' Graphical User Interface" (TGUI)

This library is also used in my Networking library and Game Framework

Libs:

- Static libs on Windows
- Shared libs on Linux

Tested with:

Linux:

- Compiler: g++
- Version: g++ (GCC) 15.1.1 20250425

Windows:

- Compiler: x86_64-w64-mingw32-g++
- Version: x86_64-w64-mingw32-g++ (GCC) 15.1.0
- Version: 3.0.0
- Version: 1.9.0

Utilities breakdown

FileBrief DescriptionDependencies
funcHelper.hppMakes taking, storing, and using functions as variables easier. Functions set can have dynamic data given to them when the function is invoked.None
EventHelper.hppEvent class with thread-safety. Functions set to an event can have dynamic data given when the event is invoked.None
StringHelper.hppSimple class for common string operations like trimming and converting char to lowercase. Includes functions for converting a string to float, int, etc.None
UpdateLimiter.hppUsed to limit the speed of a threadNone
Stopwatch.hppUsed to check how long operations takeNone
Log.hppSimple class that prints logs into a fileNone
iniParser.hppEasy to use ini parserStringHelper.hpp
CommandHandler.hppUsed to create and use commands. The command handler also has the ability to search commands.funcHelper.hpp, StringHelper.hpp
CommandPrompt.hppSimple command prompt that uses the command handler as its backendCommandHandler.hpp, StringHelper.hpp, TGUICommon.hpp, TGUI
TerminatingFunction.hppFunctions that will be called every frame until it says it is done runningfuncHelper.hpp
TFuncDisplay.hppSimple display for terminating functions for debuggingTerminatingFunction.hpp, TGUICommon.hpp, TGUI, CommandHandler.hpp (optional)
LiveVar.hppLive variables are used for debugging and testingEventHelper.hpp, funcHelper.hpp, SFML Events, CommandHandler.hpp (optional)
VarDisplay.hppSimple display for live vars, which shows all the current live vars and their valuesLiveVar.hpp, TGUICommon.hpp, TGUI, CommandHandler.hpp (optional)
GraphData.hppUsed to store data used for Graph.hppSFML Color and Vector2, StringHelper.hpp
Graph.hppA simple graph drawing class. Can draw any of the following Histogram, Bar, Scatter, and Line graphs. Can draw to a SFML texture or straight to the windowGraphData.hpp, StringHelper.hpp, Spline.hpp (from here)
TGUICommon.hppSimple classes with features that I find myself using oftenTGUI, CommandHandler.hpp (optional)
TestHelper.hppHelper for testing a function or a sequence of functions runtimeSFML Window, SFML Graphics, TGUI, iniParser.hpp, Stopwatch.hpp, funcHelper.hpp, Graph.hpp

A preview of a few utilities

Note that the theme can be set to any TGUI theme, and the utilities UI will update accordingly.

Command Prompt

Firstly, to open and close the command prompt, you can use the tilde key (~)

image

To get a list of commands, use the command help

image

To find out more about a specific command, type help 'command'

image

Untitledvideo-MadewithClipchamp-ezgif com-video-to-gif-converter

Var Display and Live Var

Live vars can have key binds set to them for specific values or to increment them.

Example:

2024-01-1419-44-59-ezgif com-video-to-gif-converter

Example usage with command prompt:

VarDisplayAndCommandPrompt.mp4

Terminating Functions Display

Display for seeing the name and total time of each terminating function

image

TFunc

Graphing Class

Simple Graphing class that supports line graphs, bar graphs, scatter plots and histograms.

imageimageimageimageimageimage

Graph

Test Helper

Helper for testing a function or a sequence of functions runtime

Testing UI

image

Test Graphing UI

image