Flare C++ runtime.
There are a few libraries in this repository:
Includes linear algebra for 2d vectors, matrices, bounding boxes, etc.
Manages a Flare file's contents, loads them, etc.
Rendering implementation with Skia. If you are trying to compile the example app, make sure you read about how to compile dependencies.
Using GENie.
Instructions should be similar on other platforms.
Set it up as follows (use your own ~/Projects
base dir).
cd ~/Projects
git clone git@github.com:bkaradzic/GENie.git
cd genie
make
Add to PATH, for example in ~/.bash_profile
export PATH=$PATH:~/Projects/genie/bin/darwin
If you are using VSCode and have opened the flare.code-workspace, you can simply hit F5 to build and debug. Alternatively, several tasks are available in each project to build and generate compile commands.
Easy way via command line:
cd example
./build.sh
Using build system (you can adapt this to your own platform):
cd example/build
genie ninja
make
Install cquery in order to get code completion/jump to definition/hints in VSCode.
brew install --HEAD cquery
You can invoke generate_compile_commands.sh
in this folder to generate all the necessary compile commands for the various projects.
./generate_compile_commands.sh
If you want to re-generate them per project, you can use the command pallette in VSCode.
command+p
Tasks: Run Task
generate compile commands
To do it manually:
genie ninja
ninja -C debug -t compdb cxx > ../compile_commands.json
If you don't have clang installed:
brew install llvm
Install Clang-Format in VSCode and make sure your settings are configured correctly. For example:
settings.json
"[cpp]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"clang-format.executable": "/usr/local/opt/llvm/bin/clang-format"
Install the vscode-cpptools extension (simply called C/C++ in the extension browser). Press F5 and everything should already be configured for you (at least on OSX, PRs welcomed for other platforms).
We suggest disabling the cpptools intellisense engine in favor of the cquery one mentioned above. You can do this in your settings.json:
"C_Cpp.autocomplete": "Disabled",
"C_Cpp.formatting": "Disabled",
"C_Cpp.errorSquiggles": "Disabled",
"C_Cpp.intelliSenseEngine": "Disabled",
Take a look at the dependencies/make_dependencies.sh file.