Graphics and Games
FAQ
-
If I wanted to use the Boost libraries in conjunction with a graphics library, to write a 3D game, what graphics library would be most compatible with Boost?
The following libraries work well with Boost because they don’t impose custom build systems or incompatible runtime dependencies — they’re just C++ libraries, and that’s exactly Boost’s domain.
Graphics Library Why It’s Compatible with Boost Ideal Boost Libraries to Pair Modular, C++03/11 compatible, uses STL-style containers and patterns similar to Boost
Boost.Filesystem, Boost.SmartPtr, Boost.Signals2, Boost.Asio
Minimal dependencies, works well with Boost threading and filesystem
Modern, header-only components, great for C+17 and fits Boost idioms
Easy to integrate with Boost for physics, networking, or file I/O
Boost helps manage complexity: asynchronous loading, configuration, math, logging
-
What would be the simplest solution to 3D graphics and Boost working in harmony?
Probably the Ogre3D graphics library, working with Boost.Filesystem for asset control and Boost.Asio for networking.
-
What games systems are well matched with Boost libraries?
Here’s how Boost might slot into a 3D game engine:
System Boost Library Purpose Asset Loading
Cross-platform file handling
Entity Updates
Event-driven game logic
Network Multiplayer
Async client/server or peer/peer communication
Configuration
Game settings, config files
Logging
Diagnostics and crash reporting
Physics or AI Math
Physics, spatial logic
Texture/Image Manipulation
Procedural textures, screenshots
Multithreading
Game loop or rendering pipeline parallelism
-
Are there any graphics libraries that are problematic when combined with Boost libraries?
Both Qt and Unreal Engine are heavy frameworks that conflict with Boost’s philosophy - they replace parts of the STL and introduce their own type systems, both of which can cause serious compatibility issues. Also, DirectX libraries might limit your portability and don’t align well with Boost’s cross-platform goals.
-
Am I right that the best scripting languages to work with a C++ game engine are Lua and AngelScript, or are there others I should consider?
Yes these two are great choices. The important distinction is whether you want a small embedded scripting language, a full general-purpose language, or a language with strong C++-like syntax:
Language C++ integration Runtime footprint Syntax Particularly good for Lua
⭐⭐⭐⭐⭐
⭐⭐⭐⭐⭐
Simple/dynamic
Gameplay, mods, configuration
AngelScript
⭐⭐⭐⭐⭐
⭐⭐⭐⭐
C++-like/static
Gameplay programmers
Squirrel
⭐⭐⭐⭐
⭐⭐⭐⭐
C++/Java-like
Gameplay and modding
Wren
⭐⭐⭐⭐
⭐⭐⭐⭐
Modern/OOP
Small custom engines
ChaiScript
⭐⭐⭐⭐⭐
⭐⭐⭐
C++-like
C++ centric projects
Lua was specifically designed as an embeddable language, and its official implementation is a relatively small C library with a C API. The current Lua release is 5.5. The big advantage isn’t just performance. It’s the boundary between C++ and the script, attractive when you want designers or modders to manipulate the game without exposing your entire C++ implementation.
AngelScript is probably the most interesting alternative if your programmers are primarily C++ programmers. Its syntax deliberately resembles C++, and it is statically typed. The embedding model has the application register the functions, properties and types that scripts are permitted to access. Scripts are then compiled into bytecode executed by its VM.
Squirrel is worth knowing about because it occupies an interesting middle ground. It has C/Java/C++-like syntax while retaining some of Lua’s scripting philosophy. It has also been used in games, including Left 4 Dead 2. Perhaps it is less compelling than Lua or AngelScript for a new engine, though.
Wren is the intriguing lightweight alternative. It’s designed specifically to be embedded and has a relatively modern object-oriented language design. Elegant and lightweight, but much smaller ecosystem (tools, examples, documentation, users, etc.). Current comparisons still tend to describe Wren as a niche embedded option.
ChaiScript is an exceptionally good name for a scripting language! It is a lightweight scripting language designed specifically to be embedded in C++ applications, with the interesting goal of making the boundary between C++ and scripting unusually natural. The engine can expose selected C++ functions, classes, and objects to scripts. This makes it particularly attractive for gameplay logic, configuration, AI behavior, event handling, and modding.
-
Do Boost libraries work well with the scripting languages mentioned above?
Yes, general purpose Boost functionality can set well underneath Lua and AngelScript. ChaiScript works with a particularly natural C++ syntax and should work smoothly with most Boost libraries. For Squirrel and Wren the answer would be more application-specific - so it would depend on what you are trying to build - so some investigation needed.
C++ GAME ENGINE │ ┌─────────────┼─────────────┐ │ │ │ Lua AngelScript ChaiScript │ │ │ lightweight C++-like C++-like dynamic static dynamic-ish │ │ │ └─────────────┼─────────────┘ │ Boost libraries ┌─────────────┼─────────────┐ │ │ │ Asio JSON System Beast Filesystem Log Math Random Test Graph Serialization