class com.babylonhx.Engine

Available on all platforms

... @author Krtolica Vujadin

Class Fields

static var ALPHA_ADD:Int

static var ALPHA_COMBINE:Int

static var ALPHA_DISABLE:Int

static var ALPHA_MAXIMIZED:Int

static var ALPHA_MULTIPLY:Int

static var ALPHA_ONEONE:Int

static var ALPHA_SUBTRACT:Int

static var Epsilon:Float

static var Version:String

static var app:Dynamic

static var keyDown:Array<Dynamic>

static var keyUp:Array<Dynamic>

static var mouseDown:Array<Dynamic>

static var mouseMove:Array<Dynamic>

static var mouseUp:Array<Dynamic>

static var touchDown:Array<Dynamic>

static var touchMove:Array<Dynamic>

static var touchUp:Array<Dynamic>

static function cascadeLoad(rootUrl:String, scene:Scene, onfinish:Dynamic ->Voidextensions:Array<String>):Void

static function compileShader(source:String, type:String, defines:String):GLShader

static function getSamplingParameters(samplingMode:Int, generateMipMaps:Bool):Dynamic

static function getWebGLTextureType(type:Int):Int

static function partialLoad(url:String, index:Int, loadedImages:Dynamic, scene:Scene, onfinish:Dynamic ->Void):Void

static function prepareTexture(texture:WebGLTexture, gl:Dynamic, scene:Scene, width:Int, height:Int, invertY:Bool, noMipmap:Bool, isCompressed:Bool, processFunction:Int ->Int ->Void?samplingMode:Int):Void

Instance Fields

function new(canvas:Dynamic, ?antialias:Bool, ?options:Dynamic):Void

function _bindTexture(channel:Int, texture:WebGLTexture):Void

function _releaseEffect(effect:Effect):Void

function _renderLoop(?rect:Dynamic):Void

function _setAnisotropicLevel(key:Int, texture:BaseTexture):Void

function applyStates():Void

function beginFrame():Void

function bindBuffers(vertexBuffer:WebGLBuffer, indexBuffer:WebGLBuffer, vertexDeclaration:Array<Int>, vertexStrideSize:Int, effect:Effect):Void

function bindFramebuffer(texture:WebGLTexture, ?faceIndex:Int):Void

function bindMultiBuffers(vertexBuffers:Map<String, VertexBuffer>, indexBuffer:WebGLBuffer, effect:Effect):Void

function bindSamplers(effect:Effect):Void

function clear(color:Dynamic, backBuffer:Bool, depthStencil:Bool):Void

function createCubeTexture(rootUrl:String, scene:Scene, ?extensions:Array<String>, ?noMipmap:Bool):WebGLTexture

function createDynamicTexture(width:Int, height:Int, generateMipMaps:Bool, samplingMode:Int):WebGLTexture

function createEffect(baseName:Dynamic, attributesNames:Array<String>, uniformsNames:Array<String>, samplers:Array<String>, defines:String, ?fallbacks:EffectFallbacks, ?onCompiled:Effect ->Void?onError:Effect ->String ->Void):Effect

function createEffectForParticles(fragmentName:String, ?uniformsNames:Array<String>, ?samplers:Array<String>, ?defines:String, ?fallbacks:EffectFallbacks, ?onCompiled:Effect ->Void?onError:Effect ->String ->Void):Effect

function createRawTexture(data:ArrayBufferView, width:Int, height:Int, format:Int, generateMipMaps:Bool, invertY:Bool, samplingMode:Int, ?compression:String):WebGLTexture

function createShaderProgram(vertexCode:String, fragmentCode:String, defines:String):GLProgram

function createTexture(url:String, noMipmap:Bool, invertY:Bool, scene:Scene, ?samplingMode:Int, ?onLoad:Void ->Void, ?onError:Void ->Void, ?buffer:Dynamic):WebGLTexture

function dispose():Void

function draw(useTriangles:Bool, indexStart:Int, indexCount:Int, ?instancesCount:Int):Void

function drawPointClouds(verticesStart:Int, verticesCount:Int, ?instancesCount:Int):Void

function enableEffect(effect:Effect):Void

function endFrame():Void

function getAlphaMode():Int

