Cute Framework (CF for short) is the cutest framework available for making 2D games in C/C++. CF comprises of different features, where the various features avoid inter-dependencies. In this way using CF is about picking and choosing which pieces are needed for your game. Here's a video from the Handmade Seattle conference talking all about CF if you're interested in some more juicy background deets.
CF is not quite ready for the official first release! This repository is public to prepare for first release, so expect breaking changes and use at your own peril, etc. Most notably the networking features are not ready.
You've been warned!
Gettin' all Cute
Setting up an application and getting started is quite easy. Simply visit the app docs, grab the following code snippet for app_make, and off you go.
Creating a window and closing it.
#include <cute/cute.h>
using namespace cute;
int main(int argc, const char** argv)
{
// Create a window with a resolution of 640 x 480, along with a DirectX 11 context.
app_t* app = app_make("Fancy Window Title", 50, 50, 640, 480, CUTE_APP_OPTIONS_D3D11_CONTEXT, argv[0]);
while (app_is_running(app))
{
float dt = calc_dt();
app_update(app, dt);
// All your game logic and updates go here...
app_present(app);
}
app_destroy(app);
return 0;
}
Docs by API Category
Select one of the categories below to learn more about them. Each category contains information about functions, structs, enums, and anything else relevant in the various Cute Framework header files.
app
audio
clipboard
data structures
ecs
graphics
math
serialization
string
time
window
Docs by API List
TODO
Download
Prebuilt binaries for Windows are available in the releases section. Please build and install from source for Mac/Linux users. Note - CF is designed for 64-bit only.
Community and Support
Feel free to open up an issue right here on GitHub to ask any questions. If you'd like to make a pull request I highly recommend opening a GitHub issue first to start a discussion on any changes you would like to make.
Here's a link to the discord chat for Cute Framework and the Cute Headers. Feel free to pop in and ask questions, make suggestions, or have a discussion.
Another easy way to get a hold of the author of Cute Framework is on twitter @randypgaul.
Building from Source
It's highly recommended to download a prebuilt version of CF if you're on Windows found in the releases section, but if you're not on Windows cmake can be used to build and install from source.
Install cmake. Make sure to install libsodium. If you're on Mac you can use brew to install Sodium. On Windows/Emscripten prebuilt binaries for libsodium are already provided. Perform the usual cmake dance (make folder, -G to generate the build files, and then finally trigger the build), for example on Windows with Visual Studio 2019.
mkdir build_msvc_2019 > nul 2> nul
cmake -G "Visual Studio 16 2019" -A x64 -Bbuild_msvc_2019 .
cmake --build build_msvc_2019 --config Debug
cmake --build build_msvc_2019 --config Release
Some scripts for running this cmake process are laying around in the top-level folder, such as apple_make.sh
for apple machines, or mingw.cmd
for building against a MingW compiler on Windows. Feel free to use or ignore these scripts as you wish.
Once built go ahead and use cmake to install the headers and shared library for CF.
cmake --install your_build_folder_name