build compile / build run without a prior configure. Use build configure only when you explicitly want generated Visual Studio, XCode, or Make projects._Build/_Projects. SC build compile) executables will be at _Build/_Outputs/${platform}-${arch}-${build}-${compiler}-${config}/${EXAMPLE_NAME}.| 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 the first build compile / build run, or during build configure if you are generating projects explicitly |
| Run (Posix) | ./SC.sh build run SCExample (will also compile before running) |
| Run (Windows) | SC.bat build run SCExample (will also compile before running) |
| Run (Native) | ./SC.sh build run SCExample --config Debug or SC.bat build run SCExample --config Debug |
| Debug (VSCode) | Select correct SCExample $ARCH ($PLATFORM) for your system and press Start Debugging (F5) |
| Debug (XCode) | Run ./SC.sh build configure, then open _Build/_Projects/XCode/SCWorkspace/SCWorkspace.xcworkspace and choose the SCExample scheme |
| Debug (VS2022) | Run SC.bat build configure, then open _Build/_Projects/VisualStudio2022/SCWorkspace/SCWorkspace.sln and start Debugging (F5) |
| Property | Value |
|---|---|
| Location | Examples/AsyncWebServer |
| Description | Simple Http server listening on port 8090 by default, serving a folder for a static website. |
| Purposes | Show how to create an http server with a runtime configurable set of buffers |
| Prerequisites | Linux: None |
| Windows: None | |
| macOS: None | |
| Dependencies | None |
| Run (Posix) | Examples/AsyncWebServer/BuildAndRun.sh (will also compile before running) |
| Run (Windows) | Examples/AsyncWebServer/BuildAndRun.bat (will also compile before running) |
| Parameters | All parameters can be added after BuildAndRun for example BuildAndRun.sh --directory /somedir: |
--directory /path/to/dir: Serves the given folder | |
| Debug (XCode) | Run ./SC.sh build configure, then open _Build/_Projects/XCode/SCWorkspace/SCWorkspace.xcworkspace and choose the AsyncWebServer scheme |
| Debug (VS2022) | Run SC.bat build configure, then open _Build/_Projects/VisualStudio2022/SCWorkspace/SCWorkspace.sln and start Debugging (F5) |
Some relevant blog posts are:
| Example | Description |
|---|---|
| AwaitBackgroundDigest | Shows ThreadPool-backed CPU work with AwaitEventLoop::loopWork() and caller-owned result jobs |
| AwaitBackgroundJobs | Shows detached background coroutines through fixed caller-owned AwaitTaskRegistry slots |
| AwaitCallbackBridge | Shows callback-style Async and coroutine-style Await sharing one caller-owned event loop |
| AwaitConfigReload | Shows spawnAndWait() for a single child coroutine that loads a config file |
| AwaitDatagramPing | Shows UDP request/reply with AwaitEventLoop::sendTo() and receiveFrom() |
| AwaitDeadline | Shows a child coroutine deadline with waitFor() and cooperative cancellation |
| AwaitEcho | Shows a tiny TCP echo conversation with AwaitTaskGroup and caller-owned allocator storage |
| AwaitFileCourier | Shows file copy followed by AwaitEventLoop::fileSend() over a socket |
| AwaitFilePatch | Shows offset fileWrite() followed by fileRead() using caller-owned buffers |
| AwaitFirstResponse | Races two caller-owned registry jobs with waitAny() and cancels the slower response |
| AwaitLineProtocol | Shows a tiny CRLF text protocol with receiveLine(), sendAll(), and caller-owned allocator storage |
| AwaitManifestPreview | Shows bounded fileReadUntilFullOrEOF() into caller-owned preview storage |
| AwaitProcessExitCodes | Shows concurrent child-process exit waits with processExit() and fixed job storage |
| AwaitTaskGroupFiles | Shows AwaitTaskGroup fan-out over two file reads with caller-owned task storage |
| AwaitThreadWakeUp | Shows another thread waking an Await coroutine through AwaitLoopWakeUp |
| Serialization | Use Reflection and Serialization to persist application state |
| WebServer | Use Http to statically host a website from a specified directory |
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