VISU - PHP Game Framework

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

$id  : int
OpenGL shader ID
$type  : int
Shader type

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

TESS_CONTROL

public mixed TESS_CONTROL = GL_TESS_CONTROL_SHADER

TESS_EVALUATION

public mixed TESS_EVALUATION = GL_TESS_EVALUATION_SHADER

Properties

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

getInfoLog()

Returns the shader info log (GL_INFO_LOG)

public getInfoLog() : string
Return values
string

getLogLength()

Returns the shader log length (GL_INFO_LOG_LENGTH)

public getLogLength() : int
Return values
int

getShaderiv()

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
int

getSourceLength()

Returns the shader source code length (GL_SHADER_SOURCE_LENGTH)

public getSourceLength() : int
Return values
int

getTypeFromGL()

Returns the current shader type (GL_SHADER_TYPE)

public getTypeFromGL() : int
Return values
int

isCompiled()

Returns boolean indicating whether the shader is compiled (GL_COMPILE_STATUS)

public isCompiled() : bool
Return values
bool

isDeleted()

Returns boolean indicating whether the shader is marked as deleted (GL_DELETE_STATUS)

public isDeleted() : bool
Return values
bool

setSourceCode()

Sets the shader source code and uploads it to OpenGL

public setSourceCode(string $sourceCode) : void
Parameters
$sourceCode : string

The shader source code

tessEvaluation()

public static tessEvaluation([string|null $sourceCode = null ]) : ShaderStage
Parameters
$sourceCode : string|null = null
Return values
ShaderStage

        
On this page

Search results