OpenBarnyard
 
Loading...
Searching...
No Matches
AGUI2Context.cpp
Go to the documentation of this file.
1#include "pch.h"
2#include "AGUI2.h"
3#include "AGUI2Context.h"
4
5//-----------------------------------------------------------------------------
6// Enables memory debugging.
7// Note: Should be the last include!
8//-----------------------------------------------------------------------------
10
12{
13 m_pRenderer = TNULL;
14 m_pRootElement = TNULL;
15 m_pCreatedRootElement = TNULL;
16 m_pDebugCanvas = TNULL;
17
18 m_pCreatedRootElement = new AGUI2Element;
19
20 if ( m_pCreatedRootElement )
21 {
22 m_pCreatedRootElement->SetDimensions( 640.0f, 512.0f );
23 m_pCreatedRootElement->SetTransform( 0.0f, 0.0f, 0.0f );
24 }
25
26 m_pDebugCanvas = new AGUI2Element;
27
28 if ( m_pDebugCanvas )
29 {
30 m_pDebugCanvas->SetDimensions( 640.0f, 512.0f );
31 m_pDebugCanvas->SetTransform( 0.0f, 0.0f, 0.0f );
32 }
33
34 m_pRootElement = m_pCreatedRootElement;
35}
36
37void AGUI2Context::Tick( TFLOAT a_fDeltaTime )
38{
39 if ( m_pRootElement )
40 {
41 m_pRootElement->Tick( a_fDeltaTime );
42 }
43
44 m_pDebugCanvas->Tick( a_fDeltaTime );
45}
46
48{
49 if ( m_pRootElement )
50 {
52
53 m_pRootElement->PreRender();
54 m_pRootElement->Render();
55 m_pRootElement->PostRender();
56
57 m_pDebugCanvas->PreRender();
58 m_pDebugCanvas->Render();
59 m_pDebugCanvas->PostRender();
60
62 }
63}
float TFLOAT
Definition Typedefs.h:4
#define TNULL
Definition Typedefs.h:23
static AGUI2Renderer * GetRenderer()
Definition AGUI2.cpp:239
void Tick(TFLOAT a_fDeltaTime)
virtual void Tick(TFLOAT a_fDeltaTime)
virtual void EndScene()=0
virtual void BeginScene()=0