• Stars
    star
    535
  • Rank 82,940 (Top 2 %)
  • Language
    C
  • License
    Other
  • Created over 5 years ago
  • Updated 29 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The *cutest* framework out there for creating 2D games in C++!



GitHub Workflow Status Discord

Cute Framework (CF) is the cutest framework available for making 2D games in C++. It provides a portable foundational layer for building 2D games in C/C++ without baggage, gnarly dependencies, or cryptic APIs. CF runs almost anywhere, including Windows, MacOS, iOS, Android, Linux, Browsers, and more!

NOTE: Cute Framework is currently in flux for it's v1.0 release! These notes/docs will be changed as they get rolled out and come online.

Download and Setup

The easiest option is to head over and pickup the latest pre-built version This link is currently out of date, and awaiting the soon to be v1.0 release (see below for building latest from source). You can link your project against CF as either a static or shared library. Be sure to also visit the Cute Framework documentation site.

Example Game Window

Creating a window and closing it.

#include <cute.h>
using namespace Cute;

int main(int argc, char* argv[])
{
	// Create a window with a resolution of 640 x 480.
	int options = APP_OPTIONS_DEFAULT_GFX_CONTEXT | APP_OPTIONS_WINDOW_POS_CENTERED;
	Result result = make_app("Fancy Window Title", 0, 0, 640, 480, options, argv[0]);
	if (is_error(result)) return -1;

	while (app_is_running())
	{
		app_update();
		// All your game logic and updates go here...
		app_draw_onto_screen();
	}

	destroy_app();

	return 0;
}

Building from Source

Another option for those familiar with CMake is to build from source with CMake. Make sure you have a compiler installed that you're familiar with beforehand. If you're new to C/C++ I highly recommend using Microsoft Visual Studio (Community Edition), for Windows users. If you don't like Visual Studio you can try gcc/g++ (MinGW), tdm-gcc is recommended in this case. If you're MacOS, XCode (and the command line tools) are recommended. For Linux you'll probably use g++.

  1. Download and install CMake (v3.14 or higher, you can just get the latest version). CMake is for easy cross-platform building. Also install git. If you're new to git and a Windows user it's highly recommended to use Github Desktop.
  2. Copy CMakeLists.txt (this one here) into the top-level of your project directory.
  3. Find + replace "mygame" to your game name (no underscores, spaces, or special characters allowed).
  4. Make a folder called src in the top-level of your project, and place your initial main.cpp there.
  5. Run CMake on your project folder. If you need help with this step, try reading a setup guide for CF here: CF - CMake 101.

Note For Linux users make sure to you have OpenGL, gcc/g++, etc. installed and setup. You can try these commands:

sudo apt-get update -qq
sudo apt-get install build-essential gcc-multilib cmake
sudo apt-get install libasound2-dev libpulse-dev 
sudo apt-get install -y --no-install-recommends libglfw3 libglfw3-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libxext-dev libxfixes-dev

Note On WSL2 you may also need sudo apt install libpulse0.

Note For non-Apple ARM platforms (like Raspberry/Orange Pi) you may need to define CUTE_SOUND_SCALAR_MODE to disable SSE intrinsics. Ideally CF could use preprocessor directives to define this for you -- pull requests are highly appreciated here!

Resources

The documentation website is the go-to place for finding all the resources available. Here are some quick-links to get you started:

If you're stuck and need help then check out the Discord chat. Feel free to pop in and ask questions, make suggestions, or have a discussion. General gamedev chatting unrelated to CF is also welcome!

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.

More Repositories

1

cute_headers

Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
C
4,259
star
2

qu3e

Lightweight and Simple 3D Open Source Physics Engine in C++
C
923
star
3

ImpulseEngine

Simple, open source, 2D impulse based physics engine for educational use.
C++
323
star
4

AsciiEngine

Game engine written in C to create Ascii art games within the Windows console.
C
130
star
5

C-Hotloading

Example of MSVC makefile project for hotloading C with intellisense/debugger compatability
C++
106
star
6

player2d

Educational demo implementing a swept 2D character controller
C
89
star
7

kk_slides

Some "slides" about coroutines in C
C
34
star
8

tinycavestory

Little demo of platforming and sprite batching via tinyheaders and Cave Story art
C
32
star
9

cute_snake

Snake example game written with Cute Framework
C++
17
star
10

Serialization_C

Serialization and Reflection proof of concept in C
C
13
star
11

CF_Lua

C
10
star
12

cute_headers_deprecated

Collection of deprecated cute headers
C
10
star
13

block_man

Block Man - A silly game, the first game ever made with Cute Framework
C++
9
star
14

randygaul.github.io

Ruby
6
star
15

GAM_150_SampleEngine

C
5
star
16

game_math_101

Materials for the blog post: Game Math 101, Writing your Own Math in C++
C
5
star
17

d3d9-Render-to-Texture

Example of Rendering to Texture via D3D9
C++
5
star
18

cute_pong

Pongish written in C++ with Cute Framework
C++
5
star
19

cf_net_test

Messing around with and testing client/server networking from Cute Framework
C++
4
star
20

GAM150Slides

GAM 150 Lecture Slides by Randy Gaul
3
star
21

pook

C
3
star
22

MetaData_Part5_Serialization

C++
3
star
23

cute_jam_2018

C
2
star
24

oop

Example of oop vs non-oop C++
C++
2
star
25

MetaData_Part4_Variant

C++
1
star
26

SimpleLuaBind

C
1
star
27

cute_framework_project_template

Copy + pastable CMake project template for Cute Framework
CMake
1
star
28

Scripting

Simple proof of concept for a domain specific language in C
C
1
star