OpenClonk
StdMeshMaterialShaderParameter Class Reference

#include <StdMeshMaterial.h>

Public Types

enum  Type {
  AUTO , AUTO_TEXTURE_MATRIX , INT , FLOAT ,
  FLOAT2 , FLOAT3 , FLOAT4 , MATRIX_4X4
}
 
enum  Auto { AUTO_DUMMY }
 

Public Member Functions

 StdMeshMaterialShaderParameter ()
 
 StdMeshMaterialShaderParameter (Type type)
 
 StdMeshMaterialShaderParameter (const StdMeshMaterialShaderParameter &other)
 
 StdMeshMaterialShaderParameter (StdMeshMaterialShaderParameter &&other)
 
 ~StdMeshMaterialShaderParameter ()
 
StdMeshMaterialShaderParameteroperator= (const StdMeshMaterialShaderParameter &other)
 
StdMeshMaterialShaderParameteroperator= (StdMeshMaterialShaderParameter &&other)
 
Type GetType () const
 
void SetType (Type type)
 
Auto GetAuto () const
 
int GetInt () const
 
float GetFloat () const
 
const float * GetFloatv () const
 
const float * GetMatrix () const
 
AutoGetAuto ()
 
int & GetInt ()
 
float & GetFloat ()
 
float * GetFloatv ()
 
float * GetMatrix ()
 

Detailed Description

Definition at line 42 of file StdMeshMaterial.h.

Member Enumeration Documentation

◆ Auto

Enumerator
AUTO_DUMMY 

Definition at line 56 of file StdMeshMaterial.h.

56  {
57  // TODO: OGRE auto values
59  };

◆ Type

Enumerator
AUTO 
AUTO_TEXTURE_MATRIX 
INT 
FLOAT 
FLOAT2 
FLOAT3 
FLOAT4 
MATRIX_4X4 

Definition at line 45 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

◆ StdMeshMaterialShaderParameter() [1/4]

StdMeshMaterialShaderParameter::StdMeshMaterialShaderParameter ( )
default

◆ StdMeshMaterialShaderParameter() [2/4]

StdMeshMaterialShaderParameter::StdMeshMaterialShaderParameter ( Type  type)

Definition at line 621 of file StdMeshMaterial.cpp.

621  :
622  type(type)
623 {
624  if(type == MATRIX_4X4)
625  matrix = new float[16];
626 }

References MATRIX_4X4.

◆ StdMeshMaterialShaderParameter() [3/4]

StdMeshMaterialShaderParameter::StdMeshMaterialShaderParameter ( const StdMeshMaterialShaderParameter other)

Definition at line 628 of file StdMeshMaterial.cpp.

629 {
630  CopyDeep(other);
631 }

◆ StdMeshMaterialShaderParameter() [4/4]

StdMeshMaterialShaderParameter::StdMeshMaterialShaderParameter ( StdMeshMaterialShaderParameter &&  other)

Definition at line 633 of file StdMeshMaterial.cpp.

634 {
635  Move(std::move(other));
636 }

◆ ~StdMeshMaterialShaderParameter()

StdMeshMaterialShaderParameter::~StdMeshMaterialShaderParameter ( )

Definition at line 638 of file StdMeshMaterial.cpp.

639 {
640  if(type == MATRIX_4X4)
641  delete[] matrix;
642 }

References MATRIX_4X4.

Member Function Documentation

◆ GetAuto() [1/2]

Auto& StdMeshMaterialShaderParameter::GetAuto ( )
inline

Definition at line 81 of file StdMeshMaterial.h.

81 { assert(type == AUTO); return a; }
#define a

References a, and AUTO.

◆ GetAuto() [2/2]

Auto StdMeshMaterialShaderParameter::GetAuto ( ) const
inline

Definition at line 74 of file StdMeshMaterial.h.

74 { assert(type == AUTO); return a; }

References a, and AUTO.

◆ GetFloat() [1/2]

float& StdMeshMaterialShaderParameter::GetFloat ( )
inline

Definition at line 83 of file StdMeshMaterial.h.

83 { assert(type == FLOAT); return f[0]; }

References FLOAT.

◆ GetFloat() [2/2]

float StdMeshMaterialShaderParameter::GetFloat ( ) const
inline

Definition at line 76 of file StdMeshMaterial.h.

76 { assert(type == FLOAT); return f[0]; }

References FLOAT.

◆ GetFloatv() [1/2]

float* StdMeshMaterialShaderParameter::GetFloatv ( )
inline

Definition at line 84 of file StdMeshMaterial.h.

84 { assert(type == FLOAT2 || type == FLOAT3 || type == FLOAT4); return f; }

References FLOAT2, FLOAT3, and FLOAT4.

◆ GetFloatv() [2/2]

const float* StdMeshMaterialShaderParameter::GetFloatv ( ) const
inline

Definition at line 77 of file StdMeshMaterial.h.

77 { assert(type == FLOAT2 || type == FLOAT3 || type == FLOAT4); return f; }

References FLOAT2, FLOAT3, and FLOAT4.

◆ GetInt() [1/2]

int& StdMeshMaterialShaderParameter::GetInt ( )
inline

Definition at line 82 of file StdMeshMaterial.h.

82 { assert(type == INT || type == AUTO_TEXTURE_MATRIX); return i; }

References AUTO_TEXTURE_MATRIX, and INT.

◆ GetInt() [2/2]

int StdMeshMaterialShaderParameter::GetInt ( ) const
inline

Definition at line 75 of file StdMeshMaterial.h.

75 { assert(type == INT || type == AUTO_TEXTURE_MATRIX); return i; }

References AUTO_TEXTURE_MATRIX, and INT.

◆ GetMatrix() [1/2]

float* StdMeshMaterialShaderParameter::GetMatrix ( )
inline

Definition at line 85 of file StdMeshMaterial.h.

85 { assert(type == MATRIX_4X4); return matrix; }

References MATRIX_4X4.

◆ GetMatrix() [2/2]

const float* StdMeshMaterialShaderParameter::GetMatrix ( ) const
inline

Definition at line 78 of file StdMeshMaterial.h.

78 { assert(type == MATRIX_4X4); return matrix; }

References MATRIX_4X4.

◆ GetType()

Type StdMeshMaterialShaderParameter::GetType ( ) const
inline

Definition at line 70 of file StdMeshMaterial.h.

70 { return type; }

◆ operator=() [1/2]

StdMeshMaterialShaderParameter & StdMeshMaterialShaderParameter::operator= ( const StdMeshMaterialShaderParameter other)

Definition at line 644 of file StdMeshMaterial.cpp.

645 {
646  if(this == &other) return *this;
647 
648  if(type == MATRIX_4X4)
649  delete[] matrix;
650 
651  CopyDeep(other);
652  return *this;
653 }

References MATRIX_4X4.

◆ operator=() [2/2]

StdMeshMaterialShaderParameter & StdMeshMaterialShaderParameter::operator= ( StdMeshMaterialShaderParameter &&  other)

Definition at line 655 of file StdMeshMaterial.cpp.

656 {
657  if(this == &other) return *this;
658 
659  if(type == MATRIX_4X4)
660  delete[] matrix;
661 
662  Move(std::move(other));
663  return *this;
664 }

References MATRIX_4X4.

◆ SetType()

void StdMeshMaterialShaderParameter::SetType ( Type  type)

Definition at line 666 of file StdMeshMaterial.cpp.

667 {
668  StdMeshMaterialShaderParameter other(type);
669  Move(std::move(other));
670 }

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