OpenBarnyard
 
Loading...
Searching...
No Matches
TApplication.h
Go to the documentation of this file.
1#pragma once
3#include "Toshi/TString8.h"
4#include "TGlobalEmitter.h"
5
7
8class TDebugConsole;
9
15
20
22{
23public:
25 virtual ~TApplication();
26
27 virtual TBOOL OnCreate( TINT argc, TCHAR** argv );
28 virtual TBOOL OnUpdate( float deltaTime );
29 virtual TBOOL OnDestroy();
30 virtual TBOOL IsConsoleEnabled() { return TTRUE; }
31
32 static void OnApplicationExitEvent( void* a_pApp, const TApplicationExitEvent& a_rEvent )
33 {
34 TSTATICCAST( TApplication, a_pApp )->Destroy();
35 }
36
37 // Returns TTRUE if success
38 TBOOL Create( const TCHAR* appName, TINT argc, TCHAR** argv );
39
40 // Destroys the application and sets the flag
41 void Destroy();
42
43 // Returns TTRUE if the application is created
44 TBOOL IsCreated() const { return m_Flags & TApplicationFlag_Created; }
45
46 // Returns TTRUE if the application is destroyed
47 TBOOL IsDestroyed() const { return m_Flags & TApplicationFlag_Destroyed; }
48
49 // Sets new state
50 void SetVerbose( TBOOL state ) { m_IsVerbose = state; }
51
52 // Executes the application and starts the loop
53 TBOOL Execute();
54
55private:
56 TString8 m_Name; // 0x4
57 TUINT32 m_Flags; // 0x10
58 TBOOL m_IsVerbose; // 0x14
59 TDebugConsole* m_pDebugConsole;
60};
61
#define TSTATICCAST(POINTERTYPE, VALUE)
Definition Defines.h:69
#define BITFLAG(x)
Definition Defines.h:10
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
TApplicationFlag
@ TApplicationFlag_Destroyed
@ TApplicationFlag_Created
Char string implementation for the Toshi engine.
char TCHAR
Definition Typedefs.h:20
uint32_t TUINT32
Definition Typedefs.h:13
int TINT
Definition Typedefs.h:7
#define TTRUE
Definition Typedefs.h:25
bool TBOOL
Definition Typedefs.h:6
TBOOL IsCreated() const
virtual ~TApplication()
TBOOL Create(const TCHAR *appName, TINT argc, TCHAR **argv)
virtual TBOOL OnCreate(TINT argc, TCHAR **argv)
virtual TBOOL OnUpdate(float deltaTime)
TBOOL IsDestroyed() const
void SetVerbose(TBOOL state)
static void OnApplicationExitEvent(void *a_pApp, const TApplicationExitEvent &a_rEvent)
virtual TBOOL IsConsoleEnabled()
virtual TBOOL OnDestroy()