function getAspectRatio(camera:Camera):Float

function getAttributes(shaderProgram:GLProgram, attributesNames:Array<String>):Array<Int>

function getDeltaTime():Float

function getDepthWrite():Bool

function getFps():Float

function getRenderHeight():Int

function getRenderWidth():Int

function getUniforms(shaderProgram:GLProgram, uniformsNames:Array<String>):Map<String, GLUniformLocation>

function readPixels(x:Int, y:Int, width:Int, height:Int):UInt8Array

function resetDrawCalls():Void

function resize():Void

resize the view according to the canvas' size. @example window.addEventListener("resize", function () { engine.resize(); });

function runRenderLoop(renderFunction:Dynamic):Void

function setAlphaMode(mode:Int):Void

function setAlphaTesting(enable:Bool):Void

function setArray(uniform:GLUniformLocation, array:Array<Float>):Void

function setArray2(uniform:GLUniformLocation, array:Array<Float>):Void

function setArray3(uniform:GLUniformLocation, array:Array<Float>):Void

function setArray4(uniform:GLUniformLocation, array:Array<Float>):Void

function setBool(uniform:GLUniformLocation, bool:Bool):Void

function setColor3(uniform:GLUniformLocation, color3:Color3):Void

function setColor4(uniform:GLUniformLocation, color3:Color3, alpha:Float):Void

function setColorWrite(enable:Bool):Void

function setDepthBuffer(enable:Bool):Void

function setDepthWrite(enable:Bool):Void

function setDirectViewport(x:Int, y:Int, width:Int, height:Int):Void

function setFloat(uniform:GLUniformLocation, value:Float):Void

function setFloat2(uniform:GLUniformLocation, x:Float, y:Float):Void

function setFloat3(uniform:GLUniformLocation, x:Float, y:Float, z:Float):Void

function setFloat4(uniform:GLUniformLocation, x:Float, y:Float, z:Float, w:Float):Void

function setMatrices(uniform:GLUniformLocation, matrices:Float32Array):Void

function setMatrix(uniform:GLUniformLocation, matrix:Matrix):Void

function setSamplingMode(texture:WebGLTexture, samplingMode:Int):Void

function setSize(width:Int, height:Int):Void

force a specific size of the canvas

{number}

width - the new canvas' width

{number}

height - the new canvas' height

function setState(culling:Bool, ?zOffset:Float, ?force:Bool, ?reverseSide:Bool):Void

function setTexture(channel:Int, texture:BaseTexture):Void

function setTextureFromPostProcess(channel:Int, postProcess:PostProcess):Void

function setViewport(viewport:Viewport, ?requiredWidth:Float, ?requiredHeight:Float):Void

Set the WebGL's viewport

{BABYLON.Viewport}

viewport - the viewport element to be used.

{number}

[requiredWidth] - the width required for rendering. If not provided the rendering canvas' width is used.

{number}

[requiredHeight] - the height required for rendering. If not provided the rendering canvas' height is used.

function stopRenderLoop(?renderFunction:Void ->Void):Void

stop executing a render loop function and remove it from the execution array

{Function}

[renderFunction] the function to be removed. If not provided all functions will be removed.

function switchFullscreen(requestPointerLock:Bool):Void

function unBindFramebuffer(texture:WebGLTexture, ?disableGenerateMipMaps:Bool):Void

function unBindInstancesBuffer(instancesBuffer:WebGLBuffer, offsetLocations:Array<Int>):Void

function updateAndBindInstancesBuffer(instancesBuffer:WebGLBuffer, data:Float32Array, offsetLocations:Array<Int>):Void

function updateDynamicTexture(texture:WebGLTexture, canvas:Image, invertY:Bool):Void

function updateDynamicVertexBuffer(vertexBuffer:WebGLBuffer, vertices:Dynamic, ?offset:Int):Void

function updateRawTexture(texture:WebGLTexture, data:ArrayBufferView, format:Int, ?invertY:Bool, ?compression:String):Void

function updateTextureSamplingMode(samplingMode:Int, texture:WebGLTexture):Void

function updateVideoTexture(texture:WebGLTexture, video:Dynamic, invertY:Bool):Void

function wipeCaches():Void