Sane C++ Libraries
C++ Platform Abstraction Libraries
Examples

Examples

Note
All of the examples assume build configure to be already run, as described in Building Contributor:
  • Windows: ./SC.sh build configure
  • Posix: SC.bat build configure

SCExample

Property Value
Location Examples/SCExample
Description Simple immediate mode gui application using sokol and dear imgui libraries pausing in absence of inputs and I/O to save CPU time
Purposes Use SC::Build to build on macOS, windows and linux and SC::Async as I/O event Loop
Use Plugin and FileSystemWatcher libraries implementing hot-reload
Prerequisites Linux - Fedora: sudo dnf install mesa-libGL-devel mesa-libEGL-devel libX11-devel libXi-devel libXcursor-devel
Linux - Ubuntu: sudo apt-get install libgles2-mesa-dev libx11-dev libxi-dev libxcursor-dev
Windows: None
macOS: None
Dependencies sokol and dear-imgui are automatically downloaded during ./SC.sh build configure or SC.bat build configure
Run (Posix) ./SC.sh build run SCExample
Run (Windows) SC.bat build run SCExample
Debug (VSCode) Select correct SCExample $ARCH ($PLATFORM) for your system and press Start Debugging (F5)
Debug (XCode) Open _Build/_Projects/XCode/SCExample.xcodeproj and choose Product --> Run
Debug (VS2022) Open _Build/_Projects/VisualStudio2022/SCExample.sln and start Debugging (F5)

Examples

Example Description
Serialization Use Reflection and Serialization to persist application state
WebServer Use Http to statically host a website from a specified directory

Where can I find more examples?

  • The test suite is the closest thing to additional examples you can find in this project.
  • The second best thing to do is looking at SC::Tools implementation.
  • Documentation for each library has some examples and / or code snippets that you can look at.

Where can I learn more?

There are many way to learn about the library:

https://github.com/user-attachments/assets/2a38310c-6a28-4f86-a0f3-665dc15b126d https://github.com/Pagghiu/SaneCppLibraries/assets/5406873/5c7d4036-6e0c-4262-ad57-9ef84c214717