Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/egormkn/sdlxx

:space_invader: Modern C++ wrapper for Simple DirectMedia Layer (SDL2)
https://github.com/egormkn/sdlxx

animation audio directx game game-engine gamedev gui image mixer network opengl physics physics-2d rendering sdl sdl2 ttf

Last synced: about 11 hours ago
JSON representation

:space_invader: Modern C++ wrapper for Simple DirectMedia Layer (SDL2)

Awesome Lists containing this project

README

        

# SDLXX

[![Build](https://github.com/egormkn/SDLXX/actions/workflows/build.yml/badge.svg)](https://github.com/egormkn/SDLXX/actions/workflows/build.yml)

## Description

SDLXX is a modern C++ wrapper for the widely used [SDL](https://www.libsdl.org/) library
and its extensions:
[SDL_image](https://www.libsdl.org/projects/SDL_image/),
[SDL_mixer](https://www.libsdl.org/projects/SDL_mixer/),
[SDL_net](https://www.libsdl.org/projects/SDL_net/),
[SDL_ttf](https://www.libsdl.org/projects/SDL_ttf/).

It is designed to provide safe access to audio, keyboard, mouse, joystick, network and graphics hardware.

## Features

- Provides object-oriented bindings for SDL2 and its extension libraries
- Uses [RAII idiom](https://en.cppreference.com/w/cpp/language/raii) and C++ smart pointers for safe management of SDL resources
- Supports [vcpkg manifest mode](https://github.com/microsoft/vcpkg/blob/master/docs/users/manifests.md)

## Examples

Here is an example of the [game](https://github.com/egormkn/SDLXX/releases) created using SDLXX:

![Game screenshot](examples/game/assets/game.png)

## Alternatives

There are some other projects on Github that aim to provide a similar functionality:

- [libSDL2pp](https://github.com/libSDL2pp/libSDL2pp)
- [sdl++](https://github.com/tcbrindle/sdlxx)

## Development

1) Clone the repository with vcpkg submodule:

```bash
git clone --recurse-submodules https://github.com/egormkn/SDLXX.git
```

2) Open a project in IDE (VSCode/CLion/QtCreator/...) or use CMake to build from command line:

```bash
cd SDLXX
cmake -S . -B build -D BUILD_EXAMPLES=ON
cmake --build build
```

## License

This library is distributed under the terms of the [ZLib License](LICENSE.md).