1 /**
2 A $(D CubeMap) sampling node to be used 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.visualshadernodecubemap;
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.visualshadernode;
25 import godot.resource;
26 import godot.reference;
27 import godot.cubemap;
28 /**
29 A $(D CubeMap) sampling node to be used within the visual shader graph.
30 
31 Translated to `texture(cubemap, vec3)` in the shader language. Returns a color vector and alpha channel as scalar.
32 */
33 @GodotBaseClass struct VisualShaderNodeCubeMap
34 {
35 	package(godot) enum string _GODOT_internal_name = "VisualShaderNodeCubeMap";
36 public:
37 @nogc nothrow:
38 	union { /** */ godot_object _godot_object; /** */ VisualShaderNode _GODOT_base; }
39 	alias _GODOT_base this;
40 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
41 	package(godot) __gshared bool _classBindingInitialized = false;
42 	package(godot) static struct GDNativeClassBinding
43 	{
44 		__gshared:
45 		@GodotName("get_cube_map") GodotMethod!(CubeMap) getCubeMap;
46 		@GodotName("get_source") GodotMethod!(VisualShaderNodeCubeMap.Source) getSource;
47 		@GodotName("get_texture_type") GodotMethod!(VisualShaderNodeCubeMap.TextureType) getTextureType;
48 		@GodotName("set_cube_map") GodotMethod!(void, CubeMap) setCubeMap;
49 		@GodotName("set_source") GodotMethod!(void, long) setSource;
50 		@GodotName("set_texture_type") GodotMethod!(void, long) setTextureType;
51 	}
52 	/// 
53 	pragma(inline, true) bool opEquals(in VisualShaderNodeCubeMap other) const
54 	{ return _godot_object.ptr is other._godot_object.ptr; }
55 	/// 
56 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
57 	{ _godot_object.ptr = n; return null; }
58 	/// 
59 	pragma(inline, true) bool opEquals(typeof(null) n) const
60 	{ return _godot_object.ptr is n; }
61 	/// 
62 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
63 	mixin baseCasts;
64 	/// Construct a new instance of VisualShaderNodeCubeMap.
65 	/// Note: use `memnew!VisualShaderNodeCubeMap` instead.
66 	static VisualShaderNodeCubeMap _new()
67 	{
68 		static godot_class_constructor constructor;
69 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualShaderNodeCubeMap");
70 		if(constructor is null) return typeof(this).init;
71 		return cast(VisualShaderNodeCubeMap)(constructor());
72 	}
73 	@disable new(size_t s);
74 	/// 
75 	enum TextureType : int
76 	{
77 		/**
78 		No hints are added to the uniform declaration.
79 		*/
80 		typeData = 0,
81 		/**
82 		Adds `hint_albedo` as hint to the uniform declaration for proper sRGB to linear conversion.
83 		*/
84 		typeColor = 1,
85 		/**
86 		Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map.
87 		*/
88 		typeNormalmap = 2,
89 	}
90 	/// 
91 	enum Source : int
92 	{
93 		/**
94 		Use the $(D CubeMap) set via $(D cubeMap). If this is set to $(D source), the `samplerCube` port is ignored.
95 		*/
96 		sourceTexture = 0,
97 		/**
98 		Use the $(D CubeMap) sampler reference passed via the `samplerCube` port. If this is set to $(D source), the $(D cubeMap) texture is ignored.
99 		*/
100 		sourcePort = 1,
101 	}
102 	/// 
103 	enum Constants : int
104 	{
105 		sourceTexture = 0,
106 		typeData = 0,
107 		typeColor = 1,
108 		sourcePort = 1,
109 		typeNormalmap = 2,
110 	}
111 	/**
112 	
113 	*/
114 	Ref!CubeMap getCubeMap() const
115 	{
116 		checkClassBinding!(typeof(this))();
117 		return ptrcall!(CubeMap)(GDNativeClassBinding.getCubeMap, _godot_object);
118 	}
119 	/**
120 	
121 	*/
122 	VisualShaderNodeCubeMap.Source getSource() const
123 	{
124 		checkClassBinding!(typeof(this))();
125 		return ptrcall!(VisualShaderNodeCubeMap.Source)(GDNativeClassBinding.getSource, _godot_object);
126 	}
127 	/**
128 	
129 	*/
130 	VisualShaderNodeCubeMap.TextureType getTextureType() const
131 	{
132 		checkClassBinding!(typeof(this))();
133 		return ptrcall!(VisualShaderNodeCubeMap.TextureType)(GDNativeClassBinding.getTextureType, _godot_object);
134 	}
135 	/**
136 	
137 	*/
138 	void setCubeMap(CubeMap value)
139 	{
140 		checkClassBinding!(typeof(this))();
141 		ptrcall!(void)(GDNativeClassBinding.setCubeMap, _godot_object, value);
142 	}
143 	/**
144 	
145 	*/
146 	void setSource(in long value)
147 	{
148 		checkClassBinding!(typeof(this))();
149 		ptrcall!(void)(GDNativeClassBinding.setSource, _godot_object, value);
150 	}
151 	/**
152 	
153 	*/
154 	void setTextureType(in long value)
155 	{
156 		checkClassBinding!(typeof(this))();
157 		ptrcall!(void)(GDNativeClassBinding.setTextureType, _godot_object, value);
158 	}
159 	/**
160 	The $(D CubeMap) texture to sample when using $(D constant SOURCE_TEXTURE) as $(D source).
161 	*/
162 	@property CubeMap cubeMap()
163 	{
164 		return getCubeMap();
165 	}
166 	/// ditto
167 	@property void cubeMap(CubeMap v)
168 	{
169 		setCubeMap(v);
170 	}
171 	/**
172 	Defines which source should be used for the sampling. See $(D source) for options.
173 	*/
174 	@property VisualShaderNodeCubeMap.Source source()
175 	{
176 		return getSource();
177 	}
178 	/// ditto
179 	@property void source(long v)
180 	{
181 		setSource(v);
182 	}
183 	/**
184 	Defines the type of data provided by the source texture. See $(D texturetype) for options.
185 	*/
186 	@property VisualShaderNodeCubeMap.TextureType textureType()
187 	{
188 		return getTextureType();
189 	}
190 	/// ditto
191 	@property void textureType(long v)
192 	{
193 		setTextureType(v);
194 	}
195 }