OpenBarnyard
 
Loading...
Searching...
No Matches
AGUI2Rectangle.cpp
Go to the documentation of this file.
1#include "pch.h"
2#include "AGUI2Rectangle.h"
3#include "AGUI2.h"
4
5//-----------------------------------------------------------------------------
6// Enables memory debugging.
7// Note: Should be the last include!
8//-----------------------------------------------------------------------------
10
15
17{
18 auto pRenderer = AGUI2::GetRenderer();
19
20 pRenderer->SetMaterial( m_pMaterial );
21 pRenderer->SetColour( m_uiColour );
22
23 if ( IsInFront() )
24 {
25 pRenderer->ResetZCoordinate();
26 }
27
28 Toshi::TVector2 pos1 = { -m_fWidth / 2, -m_fHeight / 2 };
29 Toshi::TVector2 pos2 = { pos1.x + m_fWidth, pos1.y + m_fHeight };
30 pRenderer->RenderRectangle( pos1, pos2, m_UV1.AsVector2(), m_UV2.AsVector2() );
31
33}
34
36{
37 if ( a_pTexSection )
38 {
39 m_pMaterial = a_pTexSection->GetMaterial();
40 m_UV1 = a_pTexSection->GetUVPoint1();
41 m_UV2 = a_pTexSection->GetUVPoint2();
42 }
43 else
44 {
46 }
47}
#define TNULL
Definition Typedefs.h:23
static AGUI2Renderer * GetRenderer()
Definition AGUI2.cpp:239
virtual void Render()
TUINT32 m_uiColour
TBOOL IsInFront() const
Toshi::TVector4 m_UV2
Toshi::TVector4 m_UV1
virtual void Render() override
AGUI2Material * m_pMaterial
void SetTextureSection(AGUI2TextureSection *a_pTexSection)
Sets material and UVs from AGUI2TextureSection.
AGUI2Material * GetMaterial()
Toshi::TVector4 & GetUVPoint2()
Toshi::TVector4 & GetUVPoint1()