OpenBarnyard
 
Loading...
Searching...
No Matches
TMesh.h
Go to the documentation of this file.
1#pragma once
2#include "TMaterial.h"
3
5
6class TShader;
7
8class TMesh : public TObject
9{
10public:
12
13public:
14 using State = TUINT32;
23
24 // These flags can be used by the client classes
25 using FLAG = TUINT32;
26 enum FLAG_ : FLAG
27 {
28 FLAG_LOCKED = 0x8000
29 };
30
31public:
32 TMesh();
33
34 //-----------------------------------------------------------------------------
35 // Own methods
36 //-----------------------------------------------------------------------------
37 virtual TBOOL Validate();
38 virtual void Invalidate();
39 virtual TBOOL Create();
40 virtual TBOOL Render();
41 virtual void OnDestroy();
42
43 void SetFlags( State a_eFlags, TBOOL a_bEnable );
44
45 void DestroyResource();
46
47 TMaterial* GetMaterial() const;
48 void SetMaterial( TMaterial* a_pMaterial );
49
51 void SetOwnerShader( TShader* a_pShader );
52
53 TBOOL IsCreated() const;
54 TBOOL IsValidated() const;
55 TBOOL IsUnknownState1() const;
56
57protected:
58 ~TMesh();
59
60protected:
63 State m_State; // 0x0C
64};
65
#define BITFLAG(x)
Definition Defines.h:10
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
uint32_t TUINT32
Definition Typedefs.h:13
bool TBOOL
Definition Typedefs.h:6
virtual void Invalidate()
Definition TMesh.cpp:34
TBOOL IsCreated() const
Definition TMesh.cpp:86
virtual TBOOL Create()
Definition TMesh.cpp:39
void SetOwnerShader(TShader *a_pShader)
Definition TMesh.cpp:80
void SetMaterial(TMaterial *a_pMaterial)
Definition TMesh.cpp:70
virtual TBOOL Render()
Definition TMesh.cpp:45
virtual TBOOL Validate()
Definition TMesh.cpp:28
TShader * m_pOwnerShader
Definition TMesh.h:62
TShader * GetOwnerShader()
Definition TMesh.cpp:101
TBOOL IsValidated() const
Definition TMesh.cpp:91
TDECLARE_CLASS(TMesh, TObject)
TMaterial * GetMaterial() const
Definition TMesh.cpp:75
~TMesh()
Definition TMesh.cpp:21
State_
Definition TMesh.h:16
@ State_Glow
Definition TMesh.h:21
@ State_Validated
Definition TMesh.h:19
@ State_None
Definition TMesh.h:17
@ State_Unknown1
Definition TMesh.h:20
@ State_Created
Definition TMesh.h:18
TMaterial * m_pMaterial
Definition TMesh.h:61
TMesh()
Definition TMesh.cpp:14
State m_State
Definition TMesh.h:63
TBOOL IsUnknownState1() const
Definition TMesh.cpp:96
TUINT32 State
Definition TMesh.h:14
FLAG_
Definition TMesh.h:27
@ FLAG_LOCKED
Definition TMesh.h:28
virtual void OnDestroy()
Definition TMesh.cpp:50
TUINT32 FLAG
Definition TMesh.h:25
void DestroyResource()
Definition TMesh.cpp:63
void SetFlags(State a_eFlags, TBOOL a_bEnable)
Definition TMesh.cpp:55