Difference between revisions of "love.graphics.validateShader"

(love.graphics.validateShader)
 
m (Fix typo)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{newin|[[0.11.0]]|110|type=function}}
+
{{newin|[[11.0]]|110|type=function}}
Validates shader code. Check if specificed shader code can be loaded with [[love.graphics.newShader]]
+
Validates shader code. Check if specified shader code does not contain any errors.
 
 
{{notice|This is unofficial documentation. It might be not accurate!}}
 
  
 
== Function ==
 
== Function ==
Line 13: Line 11:
 
{{param|string|code|The pixel shader or vertex shader code, or a filename pointing to a file with the code.}}
 
{{param|string|code|The pixel shader or vertex shader code, or a filename pointing to a file with the code.}}
 
=== Returns ===
 
=== Returns ===
{{param|boolean|status|A Shader object for use in drawing operations.}}
+
{{param|boolean|status|<code>true</code> if specified shader code doesn't contain any errors. <code>false</code> otherwise.}}
 
{{param|string|message|Reason why shader code validation failed (or <code>nil</code> if validation succeded).}}
 
{{param|string|message|Reason why shader code validation failed (or <code>nil</code> if validation succeded).}}
  
Line 26: Line 24:
 
{{param|string|vertexcode|The vertex shader code, or a filename pointing to a file with the code.}}
 
{{param|string|vertexcode|The vertex shader code, or a filename pointing to a file with the code.}}
 
=== Returns ===
 
=== Returns ===
{{param|boolean|status|A Shader object for use in drawing operations.}}
+
{{param|boolean|status|<code>true</code> if specified shader code doesn't contain any errors. <code>false</code> otherwise.}}
 
{{param|string|message|Reason why shader code validation failed (or <code>nil</code> if validation succeded).}}
 
{{param|string|message|Reason why shader code validation failed (or <code>nil</code> if validation succeded).}}
  
Line 33: Line 31:
 
* [[love.graphics.newShader]]
 
* [[love.graphics.newShader]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Sub-Category::Object Creation| ]]
 
{{#set:Description=Validates shader code.}}
 
{{#set:Description=Validates shader code.}}
  
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.graphics.validateShader}}
 
{{i18n|love.graphics.validateShader}}

Latest revision as of 11:26, 25 May 2019

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

Validates shader code. Check if specified shader code does not contain any errors.

Function

Synopsis

status, message = love.graphics.validateShader( gles, code )

Arguments

boolean gles
Validate code as GLSL ES shader.
string code
The pixel shader or vertex shader code, or a filename pointing to a file with the code.

Returns

boolean status
true if specified shader code doesn't contain any errors. false otherwise.
string message
Reason why shader code validation failed (or nil if validation succeded).

Function

Synopsis

status, message = love.graphics.validateShader( gles, pixelcode, vertexcode )

Arguments

boolean gles
Validate code as GLSL ES shader.
string pixelcode
The pixel shader code, or a filename pointing to a file with the code.
string vertexcode
The vertex shader code, or a filename pointing to a file with the code.

Returns

boolean status
true if specified shader code doesn't contain any errors. false otherwise.
string message
Reason why shader code validation failed (or nil if validation succeded).

See Also


Other Languages