Add project files.
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
#include "cTrooperEngineCore.hpp"
|
||||
|
||||
/*** Custom Header Files ***/
|
||||
#include "../VideoEngine/cVideo.hpp"
|
||||
#include "../AudioEngine/cAudio.hpp"
|
||||
#include "../InputEngine/cInput.hpp"
|
||||
|
||||
#include "../TimingEngine/cTiming.hpp"
|
||||
|
||||
#include "../TextTypeEngine/cTextType.hpp"
|
||||
|
||||
#include "../MathEngine/cRandom.hpp"
|
||||
|
||||
#include "../EventEngine/cEventControl.hpp"
|
||||
|
||||
#include "../UtilityEngine/cUtility.hpp"
|
||||
|
||||
#include "../GUIEngine/cGUI.hpp"
|
||||
|
||||
using TrooperEngineCore::cTrooperEngineCore;
|
||||
|
||||
/*static*/ cTrooperEngineCore* cTrooperEngineCore::sp_inst = nullptr;
|
||||
|
||||
cTrooperEngineCore::cTrooperEngineCore()
|
||||
{
|
||||
}
|
||||
|
||||
cTrooperEngineCore::~cTrooperEngineCore()
|
||||
{
|
||||
CleanUp();
|
||||
VideoEngine::cVideo::Delete();
|
||||
AudioEngine::cAudio::Delete();
|
||||
InputEngine::cInput::Delete();
|
||||
TimingEngine::cTiming::Delete();
|
||||
|
||||
TextTypeEngine::cTextType::Delete();
|
||||
MathEngine::cRandom::Delete();
|
||||
EventEngine::cEventControl::Delete();
|
||||
SDL_Quit();
|
||||
UtilityEngine::cUtility::Inst().Message("SDL shut down!");
|
||||
UtilityEngine::cUtility::Delete();
|
||||
|
||||
GUIEngine::cGUI::Delete();
|
||||
}
|
||||
|
||||
///Functions
|
||||
/*static*/ const char* cTrooperEngineCore::Version()
|
||||
{
|
||||
return __TROOPERENGINE__VERSION;
|
||||
}
|
||||
|
||||
/*static*/ cTrooperEngineCore& cTrooperEngineCore::Inst()
|
||||
{
|
||||
if (sp_inst == nullptr)
|
||||
sp_inst = new cTrooperEngineCore();
|
||||
return *sp_inst;
|
||||
}
|
||||
|
||||
/*static*/ void cTrooperEngineCore::Delete()
|
||||
{
|
||||
delete sp_inst;
|
||||
sp_inst = nullptr;
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::VideoInit()
|
||||
{
|
||||
return VideoEngine::cVideo::Inst().Initialize();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::AudioInit()
|
||||
{
|
||||
return AudioEngine::cAudio::Inst().Initialize();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::InputInit()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::JoystickInit()
|
||||
{
|
||||
return InputEngine::cInput::Inst().Initialize();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::TimerInit()
|
||||
{
|
||||
return TimingEngine::cTiming::Inst().Initialize();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::TextTypeInit()
|
||||
{
|
||||
return TextTypeEngine::cTextType::Inst().Initialize();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::EventInit()
|
||||
{
|
||||
return EventEngine::cEventControl::Inst().Initialize();
|
||||
}
|
||||
|
||||
/* Print lib versions */
|
||||
void cTrooperEngineCore::PrintSDLVersion() const
|
||||
{
|
||||
UtilityEngine::cUtility::Inst().PrintVersion();
|
||||
}
|
||||
|
||||
void cTrooperEngineCore::CleanUp()
|
||||
{
|
||||
VideoEngine::cVideo::Inst().CleanUp();
|
||||
AudioEngine::cAudio::Inst().CleanUp();
|
||||
TimingEngine::cTiming::Inst().CleanUp();
|
||||
TextTypeEngine::cTextType::Inst().CleanUp();
|
||||
InputEngine::cInput::Inst().CleanUp();
|
||||
EventEngine::cEventControl::Inst().CleanUp();
|
||||
}
|
||||
|
||||
///Gets
|
||||
const bool cTrooperEngineCore::getVideo() const
|
||||
{
|
||||
return VideoEngine::cVideo::Inst().IsInit();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::getAudio() const
|
||||
{
|
||||
return AudioEngine::cAudio::Inst().IsInit();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::getInput() const
|
||||
{
|
||||
return InputEngine::cInput::Inst().IsInit();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::getJoystick() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::getTimer() const
|
||||
{
|
||||
return TimingEngine::cTiming::Inst().IsInit();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::getText() const
|
||||
{
|
||||
return TextTypeEngine::cTextType::Inst().IsInit();
|
||||
}
|
||||
|
||||
const bool cTrooperEngineCore::getEvent() const
|
||||
{
|
||||
return EventEngine::cEventControl::Inst().IsInit();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
#ifndef _CTROOPERENGINECORE_HPP_
|
||||
#define _CTROOPERENGINECORE_HPP_
|
||||
|
||||
/*** SDL Header Files ***/
|
||||
#include <SDL.h>
|
||||
|
||||
/*** DLL Header File ***/
|
||||
#include "dllExport.h"
|
||||
|
||||
#define __TROOPERENGINE__VERSION "1.0.0"
|
||||
|
||||
namespace TrooperEngineCore {
|
||||
/* Singleton */
|
||||
class EXPORT_FROM_MYDLL cTrooperEngineCore
|
||||
{
|
||||
private:
|
||||
cTrooperEngineCore();
|
||||
~cTrooperEngineCore();
|
||||
|
||||
public:
|
||||
///Functions
|
||||
static const char* Version();
|
||||
static cTrooperEngineCore& Inst();
|
||||
static void Delete();
|
||||
|
||||
/* Initiates the video */
|
||||
const bool VideoInit();
|
||||
/* Initiates the audio */
|
||||
const bool AudioInit();
|
||||
/* Initiates the input (Keyboard Mouse Joystick)*/
|
||||
const bool InputInit();
|
||||
/* Initiates the joystick */
|
||||
const bool JoystickInit();
|
||||
/* Initiates the timer */
|
||||
const bool TimerInit();
|
||||
/* Initiates the text */
|
||||
const bool TextTypeInit();
|
||||
/* Initiates the event */
|
||||
const bool EventInit();
|
||||
|
||||
/* Print lib versions */
|
||||
void PrintSDLVersion() const;
|
||||
|
||||
/* Cleans up */
|
||||
void CleanUp();
|
||||
|
||||
///Gets
|
||||
/* Gets returns true if Video was initiated other wise it returns false */
|
||||
const bool getVideo() const;
|
||||
/* Gets returns true if Audio was initiated other wise it returns false */
|
||||
const bool getAudio() const;
|
||||
/* Gets returns true if Input was initiated other wise it returns false */
|
||||
const bool getInput() const;
|
||||
/* Gets returns true if Joystick was initiated other wise it returns false */
|
||||
const bool getJoystick() const;
|
||||
/* Gets returns true if Timer was initiated other wise it returns false */
|
||||
const bool getTimer() const;
|
||||
/* Gets returns true if Text was initiated other wise it returns false */
|
||||
const bool getText() const;
|
||||
/* Gets returns true if Event was initiated other wise it returns false */
|
||||
const bool getEvent() const;
|
||||
|
||||
private:
|
||||
///Variables
|
||||
static cTrooperEngineCore* sp_inst;// = nullptr
|
||||
};/// END CLASS DEFINITION cTrooperEngineCore
|
||||
}/// END NAMESPACE DEFINITION TroopperENgineCore
|
||||
#endif/// END IFNDEF _CTROOPERENGINECORE_HPP_
|
||||
Reference in New Issue
Block a user