A creative coding library.
Platform | Build status |
---|---|
macOS | |
Ubuntu linux | |
Windows - VS 2019 | |
Windows - VS 2022 |
Hi! This is the origin of the Framework creative coding library.
Framework is a creative coding library developed in C++. It includes support for drawing images and playing sounds with one line of code, facilitating very rapid prototyping during creative code jams or workshops. It also includes easy access to keyboard, mouse and up to four gamepads. Shader programming is easy using the Shader class. All resources (images, sounds, shaders and more) can be tracked in real-time and hot-reloaded when changed.
In addition to the library itself, the code available here also includes a few side-projects built using Framework, including audiograph
and vfxgraph
. audiograph
is a node based sound synthesis library and editor, while vfxgraph
is intended for visuals and control. Both are built on top of avgraph
, which provides a node based editor similar to VVVV and TouchDesigner.
The philosophy behind the design of Framework is that it should be fun to do coding!
As such, its language tries to be pragmatic and sparse, optimized for expression. The build system makes it easy to add apps and libraries and distribute packages. Code longevity is extended through a careful design of its vocabulary, slowly accumulating new functionality over time as it is needed. Build-times are kept low (usually a second or less) through careful monitoring and optimization of build times. Iteration is kept fast, through hot-reloading of resources when they are changed, and by delaying loading resources at startup until they are used (with full resource pre-loading being available for distributing builds).
In summary,
framework
repository,framework
repository,Step by step:
cd ~
git clone https://github.com/marcel303/framework
git clone https://github.com/<your-account>/<your-project>
Clone framework
submodules,
cd ~
cd framework
git submodule update --init --recursive
Create a text file named chibi-root.txt
with the following contents,
cd ~
vim chibi-root.txt
add_root framework
This will create a chibi root file referencing the chibi root file in the framework
repository.
Generate the project file,
On linux/macOS,
cd ~
cd framework
./generate.sh
On Windows,
cd framework
generate.bat
The project file generator should open Finder on macOS, with Project.xcodeproj
focused, or Explorer on Windows, with Project.sln
focused.
Open the generated project file in your favourite ide. To run one of the example apps, select the target and build and run it.
To use framework
within your own apps, you will need to,
chibi.txt
file for your app(s),Step by step:
Create a folder and a chibi.txt
file,
cd ~
mkdir myapp
Create a chibi.txt
file within the myapp
folder with the following contents,
cd myapp
vim chibi.txt
app myapp
depend_library framework
add_files main.cpp
Create a main.cpp
file,
#include "framework.h"
int main(int argc, char * argv[])
{
setupPaths(CHIBI_RESOURCE_PATHS);
if (!framework.init(800, 600))
return -1;
for (;;)
{
framework.process();
if (framework.quitRequested)
break;
framework.beginDraw(0, 0, 0, 0);
{
setColor(colorWhite);
drawRect(100, 100, 200, 200);
}
framework.endDraw();
}
framework.shutdown();
}
Add your chibi file to chibi-root.txt
,
cd ~
vim chibi-root.txt
add_root framework
add myapp
Generate the project file,
cd ~
cd framework
./generate.sh myapp
Note that the target to generate the project file for is set to myapp
. This will generate a project file tailored to build and run myapp
only. If you want to add more targets to your project file, that's possible too. Just append the targets you want to generate to the command line.
For instance,
./generate.sh myapp vfxgraph-*
Note that the wildcard *
means we will generate all of the libraries and apps with a name starting with vfxgraph-
. These are all of the vfxgraph library example apps.
There's a few user-contributed apps and libraries inside the users/marcel
folder. The chibi root file for these projects isn't hooked up by default. You can add users/marcel/chibi-root.txt
to your root file and generate these apps and libraries. This folder is where I develop new ideas, and add prototypes for libraries, that may eventually be included in a next version of framework.
Framework includes a few 3rd party library integrations out of the box, including,
This is a list of libraries made readily available through this repository.
vfxgraph
Node based visuals and controlvfxgraph
is a visual node based system, adopting the data-flow paradigm to programming.vfxgraph
makes it easy to add new node types by either hand-crafting a types.xml file, or by defining them in code.audiograph
Sound synthesis and performance demo4dworld
is a sound synthesis and performance tool, using the graph editor included with avgraph
to modularly design sounds and effects.4dworld
includes an audio synthesis backend which makes it easy to experiment with sound design in real-time. It extends real-time editing by propagating changes to all instances of a graph.audiograph
instance for its sound synthesis.For questions or suggestions, send me an e-mail at marcel303 [at] gmail.com, or reach out to me on Github.