Files
SDLPongCPP/TrooperEngineDLL/TrooperEngine/FXEngine/cGFX.hpp
T

67 lines
3.0 KiB
C++

#ifndef _CGFX_HPP_
#define _CGFX_HPP_
/*** SDL Header Files ***/
#include <SDL.h>
#include <SDL2_rotozoom.h>
/*** DLL Header File ***/
#include "dllExport.h"
/*** Custom Header Files ***/
#include "../UtilityEngine/cString.hpp"
using UtilityEngine::cString;
namespace FXEngine {
/* Singleton */
class EXPORT_FROM_MYDLL cGFX
{
private:
cGFX();
~cGFX();
public:
static cGFX& Inst();
static void Delete();
/* Render to the renderer with stringRGBA() from SDL2_gfx */
void StringDefault( const cString& text, const SDL_Rect& pos, const SDL_Colour& colour ) const;
void StringDefault( const cString& text, const SDL_Rect& pos, const SDL_Colour& colour, SDL_Surface* surface ) const;
/* Sets texture to renderer and calls StringDefault(text, pos, colour) */
void StringDefault( const cString& text, const SDL_Rect& pos, const SDL_Colour& colour, SDL_Texture* texture ) const;
/* Creates a Texture for use and calls StringDefault(text, pos, colour, texture) */
SDL_Texture* StringTexture( const cString& text, const SDL_Rect& pos, const SDL_Colour& colour ) const;
/* Render to the renderer with boxRGBA() from SDL2_gfx */
void Box( const SDL_Rect& rect, const SDL_Colour& colour ) const;
/* Sets texture to renderer and calls Box(rect, colour) */
void Box( const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture ) const;
/* Render to the renderer with roundedBoxRGBA() from SDL2_gfx */
void RoundedBox( const SDL_Rect& rect, const unsigned long int rad, const SDL_Colour& colour ) const;
/* Sets texture to renderer and calls RoundedBox(rect, rad, colour) */
void RoundedBox( const SDL_Rect& rect, const unsigned long int rad, const SDL_Colour& colour, SDL_Texture* texture ) const;
/* Render to the renderer with pixelRGBA() from SDL2_gfx */
void Pixel( const unsigned long int x, const unsigned long int y, const SDL_Colour& colour ) const;
/* Sets texture to renderer and calls Pixel(x, y, colour) */
void Pixel( const unsigned long int x, const unsigned long int y, const SDL_Colour& colour, SDL_Texture* texture ) const;
/* Render to the renderer with rectangleRGBA() from SDL2_gfx */
void Rectangle( const SDL_Rect& rect, const SDL_Colour& colour ) const;
/* Sets texture to renderer and calls Rectangle(rect, colour) */
void Rectangle( const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture ) const;
/* Zooms in or out to stretch or shrink the surface and returns a new surface with zoomSurface() from SDL2_gfx */
SDL_Surface* ZoomIn( SDL_Surface* surface, const double zoomx, const double zoomy, const unsigned long int smooth = SMOOTHING_ON ) const;
/* Zooms in or out to stretch or shrink the texture and returns a new texture with zoomSurface() from SDL2_gfx */
SDL_Texture* ZoomIn( SDL_Texture* texture, const double zoomx, const double zoomy, const unsigned long int smooth = SMOOTHING_ON ) const;
private:
/// Variables
static cGFX* sp_inst;/// = nullptr
};/// END CLASS DEFINITION cGFX
}/// END NAMESPACE DEFINITION FXEngine
#endif/// END IFNDEF _CGFX_HPP_