Add project files.

This commit is contained in:
2018-06-25 21:48:45 -04:00
parent b04a25689b
commit 3c1b7d28e8
425 changed files with 35333 additions and 0 deletions
@@ -0,0 +1,63 @@
#ifndef _CBUTTON_HPP_
#define _CBUTTON_HPP_
/*** SDL Header Files ***/
#include <SDL.h>
/*** Custom Header Files ***/
#include "cWindow.hpp"
#include "GUIHelpers/Enums.hpp"
#include "GUIHelpers/GUIUtility.hpp"
#include "../VideoEngine/cSprite.hpp"
#include "../VideoEngine/cImage.hpp"
#include "../MathEngine/iVector/iVector2.hpp"
#include "cPanel.hpp"
/*** DLL Header File ***/
#include "dllExport.h"
/*** Custom Header Files ***/
#include "../UtilityEngine/cString.hpp"
using UtilityEngine::cString;
namespace GUIEngine {
class EXPORT_FROM_MYDLL cButton : public cWindow, public VideoEngine::cSprite
{
public:
static const cString sNAME; /*= "button";*/
cButton();
cButton( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
virtual ~cButton();
///Functions
void Create( cWindow* parent, const signed int id, const GUIHelpers::eAlign& align = sALIGN, const GUIHelpers::eLayout& layout = sLAYOUT,
const GUIHelpers::Position& pos = sPOSITION, const GUIHelpers::Size& size = sSIZE, const GUIHelpers::Padding& padding = sPADDING,
const cString& name = sNAME, VideoEngine::cImage** image = nullptr );
virtual void Press();
//Sets
///Gets
virtual const GUIHelpers::eType getType() const;
private:
void CreateLabel();
void GenerateImage();
void GenerateTexture();
private:
VideoEngine::cImage* mp_texture;// = nullptr
VideoEngine::cImage* mp_texturePress;// = nullptr
//Pointer to the image that will be displayed on the button.
VideoEngine::cImage** mpp_image;// = nullptr
};/// END CLASS DEFINITION cButton
}/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CBUTTON_HPP_
@@ -0,0 +1,88 @@
#include "cGFX.hpp"
/*** SDL Header Files ***/
#include <SDL2_gfxPrimitives.h>
/*** Custom Header Files ***/
#include "../VideoEngine/cRenderer.hpp"
#include "../UtilityEngine/cUtility.hpp"
using FXEngine::cGFX;
using VideoEngine::cRenderer;
using UtilityEngine::cUtility;
/*static*/ cGFX* cGFX::sp_inst = nullptr;
//private:
cGFX::cGFX()
{}
cGFX::~cGFX()
{}
//public:
///Functions
/*static*/ cGFX& cGFX::Inst()
{
if (sp_inst == nullptr)
sp_inst = new cGFX();
return *sp_inst;
}
/*static*/ void cGFX::Delete()
{
delete sp_inst;
sp_inst = nullptr;
}
void cGFX::StringDefault( const cString& text, const SDL_Rect& pos, const SDL_Colour& colour ) const
{
if (stringRGBA(cRenderer::Inst().getRenderer(), (Sint16)pos.x, (Sint16)pos.y, text.c_str(), colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to render text. stringRGBA():", __AT__, cUtility::eTypeSDL::GFX);
}
void cGFX::StringDefault( const cString& text, const SDL_Rect& pos, const SDL_Colour& colour, SDL_Texture* texture ) const
{
cRenderer::Inst().SetRenderTarget(texture);
StringDefault(text, pos, colour);
cRenderer::Inst().ResetRenderTarget();
}
void cGFX::RoundedRectangle( const SDL_Rect& rect, const unsigned long int rad, const SDL_Colour& colour ) const
{
if (roundedBoxRGBA(cRenderer::Inst().getRenderer(), (Sint16)rect.x, (Sint16)rect.y, (Sint16)rect.w, (Sint16)rect.h, (Sint16)rad, colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to make Rounded Rectangle. roundedRectangleRGBA():", __AT__, cUtility::eTypeSDL::GFX);
}
void cGFX::RoundedRectangle( const SDL_Rect& rect, const unsigned long int rad, const SDL_Colour& colour, SDL_Texture* texture ) const
{
cRenderer::Inst().SetRenderTarget(texture);
RoundedRectangle(rect, rad, colour);
cRenderer::Inst().ResetRenderTarget();
}
void cGFX::Pixel(const unsigned long int x, const unsigned long int y, const SDL_Colour& colour) const
{
if (pixelRGBA(cRenderer::Inst().getRenderer(), (Sint16)x, (Sint16)y, colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to make pixel. pixelRGBA():", __AT__, cUtility::eTypeSDL::GFX);
}
void cGFX::Pixel(const unsigned long int x, const unsigned long int y, const SDL_Colour& colour, SDL_Texture* texture) const
{
cRenderer::Inst().SetRenderTarget(texture);
Pixel(x, y, colour);
cRenderer::Inst().ResetRenderTarget();
}
void cGFX::Rectangle(const SDL_Rect& rect, const SDL_Colour& colour) const
{
if (rectangleRGBA(cRenderer::Inst().getRenderer(), (Sint16)rect.x, (Sint16)rect.y, (Sint16)rect.w, (Sint16)rect.h, colour.r, colour.g, colour.b, colour.a) < 0)
cUtility::Inst().Message("Unable to make pixel. rectangleRGBA():", __AT__, cUtility::eTypeSDL::GFX);
}
void cGFX::Rectangle(const SDL_Rect& rect, const SDL_Colour& colour, SDL_Texture* texture) const
{
cRenderer::Inst().SetRenderTarget(texture);
Rectangle(rect, colour);
cRenderer::Inst().ResetRenderTarget();
}