Class: AxWebGLGraphicsDevice

AxWebGLGraphicsDevice()

new AxWebGLGraphicsDevice()

Creates a new graphics device
Source:

Methods

BeginScene()

Begins rendering a new scene. This method should be called before rendering a new frame
Source:

ClearDepthBuffer()

Clears the depth buffer
Source:

ClearScreen(color)

Clears the frame buffer with a specified color
Parameters:
Name Type Description
color AxVector4 Color to cleare the frame buffer with
Source:

CreateMesh() → {AxGraphicsDeviceMesh}

Creates a new mesh for the respective device
Source:
Returns:
New mesh for the respective device
Type
AxGraphicsDeviceMesh

CreateShader() → {AxDeviceShader}

Creates a new shader for the respective device
Source:
Returns:
New shader for the respective device
Type
AxDeviceShader

CreateTexture() → {AxDeviceTexture2D}

Creates a new texture for the respective device
Source:
Returns:
New texture for the respective device
Type
AxDeviceTexture2D

EndScene()

Ends rendering of a scene. This method should be called after all rendering in a frame is done
Source:

GetGLContext(canvas) → {WebGLContext}

Gets a GL context from the given canvas element
Parameters:
Name Type Description
canvas Canvas The canvas element to get GL context from
Source:
Returns:
If succeeded, a GL context is returned. If failed null is returned
Type
WebGLContext

GetPixelFormat() → {AxPixelFormat}

Gets the pixel format of the device
Source:
Returns:
The pixel format of the device
Type
AxPixelFormat

Present() → {Boolean}

Presents the frame buffer on the screen to the set rendering target window
Source:
Returns:
True if presenting succeeded.
Type
Boolean

RenderMesh()

Renders the mesh set to the device using the set shader and device settings
Source:

SetMesh(mesh)

Sets the mesh to render
Parameters:
Name Type Description
mesh AxDeviceMesh The mesh to be rendered
Source:

SetRenderState(renderState)

Sets the render state The render state represents a set of settings for the graphics device
Parameters:
Name Type Description
renderState AxRenderState The rendering state to be set
Source:

SetRenderTargetTexture(texture) → {Bool}

Sets a target texture to render onto
Parameters:
Name Type Description
texture AxDeviceTexture2D Texture to use for rendering onto
Source:
Returns:
True if the render target was set successfully
Type
Bool

SetRenderTargetWindow(windowHandle) → {Bool}

Sets a target window for presenting the rendering result
Parameters:
Name Type Description
windowHandle Canvas Canvas to use for presenting the rendering result
Source:
Returns:
New mesh for the respective device
Type
Bool

SetShader(shader)

Sets the rendering shader
Parameters:
Name Type Description
shader AxDeviceShader The shader to be set
Source:

SetViewport(x, y, width, height)

Sets the viewport of the frame buffer
Parameters:
Name Type Description
x Integer Left boundary in pixels of the viewport
y Integer Top boundary in pixels of the viewport
width Integer Width in pixels of the viewport
height Integer Height in pixels of the viewport
Source:

Documentation generated by JSDoc 3.5.3 on Mon Feb 19 2018 20:39:27 GMT+0200 (FLE Standard Time)