VISU - PHP Game Framework

AbstractFramebuffer
in package

AbstractYes

Table of Contents

Properties

$clearColor  : Vec4
Framebuffers clearing color
$id  : int
OpenGL framebuffer ID
$gl  : GLState
GL State instance as we modify the GL state

Methods

bind()  : bool
Binds the framebuffer to the current context
clear()  : void
Clears the framebuffer Note: This will bind the framebuffer to the current context!
getFramebufferStatusString()  : string
Returns the given framebuffer status as string
getStatus()  : int
Returns the current framebuffer statsus Note: This will bind the framebuffer to the current context!
isValid()  : bool
Performs a status check on the framebuffer and returns boolean result.
__construct()  : mixed
Constructor

Properties

Methods

bind()

Binds the framebuffer to the current context

public bind([FramebufferTarget $target = FramebufferTarget::READ_DRAW ]) : bool
Parameters
$target : FramebufferTarget = FramebufferTarget::READ_DRAW

Specifies the target to which the framebuffer is bound.

Return values
bool —

Returns true if the framebuffer was bound, false if it was already bound

clear()

Clears the framebuffer Note: This will bind the framebuffer to the current context!

public clear([int $clearbits = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT ]) : void
Parameters
$clearbits : int = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT

getFramebufferStatusString()

Returns the given framebuffer status as string

public getFramebufferStatusString(int $status) : string
Parameters
$status : int
Return values
string

getStatus()

Returns the current framebuffer statsus Note: This will bind the framebuffer to the current context!

public getStatus() : int

Status can be one of:

  • GL_FRAMEBUFFER_COMPLETE
  • GL_FRAMEBUFFER_UNDEFINED
  • GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
  • GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
  • GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER
  • GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER
  • GL_FRAMEBUFFER_UNSUPPORTED
  • GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
  • GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS
Return values
int

isValid()

Performs a status check on the framebuffer and returns boolean result.

public isValid([int &$status = null ][, string &$error = null ]) : bool

If you wan't to get the error code and or message, the first two parameters are passed by reference.

Parameters
$status : int = null
$error : string = null
Return values
bool

        
On this page

Search results