ShaderStage
in package
Table of Contents
Constants
- FRAGMENT = GL_FRAGMENT_SHADER
- GEOMETRY = GL_GEOMETRY_SHADER
- TESS_CONTROL = GL_TESS_CONTROL_SHADER
- TESS_EVALUATION = GL_TESS_EVALUATION_SHADER
- VERTEX = GL_VERTEX_SHADER
Properties
Methods
- __construct() : mixed
- Constructor Creating a shader object will also create the shader in OpenGL
- __destruct() : mixed
- Destructor
- compile() : void
- Compiles the shader object
- fragment() : ShaderStage
- geometry() : ShaderStage
- getInfoLog() : string
- Returns the shader info log (GL_INFO_LOG)
- getLogLength() : int
- Returns the shader log length (GL_INFO_LOG_LENGTH)
- getShaderiv() : int
- Returns a parameter of the shader object
- getSourceLength() : int
- Returns the shader source code length (GL_SHADER_SOURCE_LENGTH)
- getTypeFromGL() : int
- Returns the current shader type (GL_SHADER_TYPE)
- isCompiled() : bool
- Returns boolean indicating whether the shader is compiled (GL_COMPILE_STATUS)
- isDeleted() : bool
- Returns boolean indicating whether the shader is marked as deleted (GL_DELETE_STATUS)
- setSourceCode() : void
- Sets the shader source code and uploads it to OpenGL
- tessControl() : ShaderStage
- tessEvaluation() : ShaderStage
- vertex() : ShaderStage
Constants
FRAGMENT
public
mixed
FRAGMENT
= GL_FRAGMENT_SHADER
GEOMETRY
public
mixed
GEOMETRY
= GL_GEOMETRY_SHADER
TESS_CONTROL
public
mixed
TESS_CONTROL
= GL_TESS_CONTROL_SHADER
TESS_EVALUATION
public
mixed
TESS_EVALUATION
= GL_TESS_EVALUATION_SHADER
VERTEX
public
mixed
VERTEX
= GL_VERTEX_SHADER
Properties
$id read-only
OpenGL shader ID
public
int
$id
$type read-only
Shader type
public
int
$type
Methods
__construct()
Constructor Creating a shader object will also create the shader in OpenGL
public
__construct(int $type[, string|null $sourceCode = null ]) : mixed
Parameters
- $type : int
- $sourceCode : string|null = null
__destruct()
Destructor
public
__destruct() : mixed
compile()
Compiles the shader object
public
compile() : void
Tags
fragment()
public
static fragment([string|null $sourceCode = null ]) : ShaderStage
Parameters
- $sourceCode : string|null = null
Return values
ShaderStagegeometry()
public
static geometry([string|null $sourceCode = null ]) : ShaderStage
Parameters
- $sourceCode : string|null = null
Return values
ShaderStagegetInfoLog()
Returns the shader info log (GL_INFO_LOG)
public
getInfoLog() : string
Return values
stringgetLogLength()
Returns the shader log length (GL_INFO_LOG_LENGTH)
public
getLogLength() : int
Return values
intgetShaderiv()
Returns a parameter of the shader object
public
getShaderiv(int $pname) : int
Parameters
- $pname : int
-
The paramter name (GL_SHADER_TYPE, GL_DELETE_STATUS, GL_COMPILE_STATUS, GL_INFO_LOG_LENGTH, GL_SHADER_SOURCE_LENGTH)
Return values
intgetSourceLength()
Returns the shader source code length (GL_SHADER_SOURCE_LENGTH)
public
getSourceLength() : int
Return values
intgetTypeFromGL()
Returns the current shader type (GL_SHADER_TYPE)
public
getTypeFromGL() : int
Return values
intisCompiled()
Returns boolean indicating whether the shader is compiled (GL_COMPILE_STATUS)
public
isCompiled() : bool
Return values
boolisDeleted()
Returns boolean indicating whether the shader is marked as deleted (GL_DELETE_STATUS)
public
isDeleted() : bool
Return values
boolsetSourceCode()
Sets the shader source code and uploads it to OpenGL
public
setSourceCode(string $sourceCode) : void
Parameters
- $sourceCode : string
-
The shader source code
tessControl()
public
static tessControl([string|null $sourceCode = null ]) : ShaderStage
Parameters
- $sourceCode : string|null = null
Return values
ShaderStagetessEvaluation()
public
static tessEvaluation([string|null $sourceCode = null ]) : ShaderStage
Parameters
- $sourceCode : string|null = null
Return values
ShaderStagevertex()
public
static vertex([string|null $sourceCode = null ]) : ShaderStage
Parameters
- $sourceCode : string|null = null