A lightweight and cross-platform game/tools development library for C++
- works on Windows, macOS, Linux
- never takes over your
main()function - no need for an explicit initialization function call like
library_init() - error handling is primarily performed using exceptions rather than return values (following the conventions of C++ standard libraries)
- supports multi-window application development
examples/: example codesinclude/: include directorysrc/: source codeCMakeLists.txt: CMake settings fileREADME.md: this file
- CMake is required to install for build.
- Vulkan SDK is required to install.
- on macOS, you need to run
source setup-env.shto load environment variables.
- on macOS, you need to run
This is the simplest code to use BrightCpp.
#include <brightcpp/brightcpp.hpp>
#include <iostream>
int main() {
try {
bgt::window wnd;
while (bgt::frame_update()) {
}
} catch (std::exception &e) {
std::cerr << "error: " << e.what() << std::endl;
}
}Since BrightCpp uses exceptions to handle errors, we recommend you to wrap whole code in try block if you aren't developping throwaway codes.
BrightCpp can be load by FetchContent in CMake.
include(FetchContent)
FetchContent_Declare(
brightcpp
GIT_REPOSITORY https://github.com/Kiterai/BrightCpp.git
GIT_TAG main
)
FetchContent_MakeAvailable(brightcpp)then, you can easily link:
add_executable(app main.cpp)
target_link_libraries(app PRIVATE brightcpp)- CMake
- Vulkan SDK >= 1.3.283
- X11 development package(only on Linux)
git clone https://github.com/Kiterai/BrightCpp.git
cd BrightCpp
cmake . -B build
cmake --build ./build
If you want to build example codes under examples/, you might use -DBUILD_EXAMPLES=ON at configuration.