Vendor libraries
The C and C++ libraries bundled with PaskalCPP, each brought into a program by one import: graphics, windows and input, audio, physics, 3D models, video, compression, a SQL database, scripting, tile maps, JSON and XML, networking, an entity component system, a user-interface toolkit and the stb single-file libraries.
A vendor unit sets the include path, library path and link libraries its library needs on each official target and #includes its headers, so a program writes only import raylib; and calls the library's own C or C++ API (InitWindow, sf::RenderWindow). Nothing else is set up: the names are the library's, as its own documentation spells them. See C++ mixing for how C and C++ mix with PaskalCPP code.
The libraries
| Unit | Library | Version | What it is |
|---|---|---|---|
raylib | raylib | 6.2 | games and graphics: windows, input, 2D / 3D drawing, audio |
rlgl | raylib's rlgl | 6.2 | raylib's OpenGL layer (shaders, vertex buffers, render batch, blend state); built into raylib's library, import rlgl; adds only its header |
rlimgui | rlImGui | main 1550009, Dear ImGui 1.93.0 (docking branch) | Dear ImGui drawn through raylib, docking and its other docking-branch features included |
sdl3 | SDL | 3.4.18 | windows, input, audio, GPU and platform services |
sdl_gp | SDL_gp | upstream | a 2D painter over SDL3's GPU API |
sfml | SFML | 3.1.0 | C++ multimedia: graphics, windows, audio, network |
glfw | GLFW | 3.5.1 | windows, OpenGL contexts and input |
box2d | Box2D | 3.2.0 | 2D physics |
miniaudio | miniaudio | 0.11.25 | audio playback, capture and decoding |
cgltf | cgltf | 1.15 | glTF 2.0 loading and writing |
pl_mpeg | pl_mpeg | upstream | MPEG-1 video and MP2 audio decoding |
zlib | zlib | 1.3.2 | deflate compression |
minizip | minizip | zlib 1.3.2 | .zip archives, password-encrypted included (zlib's own minizip) |
zstd | Zstandard | 1.5.7 | zstd compression, streaming and dictionaries |
sqlite | SQLite | 3.54.1 | an embedded SQL database, in one file or in memory (FTS5, R*Tree, math functions and JSON built in) |
lua | Lua | 5.5.1 | a small, fast scripting language embedded in the program |
mojoal | mojoAL | upstream | OpenAL 1.1 over SDL3's audio: 3D positional sound |
tmxlite | tmxlite | 1.4.5 | Tiled maps: .tmx maps, .tsx tilesets, .tx templates, every layer encoding |
ldtkloader | LDtkLoader | 1.5.3.1 | LDtk projects: .ldtk projects and .ldtkl level files |
pugixml | pugixml | 1.16 | XML reading and writing, XPath |
yyjson | yyjson | 0.13.0 | fast JSON reading and writing |
enet | ENet | 1.3.18 | reliable, ordered packets over UDP, connections and channels |
flecs | flecs | 4.1.6 | an entity component system (its C++ API) |
raven | Raven | main 69877f5 (0.1.2 + 8 commits) | user interfaces: widgets, layout, themes, interfaces described in XML (drawn inside a raylib program by raven_raylib) |
mir | MIR | 1.0.0 | a lightweight JIT compiler: functions built through its C API, or C compiled by its c2mir frontend, generated to native code at runtime |
stb_* | stb | upstream | fifteen single-file libraries (below) |
The stb units are stb_c_lexer, stb_divide, stb_ds, stb_dxt, stb_easy_font, stb_herringbone_wang_tile, stb_hexwave, stb_image, stb_image_write, stb_include, stb_leakcheck, stb_perlin, stb_rect_pack, stb_truetype and stb_vorbis.
- Each library is its official release, built from source for both official targets with the bundled Zig toolchain (SFML: its official prebuilt static libraries); "upstream" marks a library with no release tags, taken from its upstream sources. Raven is built from its main branch: its latest release, 0.1.2, cannot be built as tagged (its build lists a source file the tag does not contain), and main holds 0.1.2 and the fixes after it. Each sits in
res\libs\vendor\<name>asinclude\,lib\<target>\and the library'sLICENSE. - Three libraries are built with fixes over their release: tmxlite loads zstd-compressed layers (the release never decodes them) and skips a base64 layer shorter than the layer instead of reading past it; LDtkLoader's bundled
optionalis renamed out of a name libc++ owns, which broke the Windows link; MIR's two lazy code generation modes work on Windows (four bugs in its Windows code crashed a function's first call or its first basic block). Each fix is dropped once upstream ships it. - MIR's JIT'd code has no unwind information, so a C++ exception must never travel through a JIT'd function: a host routine that JIT'd code calls catches its own exceptions. On Windows a
longjmpover JIT'd code needs_setjmp(buf, NULL). Code c2mir generates calls the C runtime'smemcpy/memset/memmove, which the program hands to MIR like any other import (mir_ext'sMirLoadStdC). Themir_extunit (mir_ext) wraps all of this, so a program using MIR writes no C++; the examples inres\examples\miruse it. ravenkeeps, beside itsLICENSE, theNOTICE,THIRD_PARTY.mdandlicenses\folder its Apache-2.0 license asks to travel with it.tmxlitebrings inzlib,pugixmlandzstditself, so a Tiled map's every layer encoding (CSV, base64, zlib, gzip, zstd) loads with onlyimport tmxlite;.- The libraries are static and linked into the program:
bin\holds only the program, and its.pdbatdebugon Windows. - A Linux build links the system libraries a vendor library needs (libX11, libGL and their kin) from
res\libs\vendor\linux64\lib, and headers zig does not ship for Linux (GL/gl.h) come fromres\libs\vendor\linux64\include, so a vendor import builds the same way on both targets. The program runs against the libraries the Linux system has. stb_image_resize2andstb_sprintfwere removed in 0.2: upstream moved both headers to its deprecated folder, and PaskalCPP ships only what the current upstream holds.
raylib_ext and sfml_ext add PaskalCPP's own extensions on top of raylib and SFML: see raylib_ext and sfml_ext. rlimgui_ext runs Dear ImGui inside raylib_ext's frame window, at its virtual resolution: see rlimgui_ext. raven_raylib makes Raven the user interface of a raylib program: raylib keeps the window, the loop, the audio and the game's drawing, Raven lays out and draws its widgets over it (an XML window, its theme, its fonts and images), and a raylib render texture can be shown inside a Raven widget: see raven_raylib.
A library that loads files can load them from the shared password zip assets.zip as well, through HookIO (HookIO):
mojoal_ext,sqlite_ext,tmxlite_extandldtk_extadd load forms that take an IO or a zip entry (archive, entry, password): see mojoal_ext, sqlite_ext, tmxlite_ext and ldtk_ext.tmxlite_extandldtk_extalso load a map's tilesets and images and draw it with raylib, so a map loads and draws in a few lines.- Lua's
luaL_loadfile, yyjson'syyjson_read_fileand every Raven load (a theme, an XML window and the images and fonts it names, a font, a texture) already read throughHookIOas they are: anio://path fromRegisterIOreaches the zip with no extension unit. Raven's live reload follows files on disk by their time stamps, so a file it loaded from a zip is never reloaded. - ENet and flecs load no files.
Examples
Every bundled example in res\examples builds on both official targets with no reports. Open the folder from the editor with File > Show Examples (The editor).
| Library | Examples |
|---|---|
| raylib | raylib\BasicWindow, RaylibZip (textures, a font, sounds and music from the shared password zip assets.zip), RaylibVideo |
| rlImGui | rlimgui\Editor, Simple |
| SDL3 | sdl3\SdlWindow |
| SDL_gp | sdl_gp\Painter |
| SFML | sfml\Network, Shapes; with sfml_ext: DefaultFont, ExtWindow, MessageBoxes, Mixer, VideoPlayer, ZipAssets, ZipPlayer |
| GLFW | glfw\GlfwWindow |
| Box2D | box2d\FallingBoxes, Playground |
| miniaudio | miniaudio\MiniaudioDecode, PlaySound |
| cgltf | cgltf\RoundTrip |
| pl_mpeg | pl_mpeg\PlmpegDecode |
| zlib | zlib\Compress (compress and uncompress a text, its crc32 checked) |
| minizip | minizip\PasswordZip (a password-encrypted .zip written beside the program and read back) |
| SQLite | sqlite\SqliteBasics; with sqlite_ext: SqliteZip (a database read from assets.zip) |
| Lua | lua\LuaScripting, LuaScriptingZip (a script luaL_loadfile reads from assets.zip) |
| mojoAL | with mojoal_ext: mojoal\Mojoal3DSound, Mojoal3DSoundZip |
| tmxlite | with tmxlite_ext: tmxlite\TiledTown, TiledTownZip |
| LDtkLoader | with ldtk_ext: ldtkloader\LdtkTown, LdtkTownZip |
| yyjson | yyjson\JsonConfig (a settings file with defaults, written back), JsonConfigZip |
| ENet | enet\EnetChat (a server and three clients in one program) |
| flecs | flecs\FlecsBoids (a flock of boids run by flecs systems, drawn with raylib) |
| Raven | with raven_raylib: raven\RavenRaylib, RavenRaylibZip (a window, its theme, image and font from assets.zip), RavenGameUI (a game's menus, settings, HUD, inventory and dialogue, designed in XML), RavenEditor (a 3D scene editor: menus, a scene tree, an inspector, raylib's scene in a Viewport) |
| stb | stb\FontGlyph, Noise, VorbisInfo |
| Console | console\ConsoleDemo |
The twelve stb units no example uses import together into one program on both official targets:
module exe modules_stb;
import
stb_c_lexer,
stb_divide,
stb_ds,
stb_dxt,
stb_easy_font,
stb_herringbone_wang_tile,
stb_hexwave,
stb_image,
stb_image_write,
stb_include,
stb_leakcheck,
stb_rect_pack;
begin
println("12 stb units imported");
end.