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
//-----------------------------------------------------------------------------
9
#include <
Core/TMemoryDebugOn.h
>
10
11
AGUI2Rectangle::AGUI2Rectangle
()
12
{
13
m_pMaterial
=
TNULL
;
14
}
15
16
void
AGUI2Rectangle::Render
()
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
32
AGUI2Element::Render
();
33
}
34
35
void
AGUI2Rectangle::SetTextureSection
(
AGUI2TextureSection
* a_pTexSection )
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
{
45
m_pMaterial
=
TNULL
;
46
}
47
}
pch.h
TMemoryDebugOn.h
TNULL
#define TNULL
Definition
Typedefs.h:23
AGUI2.h
AGUI2Rectangle.h
AGUI2::GetRenderer
static AGUI2Renderer * GetRenderer()
Definition
AGUI2.cpp:239
AGUI2Element::Render
virtual void Render()
Definition
AGUI2Element.cpp:53
AGUI2Element::m_uiColour
TUINT32 m_uiColour
Definition
AGUI2Element.h:270
AGUI2Element::m_fWidth
TFLOAT m_fWidth
Definition
AGUI2Element.h:268
AGUI2Element::m_fHeight
TFLOAT m_fHeight
Definition
AGUI2Element.h:269
AGUI2Element::IsInFront
TBOOL IsInFront() const
Definition
AGUI2Element.h:151
AGUI2Rectangle::m_UV2
Toshi::TVector4 m_UV2
Definition
AGUI2Rectangle.h:33
AGUI2Rectangle::m_UV1
Toshi::TVector4 m_UV1
Definition
AGUI2Rectangle.h:32
AGUI2Rectangle::AGUI2Rectangle
AGUI2Rectangle()
Definition
AGUI2Rectangle.cpp:11
AGUI2Rectangle::Render
virtual void Render() override
Definition
AGUI2Rectangle.cpp:16
AGUI2Rectangle::m_pMaterial
AGUI2Material * m_pMaterial
Definition
AGUI2Rectangle.h:31
AGUI2Rectangle::SetTextureSection
void SetTextureSection(AGUI2TextureSection *a_pTexSection)
Sets material and UVs from AGUI2TextureSection.
Definition
AGUI2Rectangle.cpp:35
AGUI2TextureSection
Definition
AGUI2TextureSection.h:8
AGUI2TextureSection::GetMaterial
AGUI2Material * GetMaterial()
Definition
AGUI2TextureSection.cpp:27
AGUI2TextureSection::GetUVPoint2
Toshi::TVector4 & GetUVPoint2()
Definition
AGUI2TextureSection.cpp:37
AGUI2TextureSection::GetUVPoint1
Toshi::TVector4 & GetUVPoint1()
Definition
AGUI2TextureSection.cpp:32
D:
_dev
OpenBarnyard
Source
OpenBarnyard
Source
GUI
AGUI2Rectangle.cpp
Generated by
1.13.2