class CrShader::MacroEngine

Defined in:

crshader/macros/macro_engine.cr

Constructors

Instance Method Summary

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 constants : Hash(String, Crystal::ASTNode) #

def constants=(constants : Hash(String, Crystal::ASTNode)) #

def expand(node : Crystal::ASTNode) : Crystal::ASTNode #

Expand all macros in an AST node recursively


def features : Hash(String, Crystal::ASTNode) #

def features=(features : Hash(String, Crystal::ASTNode)) #

def macros : Hash(String, Crystal::Macro) #

def macros=(macros : Hash(String, Crystal::Macro)) #

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


def register_macro(macro_node : Crystal::Macro) #

Register a macro definition