{"id":13619916,"url":"https://github.com/alxm/faur","last_synced_at":"2025-10-28T09:36:32.451Z","repository":{"id":1576893,"uuid":"2027667","full_name":"alxm/faur","owner":"alxm","description":"⚒️✨ My personal C games framework. 2D graphics, sound, inputs, states, ECS, and misc utils for data, files, math, memory, strings, time, and more. Builds for Linux, Windows, Web, and embedded devices.","archived":false,"fork":false,"pushed_at":"2024-10-21T03:10:23.000Z","size":4986,"stargazers_count":82,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T17:17:20.517Z","etag":null,"topics":["2d-game-framework","2d-graphics","arduino","arduino-library","c","c99","caanoo","emscripten","game-development","gamebuino-meta","gamedev","gamedev-framework","gp2x","gp2x-wiz","linux","mingw","odroid-go","pandora-console","sdl","sdl2"],"latest_commit_sha":null,"homepage":"https://www.alxm.org","language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alxm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-07-10T23:01:28.000Z","updated_at":"2025-03-27T12:39:59.000Z","dependencies_parsed_at":"2024-12-24T19:12:03.486Z","dependency_job_id":"3a57d21f-5312-481d-9b0b-da801e83270f","html_url":"https://github.com/alxm/faur","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxm%2Ffaur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxm%2Ffaur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxm%2Ffaur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alxm%2Ffaur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alxm","download_url":"https://codeload.github.com/alxm/faur/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d-game-framework","2d-graphics","arduino","arduino-library","c","c99","caanoo","emscripten","game-development","gamebuino-meta","gamedev","gamedev-framework","gp2x","gp2x-wiz","linux","mingw","odroid-go","pandora-console","sdl","sdl2"],"created_at":"2024-08-01T21:00:50.153Z","updated_at":"2025-10-28T09:36:32.367Z","avatar_url":"https://github.com/alxm.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# [![Faur](./media/faur.png \"Faur\")](https://www.alxm.org)\n\n*Faur* is my personal C framework for my [hobby video games](https://www.alxm.org).\n\nFeatures include software or accelerated 2D graphics, abstractions for inputs and sound, application state management, entity-component-system model, and utilities to help with data, files, math, memory, strings, time, and more.\n\nFaur builds native on Linux and cross-compiles for Web, Windows, and some embedded devices like the GP2X and Gamebuino handhelds. The build system uses GNU Make 4.1 and Python 3.6 or later.\n\n## Install on Debian and Create a New Project\n\n```sh\n$ sudo apt install build-essential git\n$ sudo apt install python3 python3-pil\n$ sudo apt install libpng-dev libsdl2-dev libsdl2-mixer-dev\n$\n$ cd $HOME\n$ git clone https://github.com/alxm/faur.git\n$\n$ export FAUR_PATH=$HOME/faur\n$ export PATH=$PATH:$FAUR_PATH/bin\n$\n$ faur-new --name hello\n$ cd hello/build/make/\n$ make run\n```\n\n![Hello, World screenshot](./media/hello.gif \"Hello, World screenshot\")\u003cbr\u003e*Move the square with the arrow keys or with a game controller.*\n\n### Generated Project Files\n\n```sh\n$ tree hello/\n\nhello/\n├── build/\n│   └── make/\n│       └── Makefile\n└── src/\n    └── main.c\n```\n\n#### hello/src/main.c\n\n```c\n#include \u003cfaur.h\u003e\n\nvoid f_main(void)\n{\n    static struct {\n        int x, y;\n        FButton *up, *down, *left, *right;\n    } context;\n\n    F_STATE_INIT\n    {\n        context.x = f_screen_sizeGetWidth() / 2;\n        context.y = f_screen_sizeGetHeight() / 2;\n\n        context.up = f_button_new();\n        f_button_bindKey(context.up, F_KEY_UP);\n        f_button_bindButton(context.up, F_BUTTON_UP);\n\n        context.down = f_button_new();\n        f_button_bindKey(context.down, F_KEY_DOWN);\n        f_button_bindButton(context.down, F_BUTTON_DOWN);\n\n        context.left = f_button_new();\n        f_button_bindKey(context.left, F_KEY_LEFT);\n        f_button_bindButton(context.left, F_BUTTON_LEFT);\n\n        context.right = f_button_new();\n        f_button_bindKey(context.right, F_KEY_RIGHT);\n        f_button_bindButton(context.right, F_BUTTON_RIGHT);\n    }\n\n    F_STATE_TICK\n    {\n        if(f_button_pressGet(context.up)) context.y--;\n        if(f_button_pressGet(context.down)) context.y++;\n        if(f_button_pressGet(context.left)) context.x--;\n        if(f_button_pressGet(context.right)) context.x++;\n    }\n\n    F_STATE_DRAW\n    {\n        f_color_colorSetHex(0xaaff88);\n        f_draw_fill();\n\n        f_color_colorSetHex(0xffaa44);\n        f_draw_rectangle(context.x - 40, context.y - 40, 80, 80);\n    }\n\n    F_STATE_FREE\n    {\n        f_button_free(context.up);\n        f_button_free(context.down);\n        f_button_free(context.left);\n        f_button_free(context.right);\n    }\n}\n```\n\n#### hello/build/make/Makefile\n\n```make\nF_CONFIG_APP_AUTHOR := \u003cname\u003e\nF_CONFIG_APP_NAME := hello\n\ninclude $(FAUR_PATH)/make/default.mk\n```\n\n## Cross-Compile for Other Platforms\n\nI started Faur by collecting my [GP2X games'](https://www.alxm.org/games/gamepark.html) shared code into a static library. Over time I added support for more platforms:\n\nTarget | Host | Toolchain | Dependencies | More Info\n--- | --- | --- | --- | ---\n***Desktop***\nLinux (SDL 2) | Linux | OS build tools | Debian: `libsdl2-dev` `libsdl2-mixer-dev` `libpng-dev` `valgrind`\u003cbr\u003e\u003cbr\u003eFedora: `SDL2-devel` `SDL2_mixer-devel` `libpng-devel` `libubsan` `valgrind`\nLinux (SDL 1.2) | Linux | OS build tools | Debian: `libsdl1.2-dev` `libsdl-mixer1.2-dev` `libpng-dev` `valgrind`\u003cbr\u003e\u003cbr\u003eFedora: `sdl12-compat-devel` `SDL_mixer-devel` `libpng-devel` `libubsan` `valgrind`\nFreeBSD | FreeBSD | OS build tools | `gmake` `devel/sdl20 audio/sdl2_mixer` | [Building on FreeBSD](https://www.alxm.org/notes/a2x-freebsd.html)\nWindows | Linux | MinGW-w64 | Debian: `mingw-w64` `libz-mingw-w64-dev` and local builds of `SDL2` `SDL2_mixer` `libpng`\u003cbr\u003e\u003cbr\u003eFedora: `mingw64-gcc` `mingw64-gcc-c++` `mingw64-SDL2` `mingw64-SDL2_mixer` `mingw64-libpng` `mingw64-zlib` | [Cross-compiling with MinGW](https://www.alxm.org/notes/a2x-mingw.html)\nWeb (Wasm) | Linux | Emscripten 3.1.66 | | [Emscripten Notes](https://www.alxm.org/notes/emscripten.html)\n***Embedded Linux***\nGP2X, GP2X Wiz | Linux | Open2x SDK | Debian: `ia32-libs` | [Open2x Project](https://sourceforge.net/p/open2x/code/HEAD/tree/)\nCaanoo | Linux | GPH SDK | Debian: `ia32-libs` | [Caanoo SDK for Linux](https://dl.openhandhelds.org/cgi-bin/caanoo.cgi?0,0,0,0,17,631)\nOpen Pandora | Linux | Pandora SDK | Debian: `ia32-libs libxml2-utils` | [Open Pandora Forums](https://pyra-handheld.com/boards/)\n***Arduino***\nGamebuino META | Linux | Arduino 1.8.19, Arduino SAMD Boards 1.8.11, Gamebuino META Boards 1.2.2 | Arduino: `Gamebuino META 1.3`\u003cbr\u003e\u003cbr\u003eDebian: `ffmpeg`\u003cbr\u003e\u003cbr\u003eFedora: `ffmpeg-free` | [Gamebuino META Makefile](https://www.alxm.org/notes/gamebuino-meta-makefile.html)\nODROID-GO | Linux | Arduino 1.8.19, Arduino-ESP32 1.0.6 | Arduino: `ODROID-GO 1.0.0`\u003cbr\u003e\u003cbr\u003eDebian: `python3-serial` `python-is-python3`\u003cbr\u003e\u003cbr\u003eFedora: `python3-pyserial` | [ODROID Wiki](https://wiki.odroid.com/odroid_go/arduino/01_arduino_setup)\n\nThe default toolchain paths are in `make/global/sdk.mk`, and they can be overridden in a project Makefile or globally in `~/.config/faur/sdk.mk`. To build for different targets, change `include $(FAUR_PATH)/make/default.mk` to use other files from `$(FAUR_PATH)/make`.\n\n## License\n\nCopyright 2010-2024 Alex Margarit (alex@alxm.org)\n\n* Source code licensed under [GNU GPL 3.0](https://www.gnu.org/licenses/gpl.html) (file `LICENSE`)\n* Other content licensed under [CC BY-NC-ND 4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/) (file `media/CC-BY-NC-ND`)\n\nFaur is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The project is named after the old Romanian word *faur*, sometimes used in fables to mean *wizard blacksmith*. ⚒️✨\n\n### Contributing\n\nThis is my personal framework and ideas playground, a solo project. You are welcome to check it out and use it under the terms of the license, but I do not take pull requests to this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxm%2Ffaur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falxm%2Ffaur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falxm%2Ffaur/lists"}