Norbert's Game Engine v200
Loading...
Searching...
No Matches
eEntry< T > Class Template Reference

#include <Entry.hpp>

Inheritance diagram for eEntry< T >:
eBase

Public Member Functions

bool Initialize ()
 
void Run ()
 
void Release ()
 
- Public Member Functions inherited from eBase
template<typename T >
T * Cast (eBase *obj)
 Cast class to base.
 

Detailed Description

template<typename T>
class eEntry< T >

Helper class for tasks

Definition at line 16 of file Entry.hpp.

Constructor & Destructor Documentation

◆ ~eEntry()

template<typename T >
eEntry< T >::~eEntry ( )
inline

Definition at line 19 of file Entry.hpp.

20 {
21 Release();
22 }

Member Function Documentation

◆ Initialize()

template<typename T >
bool eEntry< T >::Initialize ( )
inline

Definition at line 24 of file Entry.hpp.

25 {
26 // Hide CMD Window
27 ::ShowWindow(::GetConsoleWindow(), false);
28#if _DEBUG
29 // Look for memory leaks
30 _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
31#endif
32
33 if (!eWindow::INIT()) return false;
34 mTask = new T();
35 if (!mTask->Initialize())
36 {
37 delete mTask;
38 eConsole::PrintLog("ERROR::eEntry::Initialize", "mTask->Initialize() returned false!");
40 return false;
41 }
42 eConsole::PrintLog("INFO::eEntry::Initialize", "Successfully initialized task!");
43 return true;
44 }
static void WriteToDisk()
Write the console text to a crash file called 'CRASH.log'.
Definition Console.cpp:40
static void PrintLog(eString head, eString msg)
Print a log.
Definition Console.cpp:22

◆ Release()

template<typename T >
void eEntry< T >::Release ( )
inline

Definition at line 56 of file Entry.hpp.

57 {
58 if (mTask != nullptr)
59 {
60 mTask->Unload();
61 delete mTask;
62 mTask = nullptr;
63 }
64 eConsole::mCmdArg.Clear();
65 eWindow::RELEASE();
66 }

◆ Run()

template<typename T >
void eEntry< T >::Run ( )
inline

Definition at line 46 of file Entry.hpp.

47 {
48 while (!mTask->bQuit)
49 {
50 eWindow::UPDATE();
51 mTask->Update();
52 mTask->Render();
53 }
54 }

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