m4m.framework.WebGLUtils
@meta4d/engine / Exports / m4m / framework / WebGLUtils
Class: WebGLUtils
Table of contents
Constructors
Methods
Constructors
constructor
• new WebGLUtils()
Defined in
framework/util/webgl-utils.ts:104
Methods
create3DContext
▸ create3DContext(canvas
, opt_attribs
): any
Creates a webgl context.
Parameters
canvas
any
The canvas tag to get context from. If one is not passed in one will be created.
opt_attribs
any
-
Returns
any
The created context.
Defined in
framework/util/webgl-utils.ts:90
setupWebGL
▸ setupWebGL(canvas
, opt_attribs?
, opt_onError?
): any
Creates a webgl context. If creation fails it will change the contents of the container of the tag to an error message with the correct links for WebGL.
Parameters
canvas
Element
undefined
-
opt_attribs
WebGLContextAttributes
null
Any creation attributes you want to pass in.
opt_onError
(msg
: string
) => void
null
An function to call if there is an error during creation.
Returns
any
The created context.
Defined in
Last updated