OpenClonk
StdMeshMaterialTechnique Class Reference

#include <StdMeshMaterial.h>

Collaboration diagram for StdMeshMaterialTechnique:
[legend]

Public Member Functions

 StdMeshMaterialTechnique ()
 
void Load (StdMeshMaterialParserCtx &ctx)
 
bool IsOpaque () const
 

Public Attributes

StdCopyStrBuf Name
 
std::vector< StdMeshMaterialPassPasses
 
bool Available {false}
 

Detailed Description

Definition at line 474 of file StdMeshMaterial.h.

Constructor & Destructor Documentation

◆ StdMeshMaterialTechnique()

StdMeshMaterialTechnique::StdMeshMaterialTechnique ( )
default

Member Function Documentation

◆ IsOpaque()

bool StdMeshMaterialTechnique::IsOpaque ( ) const

Definition at line 1446 of file StdMeshMaterial.cpp.

1447 {
1448  // Technique is opaque if one of the passes is opaque (subsequent
1449  // non-opaque passes will just depend on the opaque value drawn in
1450  // the previous pass; total result will not depend on original
1451  // frame buffer value).
1452  for(const auto & Pass : Passes)
1453  if(Pass.IsOpaque())
1454  return true;
1455  return false;
1456 }
std::vector< StdMeshMaterialPass > Passes

◆ Load()

void StdMeshMaterialTechnique::Load ( StdMeshMaterialParserCtx ctx)

Definition at line 1427 of file StdMeshMaterial.cpp.

1428 {
1429  Token token;
1430  StdCopyStrBuf token_name;
1431  StdMeshMaterialSubLoader pass_loader;
1432  while ((token = ctx.AdvanceNonEOF(token_name)) == TOKEN_IDTF)
1433  {
1434  if (token_name == "pass")
1435  {
1436  pass_loader.Load(ctx, Passes);
1437  }
1438  else
1439  ctx.ErrorUnexpectedIdentifier(token_name);
1440  }
1441 
1442  if (token != TOKEN_BRACE_CLOSE)
1443  ctx.Error(StdCopyStrBuf("'") + token_name.getData() + "' unexpected");
1444 }
@ TOKEN_IDTF
@ TOKEN_BRACE_CLOSE
void Error(const StdStrBuf &message)
void ErrorUnexpectedIdentifier(const StdStrBuf &identifier)
Token AdvanceNonEOF(StdStrBuf &name)
void Load(StdMeshMaterialParserCtx &ctx, std::vector< SubT > &vec)
const char * getData() const
Definition: StdBuf.h:442

References StdMeshMaterialParserCtx::AdvanceNonEOF(), StdMeshMaterialParserCtx::Error(), StdMeshMaterialParserCtx::ErrorUnexpectedIdentifier(), StdStrBuf::getData(), StdMeshMaterialSubLoader::Load(), TOKEN_BRACE_CLOSE, and TOKEN_IDTF.

Here is the call graph for this function:

Member Data Documentation

◆ Available

bool StdMeshMaterialTechnique::Available {false}

Definition at line 488 of file StdMeshMaterial.h.

Referenced by CStdGL::PrepareMaterial().

◆ Name

StdCopyStrBuf StdMeshMaterialTechnique::Name

Definition at line 483 of file StdMeshMaterial.h.

Referenced by CStdGL::PrepareMaterial().

◆ Passes

std::vector<StdMeshMaterialPass> StdMeshMaterialTechnique::Passes

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