2D Engine v0.1.0
Loading...
Searching...
No Matches
SDLLayer Class Reference

SDL Rendering. More...

#include <SDLLayer.hpp>

Collaboration diagram for SDLLayer:
Collaboration graph

Public Member Functions

 SDLLayer ()
 Initialize SDL Window and Renderer.
 
 ~SDLLayer ()
 Destroy SDL Window and Renderer.
 
SDL_Renderer * GetRenderer () const
 Get the Renderer object.
 
SDL_Window * GetWindow () const
 Get the Window object.
 
void DrawRectangle (const int x, const int y, const int width, const int height, const SDL_Color color)
 Draw a rectangle at the given position with the given width, height, and color.
 
void DrawTexture (SDL_Texture *const texture, const float x, const float y, const float width, const float height)
 Draw a texture at the given position with the given width and height.
 
void DrawTextureSample (SDL_Texture *const texture, const float x, const float y, const float width, const float height, const float sampleX, const float sampleY, const float sampleWidth, const float sampleHeight)
 Draw a texture taken from the sample at a given position with the given width, height.
 

Detailed Description

SDL Rendering.

Constructor & Destructor Documentation

◆ SDLLayer()

SDLLayer::SDLLayer ( )
inline

Initialize SDL Window and Renderer.

◆ ~SDLLayer()

SDLLayer::~SDLLayer ( )
inline

Destroy SDL Window and Renderer.

Member Function Documentation

◆ DrawRectangle()

void SDLLayer::DrawRectangle ( const int x,
const int y,
const int width,
const int height,
const SDL_Color color )
inline

Draw a rectangle at the given position with the given width, height, and color.

Parameters
x
y
width
height
color

◆ DrawTexture()

void SDLLayer::DrawTexture ( SDL_Texture *const texture,
const float x,
const float y,
const float width,
const float height )
inline

Draw a texture at the given position with the given width and height.

Parameters
texture
x
y
width
height

◆ DrawTextureSample()

void SDLLayer::DrawTextureSample ( SDL_Texture *const texture,
const float x,
const float y,
const float width,
const float height,
const float sampleX,
const float sampleY,
const float sampleWidth,
const float sampleHeight )
inline

Draw a texture taken from the sample at a given position with the given width, height.

Parameters
texture
x
y
width
height
sampleX
sampleY
sampleWidth
sampleHeight

◆ GetRenderer()

SDL_Renderer * SDLLayer::GetRenderer ( ) const
inline

Get the Renderer object.

Returns
SDL_Renderer*

◆ GetWindow()

SDL_Window * SDLLayer::GetWindow ( ) const
inline

Get the Window object.

Returns
SDL_Window*

The documentation for this class was generated from the following file: