{"id":15047757,"url":"https://github.com/albin-johansson/centurion","last_synced_at":"2025-04-06T13:12:06.652Z","repository":{"id":41090247,"uuid":"176574203","full_name":"albin-johansson/centurion","owner":"albin-johansson","description":"A modern C++ wrapper library for SDL2 in order to improve type-safety, memory safety and overall ease-of-use.","archived":false,"fork":false,"pushed_at":"2024-08-17T13:08:24.000Z","size":229463,"stargazers_count":315,"open_issues_count":5,"forks_count":30,"subscribers_count":13,"default_branch":"dev","last_synced_at":"2025-03-30T11:09:56.532Z","etag":null,"topics":["cpp","cpp17","cpp20","cross-platform","game-development","gamedev","header-only","modern-cpp","sdl","sdl-image","sdl-mixer","sdl-ttf","sdl2","sdl2-image","sdl2-mixer","sdl2-ttf","wrapper","wrapper-library"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albin-johansson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-03-19T18:24:22.000Z","updated_at":"2025-03-28T05:55:13.000Z","dependencies_parsed_at":"2024-06-08T01:40:08.930Z","dependency_job_id":"0bb0a0e9-e0dc-42f5-bb7d-ea35bd598902","html_url":"https://github.com/albin-johansson/centurion","commit_stats":{"total_commits":5045,"total_committers":2,"mean_commits":2522.5,"dds":0.002180376610505408,"last_synced_commit":"adc604505c9b8b5b22360723adeb3b87e16ab91c"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albin-johansson%2Fcenturion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albin-johansson%2Fcenturion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albin-johansson%2Fcenturion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albin-johansson%2Fcenturion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albin-johansson","download_url":"https://codeload.github.com/albin-johansson/centurion/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485290,"owners_count":20946398,"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":["cpp","cpp17","cpp20","cross-platform","game-development","gamedev","header-only","modern-cpp","sdl","sdl-image","sdl-mixer","sdl-ttf","sdl2","sdl2-image","sdl2-mixer","sdl2-ttf","wrapper","wrapper-library"],"created_at":"2024-09-24T21:04:14.957Z","updated_at":"2025-04-06T13:12:06.634Z","avatar_url":"https://github.com/albin-johansson.png","language":"C++","funding_links":[],"categories":["GUI"],"sub_categories":[],"readme":"# Centurion\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![version](https://img.shields.io/github/v/release/albin-johansson/centurion)](https://github.com/albin-johansson/centurion/releases)\n[![doxygen](https://img.shields.io/badge/doxygen-stable-blue)](https://albin-johansson.github.io/centurion/)\n[![CI](https://github.com/albin-johansson/centurion/actions/workflows/ci.yml/badge.svg)](https://github.com/albin-johansson/centurion/actions/workflows/ci.yml)\n\n## Introduction\n\nCenturion is a modern C++ wrapper library for SDL2 designed to improve type-safety, memory safety and overall\nease-of-use. The general aim of Centurion is to serve as an easy-to-use and intuitive alternative to raw SDL2, by\nproviding the same features whilst being safer and easier to use. However, there are also aspects of the library that\nhave no direct counterparts in SDL.\n\n```C++\n#include \u003ccenturion.hpp\u003e\n\nint main(int argc, char* argv[])\n{\n  const cen::sdl sdl;  // Init SDL\n  const cen::img img;  // Init SDL_image\n  const cen::mix mix;  // Init SDL_mixer\n  const cen::ttf ttf;  // Init SDL_ttf\n\n  cen::window window {\"Centurion\"};\n  cen::renderer renderer = window.make_renderer();\n  \n  window.show();\n\n  bool running = true;\n  while (running) {\n    cen::event_handler event;\n    while (event.poll()) {\n      if (event.is(cen::event_type::quit)) {\n        running = false;\n      }\n    }\n\n    renderer.clear_with(cen::colors::coral);\n    renderer.present();\n  }\n\n  window.hide();\n  return 0;\n}\n```\n\n## Not Just a Wrapper Library\n\nCenturion is not just a wrapper library. A lot of effort has been put into improving the SDL APIs by utilising the full\npower of modern C++17 and C++20. Which has led to APIs that are far more expressive and intuitive to use, compared to\nplain C.\n\n## Features\n\nThe following is a (non-exhaustive) list of the features of Centurion.\n\n* Window management\n* Hardware-accelerated rendering (with basic support for OpenGL and Vulkan)\n* TrueType font handling\n* System events\n* Keyboard input\n* Mouse input\n* Game controller and joystick input\n* Force feedback\n* Sound effects\n* Music\n* System information about platform, CPU, RAM, screen, battery, clipboard, counters, locale, etc.\n* Filesystem information\n* Cursor management\n* Multi-threading utilities\n* Message boxes\n* Compiler information\n\nAdditionally, many Centurion components feature serialization support based on the Cereal API, string conversions,\nstreaming support, etc. The library can be used with either C++17 or C++20, and will use appropriate facilities\ndepending on the language version used. For example, the library will make use of `std::format`, if it is available.\n\n## Dependencies\n\nThe following table shows the supported versions of SDL2 and its extension libraries. Only the core SDL library is\nmandatory. The extension libraries can be disabled at compile-time, by defining any of `CENTURION_NO_SDL_IMAGE`\n, `CENTURION_NO_SDL_MIXER` or `CENTURION_NO_SDL_TTF`, respectively.\n\n| Dependency            | Source                                                                          | Supported versions |\n|-----------------------|---------------------------------------------------------------------------------|--------------------|\n| SDL2                  | [www.libsdl.org](https://www.libsdl.org/download-2.0.php)                       | 2.0.10 ... 2.26    |\n| SDL2_image (Optional) | [www.libsdl.org/projects/SDL_image](https://www.libsdl.org/projects/SDL_image/) | 2.0.5 ... 2.6      |\n| SDL2_mixer (Optional) | [www.libsdl.org/projects/SDL_mixer](https://www.libsdl.org/projects/SDL_mixer/) | 2.0.4 ... 2.6      |\n| SDL2_ttf   (Optional) | [www.libsdl.org/projects/SDL_ttf](https://www.libsdl.org/projects/SDL_ttf/)     | 2.0.15 ... 2.20    |\n\n## Installation\n\nThe library is distributed as a header-only library, which can be found in the `src` directory. Just download the\nheaders include them in your project, and the library it's ready to be used. You will of course also need to install\nSDL2.\n\n## Documentation\n\nFor additional documentation, see the [wiki](https://github.com/albin-johansson/centurion/wiki), hosted on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbin-johansson%2Fcenturion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbin-johansson%2Fcenturion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbin-johansson%2Fcenturion/lists"}