Main | API | WebRender | initialise

Function

initialise(width, height);

Sets all buffers (pixel, depth, vertex, textures, shaders) to default empty values ready for drawing.

Parameters

width - [Unsigned Integer]

The pixel width of the drawing area.

height - [Unsigned Integer]

The pixel height of the drawings area.

Return

Success - [Boolean]

Returns 0/false if an error is detected, else returns 1/true.

Description

This is the setup function for a WebRender instance that creates and readies all buffers and sets all internal properties to default values. It takes a width and height a parameters that define how big the pixel area is that is being drawn. This function must be called before any other functions, else an error will be returned. Once called, a flag is set to allow for other functions to be executed in this WebRender instance.

Calling this function a second time will allow you to 'reset' a WebRender instance, though this should be avoided and a new instance should be created instead. If you are looking to resize the drawing area, instead use the resetScreen function.

Additional Notes

None.