1 /** 2 Performs a uniform texture lookup within the visual shader graph. 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.visualshadernodetextureuniform; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.classdb; 24 import godot.visualshadernodeuniform; 25 /** 26 Performs a uniform texture lookup within the visual shader graph. 27 28 Performs a lookup operation on the texture provided as a uniform for the shader. 29 */ 30 @GodotBaseClass struct VisualShaderNodeTextureUniform 31 { 32 package(godot) enum string _GODOT_internal_name = "VisualShaderNodeTextureUniform"; 33 public: 34 @nogc nothrow: 35 union { /** */ godot_object _godot_object; /** */ VisualShaderNodeUniform _GODOT_base; } 36 alias _GODOT_base this; 37 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 38 package(godot) __gshared bool _classBindingInitialized = false; 39 package(godot) static struct GDNativeClassBinding 40 { 41 __gshared: 42 @GodotName("get_color_default") GodotMethod!(VisualShaderNodeTextureUniform.ColorDefault) getColorDefault; 43 @GodotName("get_texture_type") GodotMethod!(VisualShaderNodeTextureUniform.TextureType) getTextureType; 44 @GodotName("set_color_default") GodotMethod!(void, long) setColorDefault; 45 @GodotName("set_texture_type") GodotMethod!(void, long) setTextureType; 46 } 47 /// 48 pragma(inline, true) bool opEquals(in VisualShaderNodeTextureUniform other) const 49 { return _godot_object.ptr is other._godot_object.ptr; } 50 /// 51 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 52 { _godot_object.ptr = n; return null; } 53 /// 54 pragma(inline, true) bool opEquals(typeof(null) n) const 55 { return _godot_object.ptr is n; } 56 /// 57 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 58 mixin baseCasts; 59 /// Construct a new instance of VisualShaderNodeTextureUniform. 60 /// Note: use `memnew!VisualShaderNodeTextureUniform` instead. 61 static VisualShaderNodeTextureUniform _new() 62 { 63 static godot_class_constructor constructor; 64 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualShaderNodeTextureUniform"); 65 if(constructor is null) return typeof(this).init; 66 return cast(VisualShaderNodeTextureUniform)(constructor()); 67 } 68 @disable new(size_t s); 69 /// 70 enum TextureType : int 71 { 72 /** 73 No hints are added to the uniform declaration. 74 */ 75 typeData = 0, 76 /** 77 Adds `hint_albedo` as hint to the uniform declaration for proper sRGB to linear conversion. 78 */ 79 typeColor = 1, 80 /** 81 Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. 82 */ 83 typeNormalmap = 2, 84 /** 85 Adds `hint_aniso` as hint to the uniform declaration to use for a flowmap. 86 */ 87 typeAniso = 3, 88 } 89 /// 90 enum ColorDefault : int 91 { 92 /** 93 Defaults to white color. 94 */ 95 colorDefaultWhite = 0, 96 /** 97 Defaults to black color. 98 */ 99 colorDefaultBlack = 1, 100 } 101 /// 102 enum Constants : int 103 { 104 typeData = 0, 105 colorDefaultWhite = 0, 106 colorDefaultBlack = 1, 107 typeColor = 1, 108 typeNormalmap = 2, 109 typeAniso = 3, 110 } 111 /** 112 113 */ 114 VisualShaderNodeTextureUniform.ColorDefault getColorDefault() const 115 { 116 checkClassBinding!(typeof(this))(); 117 return ptrcall!(VisualShaderNodeTextureUniform.ColorDefault)(GDNativeClassBinding.getColorDefault, _godot_object); 118 } 119 /** 120 121 */ 122 VisualShaderNodeTextureUniform.TextureType getTextureType() const 123 { 124 checkClassBinding!(typeof(this))(); 125 return ptrcall!(VisualShaderNodeTextureUniform.TextureType)(GDNativeClassBinding.getTextureType, _godot_object); 126 } 127 /** 128 129 */ 130 void setColorDefault(in long type) 131 { 132 checkClassBinding!(typeof(this))(); 133 ptrcall!(void)(GDNativeClassBinding.setColorDefault, _godot_object, type); 134 } 135 /** 136 137 */ 138 void setTextureType(in long type) 139 { 140 checkClassBinding!(typeof(this))(); 141 ptrcall!(void)(GDNativeClassBinding.setTextureType, _godot_object, type); 142 } 143 /** 144 Sets the default color if no texture is assigned to the uniform. 145 */ 146 @property VisualShaderNodeTextureUniform.ColorDefault colorDefault() 147 { 148 return getColorDefault(); 149 } 150 /// ditto 151 @property void colorDefault(long v) 152 { 153 setColorDefault(v); 154 } 155 /** 156 Defines the type of data provided by the source texture. See $(D texturetype) for options. 157 */ 158 @property VisualShaderNodeTextureUniform.TextureType textureType() 159 { 160 return getTextureType(); 161 } 162 /// ditto 163 @property void textureType(long v) 164 { 165 setTextureType(v); 166 } 167 }