class
CrShader::MacroEngine
- CrShader::MacroEngine
- Reference
- Object
Defined in:
crshader/macros/macro_engine.crConstructors
- .new(target : ShaderTarget = ShaderTarget::GDShader, shader_type : ShaderType = ShaderType::Spatial)
Instance Method Summary
- #configure_target(target : ShaderTarget, shader_type : ShaderType = ShaderType::Spatial) : Void
- #constants : Hash(String, Crystal::ASTNode)
- #constants=(constants : Hash(String, Crystal::ASTNode))
-
#expand(node : Crystal::ASTNode) : Crystal::ASTNode
Expand all macros in an AST node recursively
- #features : Hash(String, Crystal::ASTNode)
- #features=(features : Hash(String, Crystal::ASTNode))
- #macros : Hash(String, Crystal::Macro)
- #macros=(macros : Hash(String, Crystal::Macro))
-
#register_constant(name : String, value : Crystal::ASTNode) : Void
Register a compile-time constant for macro evaluation
-
#register_feature(name : String, value : Crystal::ASTNode) : Void
Register a specialization feature and its
FEATURE_<NAME>macro constant -
#register_macro(macro_node : Crystal::Macro)
Register a macro definition
Constructor Detail
def self.new(target : ShaderTarget = ShaderTarget::GDShader, shader_type : ShaderType = ShaderType::Spatial)
#
Instance Method Detail
def configure_target(target : ShaderTarget, shader_type : ShaderType = ShaderType::Spatial) : Void
#
def expand(node : Crystal::ASTNode) : Crystal::ASTNode
#
Expand all macros in an AST node recursively
def register_constant(name : String, value : Crystal::ASTNode) : Void
#
Register a compile-time constant for macro evaluation
def register_feature(name : String, value : Crystal::ASTNode) : Void
#
Register a specialization feature and its FEATURE_<NAME> macro constant