Code Monkey home page Code Monkey logo

cute_framework's Introduction

Cute Framework (CF for short) is the cutest framework available for making 2D games in 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.

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.h>
using namespace cute;

int main(int argc, const char** argv)
{
	// Create a window with a resolution of 640 x 480.
	app_t* app = app_make("Fancy Window Title", 50, 50, 640, 480, CUTE_APP_OPTIONS_DEFAULT_GFX_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
networking
serialization
string
time
window

Docs by API List

TODO

Examples, Tutorials, and Articles

Download

Fow now it's recommended to build CF from source, at least until CF hits a first official release. See the Building from Source section below.

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

Install cmake. Then 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 build_bash.sh for apple/linux 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

Prebuilt Releases

Prebuilt releases are planned for Windows and MacOS, but not actively setup right now since CF has yet to hit first release. Building from source is recommended for now.

Emscripten Builds

Make sure emscripten is installed on your machine. If on Windows go ahead and run the emscripten.cmd file. This will build libcute.a. Though if you're using something Ninja the commands will be slightly different, as you'll need to consult emscripten docs.

Additionally you can add something like the following to your cmake build script for your own project.

if(${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
	set(CMAKE_EXECUTABLE_SUFFIX ".html")
	target_compile_options(your_game PUBLIC -O1 -fno-rtti -fno-exceptions)
	target_link_options(your_game PRIVATE -o your_game.html --preload-file ${CMAKE_SOURCE_DIR}/content --emrun -O1)
endif()

Also don't forget to call emscripten_set_main_loop from your main function!

cute_framework's People

Contributors

apirux avatar benjamingu avatar chunqian avatar jamiecrisman avatar maximiliankk avatar randygaul avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.