Go to file
Adrien Marquès 964d982b31 Fix xController macro 2019-11-06 22:50:02 +01:00
.vscode Create project barebone 2019-11-05 21:52:41 +01:00
include Make xSpriteAnimation orchestrable and register every animation into the app when started 2019-11-06 22:50:02 +01:00
xSDL Fix xController macro 2019-11-06 22:50:02 +01:00
.gitignore Create project barebone 2019-11-05 21:52:41 +01:00
LICENSE add license information 2019-11-05 21:52:55 +01:00
README.md Create project barebone 2019-11-05 21:52:41 +01:00
main.h Create project barebone 2019-11-05 21:52:41 +01:00
makefile Create project barebone 2019-11-05 21:52:41 +01:00

README.md

xSDL

package:  xSDL
language: c++
version:  0.1.0
author:   xdrm-brackets

xSDL is a simple 2D wrapper around the SDL2 to make your life easier.

Documentation

The API aims to be straightforward as possible and tries to take advantage of patterns and principles to achieve its goal.

xSDL can be compiled as a dynamic library (e.g. lib.so). The include header is located in include/xSDL.h. It can also be compiled directly within your application.

The class xApplication is a singleton representing your application, its window, renderer, etc. An xApplication features a xController that manages user input.

The interface xElement represents any graphical feature to be drawn on the screen. Any number of xElement can be pushed to or pulled from the application at any time in order to show them or not.

The class xSprite represents a sprite that can is a rectangle that can draw either as a single color, an image, or a copy of another sprite. It can be moved over time. Also, it allows you to set a custom clip if this is an image sprite.

The class xSpriteAnimation derives from an image sprite, which clip can change over time. These clips are called frames and have to be set beforehand, when ready you can start or stop the animation with a specified delay between frames. Every xSpriteAnimation is scheduled on the same dedicated animation thread.

The concurrency model is led simple :

  • the main loop schedules rendering and user input
  • the animation loop schedules animation frame shifts