Go to file
Adrien Marquès 44de8cb3ea Merge SpriteAnimation into xSprite and interface improvements
- remove dead code
- a sprite with no clip uses the default surface dimensions to draw
- a sprite with a single clip uses it
- a sprite with multiple clips (i.e. frames) has the first as a default but when orchestrated iterates over clips in order
2019-11-08 21:38:16 +01:00
.vscode Create project barebone 2019-11-05 21:52:41 +01:00
include Merge SpriteAnimation into xSprite and interface improvements 2019-11-08 21:38:16 +01:00
xSDL Merge SpriteAnimation into xSprite and interface improvements 2019-11-08 21:38:16 +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 update readme: explain orchestrable and how xSpriteAnimation implements it 2019-11-06 22:56:03 +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 interface xOrchestrable represents any class that can be called during the application scheduling. Any number of xOrchestrable can be added or removed from the application at any time in order to execute 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. It is also an orchestrable (i.e. animates on application ticks), you can start or stop the animation with a specified time interval. Every xSpriteAnimation is scheduled by the xApplication.