Difference between revisions of "Shader:getExternVariable"

m
m
Line 17: Line 17:
 
== See Also ==
 
== See Also ==
 
* [[parent::Shader]]
 
* [[parent::Shader]]
* [[Shader:send}}
+
* [[Shader:send]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
{{#set:Description=Gets information about an 'extern' ('uniform') variable in the Shader.}}
 
{{#set:Description=Gets information about an 'extern' ('uniform') variable in the Shader.}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|Shader:getExternVariable}}
 
{{i18n|Shader:getExternVariable}}

Revision as of 01:37, 11 August 2014

Available since LÖVE 0.9.2
This function is not supported in earlier versions.

Gets information about an 'extern' ('uniform') variable in the shader.

Returns nil if the variable name doesn't exist in the shader, or if the video driver's shader compiler determined that the variable is not used to affect the final output of the shader.

Function

Synopsis

type, components, arrayelements = Shader:getExternVariable( name )

Arguments

string name
The name of the extern variable.

Returns

ShaderVariableType type (nil)
The base type of the variable.
number components (nil)
The number of components in the variable (e.g. 2 for a vec2.)
number arrayelements (nil)
The number of elements in the array if the variable is an array, or 1 if not.

See Also

Other Languages