1 #ifndef AETHER_DRAWABLE_HPP 2 #define AETHER_DRAWABLE_HPP 4 #include "Aether/types/Colour.hpp" 5 #include "Aether/types/ImageData.hpp" 6 #include "Aether/Renderer.hpp" 38 SDL_Surface * surface;
39 SDL_Texture * texture;
79 Drawable(
Renderer * renderer, SDL_Texture * tex,
const unsigned int width,
const unsigned int height);
102 void setMask(
const int x,
const int y,
const unsigned int width,
const unsigned int height);
112 void render(
const int x,
const int y,
const unsigned int width = 0,
const unsigned int height = 0);
void setColour(const Colour &colour)
Set colour to tint Drawable with when rendered.
Type
Type of raw data stored.
Definition: Drawable.hpp:27
ImageData getImageData()
Returns the ImageData for the currently stored image.
void render(const int x, const int y, const unsigned int width=0, const unsigned int height=0)
Render the Drawable on screen at the given coordinates.
bool convertToTexture()
Convert the contained surface to a texture. Has no effect if the Drawable does not contain a surface...
int width()
Returns the width of the Drawable in pixels.
Aether's main renderer instance. It provides all methods relating to drawing directly to the screen...
Definition: Renderer.hpp:30
Stores RGBA values representing a colour. Each component can be within the range 0 to 255 (inclusive)...
Definition: Colour.hpp:9
Stores either a surface or texture which can be drawn on screen by providing a renderer to render()...
Definition: Drawable.hpp:22
int height()
Returns the height of the Drawable in pixels.
A Texture is an element that stores a texture to render in the window. It can't be instantiated alone...
Definition: Texture.hpp:24
Base namespace for all Aether related classes and functions.
~Drawable()
Destructor ensures contained data is deleted appropriately.
Drawable()
Height of mask.
Represents an object containing the raw pixel data for an image/texture as an array, along with required metadata such as width and height.
Definition: ImageData.hpp:16
void setMask(const int x, const int y, const unsigned int width, const unsigned int height)
Set the mask (area to draw)
Type type()
Returns the type of the data stored.