Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Material Class Reference

#include <Material.h>

+ Inheritance diagram for Leviathan::Material:

Public Member Functions

DLLEXPORT void SetTexture (const std::string &parameter, const Texture::pointer &texture)
 
DLLEXPORT void SetFloat4 (const std::string &parameter, const Float4 &data)
 
DLLEXPORT void SetFloat (const std::string &parameter, float data)
 
DLLEXPORT void SetVariation (const std::string &variation, bool set)
 
bs::HMaterial GetInternal ()
 
void SetTextureWrapper (const std::string &parameter, Texture *texture)
 
 REFERENCE_COUNTED_PTR_TYPE (Material)
 
- Public Member Functions inherited from Leviathan::ReferenceCounted
 ReferenceCounted (const ReferenceCounted &other)=delete
 
ReferenceCountedoperator= (const ReferenceCounted &other)=delete
 
FORCE_INLINE void AddRef () const
 
FORCE_INLINE void Release () const
 removes a reference and deletes the object if reference count reaches zero More...
 
FORCE_INLINE void AddRef ()
 
FORCE_INLINE void Release ()
 
int32_t GetRefCount () const
 Returns the reference count. More...
 

Additional Inherited Members

- Public Types inherited from Leviathan::ReferenceCounted
using basepointer = boost::intrusive_ptr< ReferenceCounted >
 
using refcountedpointer = boost::intrusive_ptr< ReferenceCounted >
 
- Static Public Member Functions inherited from Leviathan::ReferenceCounted
template<class ActualType >
static boost::intrusive_ptr< ActualType > WrapPtr (ActualType *ptr)
 Creates an intrusive_ptr from raw pointer. More...
 
template<class ActualType , class... Args>
static boost::intrusive_ptr< ActualType > MakeShared (Args &&... args)
 Constructs a new instance and wraps it. More...
 
- Protected Member Functions inherited from Leviathan::ReferenceCounted
DLLEXPORT ReferenceCounted ()
 
virtual DLLEXPORT ~ReferenceCounted ()
 

Detailed Description

Definition at line 16 of file Material.h.

Member Function Documentation

◆ GetInternal()

bs::HMaterial Leviathan::Material::GetInternal ( )
inline

Definition at line 33 of file Material.h.

34  {
35  return BsMaterial;
36  }

◆ REFERENCE_COUNTED_PTR_TYPE()

Leviathan::Material::REFERENCE_COUNTED_PTR_TYPE ( Material  )

◆ SetFloat()

DLLEXPORT void Material::SetFloat ( const std::string &  parameter,
float  data 
)

Definition at line 31 of file Material.cpp.

32 {
33  if(!BsMaterial)
34  return;
35 
36  BsMaterial->setFloat(parameter.c_str(), data);
37 }

◆ SetFloat4()

DLLEXPORT void Material::SetFloat4 ( const std::string &  parameter,
const Float4 data 
)

Definition at line 23 of file Material.cpp.

24 {
25  if(!BsMaterial)
26  return;
27 
28  BsMaterial->setVec4(parameter.c_str(), data);
29 }

◆ SetTexture()

DLLEXPORT void Material::SetTexture ( const std::string &  parameter,
const Texture::pointer &  texture 
)

Definition at line 14 of file Material.cpp.

16 {
17  if(!BsMaterial || !texture)
18  return;
19 
20  BsMaterial->setTexture(parameter.c_str(), texture->GetInternal());
21 }

◆ SetTextureWrapper()

void Leviathan::Material::SetTextureWrapper ( const std::string &  parameter,
Texture texture 
)
inline

Definition at line 38 of file Material.h.

39  {
40  SetTexture(parameter, Texture::WrapPtr(texture));
41  }
DLLEXPORT void SetTexture(const std::string &parameter, const Texture::pointer &texture)
Definition: Material.cpp:14
static boost::intrusive_ptr< ActualType > WrapPtr(ActualType *ptr)
Creates an intrusive_ptr from raw pointer.

◆ SetVariation()

DLLEXPORT void Material::SetVariation ( const std::string &  variation,
bool  set 
)

Definition at line 39 of file Material.cpp.

40 {
41  if(!BsMaterial)
42  return;
43 
44  bs::ShaderVariation bsVariation;
45  bsVariation.setBool(variation.c_str(), set);
46  BsMaterial->setVariation(bsVariation);
47 }

The documentation for this class was generated from the following files: