Static variables

@:value("Preview")staticfinalread onlyBUILD_NAME:String = "Preview"

@:value("1.0.1")staticfinalread onlyVERSION:String = "1.0.1"

@:value(0)staticframeCount:Int = 0

@:value(0)staticdrawCalls:Int = 0

@:value(0)staticverticesDrawn:Int = 0

@:value(0)staticstateSwitches:Int = 0

@:value(0)staticrenderedInstances:Int = 0

@:value(0)staticallocationsThisFrame:Int = 0

@:value(false)staticinitialized:Bool = false

The GL render context name FoxLite is running on, this can be: - OPENGL: Windows/Linux - WEBGL: Browsers - OPENGLES: Mobile, ES devices

@:value("")staticrenderContext:String = ""

@:value("")staticglDeviceName:String = ""

@:value(-1)static__blendMode:FoxBlendMode = -1

@:value(true)static__depthTest:Bool = true

@:value(false)static__stencilTest:Bool = false

@:value(false)static__scissorTest:Bool = false

@:value(null)static__indexBuffer:Dynamic = null

@:value(GL.TRIANGLES)staticrenderMode:Int = GL.TRIANGLES

@:value(true)staticmustRebuildDrawGroups:Bool = true

If true, all scenes must rebuild their draw groups. Draw groups are required for material and mesh drawing/sorting.

This is set whenever: - A material changes render priority - A mesh assigned a new material - A model has been added/removed from a scene - A model has changed visibility - A model assigned/changed its meshes - Or an Instanced Model was set from/to 0 instances

We can afford doing this per frame because the builder isn't that expensive, however it's better to keep it as static as possible in HScript for best performance.

@:value(false)staticcalculateMotionVectors:Bool = false

If enabled, motion vectors will be calculated for 3D objects.

Motion vectors are used for all sort of neat effects such as Motion Blur and Temporal Reprojection, plus some additional advanced rendering

Note that to output motion vector data you'll need a compatible shader with the respective flags enabled

This technique might require a bit more memory since previous transfomation matrices are stored in memory for each object.

@:value(0.0)staticdebugWireframe:Float = 0.0

If greater than 0, forces the renderer to render using GL.LINES with the specified width

@:value(null)static__shader:FoxShader = null

@:value(null)static__target:FoxFramebuffer = null

@:value(null)staticcontext:Context3D = null

@:value(new FlxTypedSignalImpl())staticfinalread onlyonPreDraw:FlxTypedSignalImpl<() ‑> Void> = new FlxTypedSignalImpl()

@:value(new FlxTypedSignalImpl())staticfinalread onlyonPostDraw:FlxTypedSignalImpl<() ‑> Void> = new FlxTypedSignalImpl()

@:value(null)staticMISSING_TEXTURE:FoxTexture = null

Missing texture placeholder.

@:value(new FoxMaterial())staticMISSING_MATERIAL:FoxMaterial = new FoxMaterial()

Missing material placeholder.

@:value(null)staticMISSING_SHADER:FoxShader = null

Missing shader placeholder.

Static methods

staticstaticInit():Void

staticinlinegetContext():Context3D

Gets and updates the Context3D that can be used to do most OpenGL operations. This contains a WebGLRenderContext, meaning things can be limited

staticinlinegetWindow():Window

Gets the current lime window the game is running on.

staticinlinegetGLVersion():String

staticgetSupportedExtensionsObject():Map<String, Dynamic>

Returns a Map containing the supported extensions for the OpenGL context.

It is different than gl.getSupportedExtensions() since most of the time, the extension object does not exist even if it's listed as supported. This function returns the extensions that do exist in lime.

staticinitLibs():Void

Initializes static classes

staticbegin():Void

staticbackToFlixel():Void

staticgenerateMipmap(context:Context3D, texture:FoxTexture):Void

@:value({ side : 5 })staticsetTarget(?target:FoxFramebuffer, side:FoxCubemapSide = 5):Void

Sets the target framebuffer where to render stuff to. Setting it to null unbinds the target.

Parameters:

side

If the target is a FoxFramebufferCubemap, you can specify which side of the cube to use

staticclearDepthStencil():Void

staticinlineuseShader(shader:FoxShader):Void

staticuseTexture(sampler:Int, texture:FoxTexture):Void

Binds a texture to a sampler texture unit in the current render state.

In reality, a cut-down version of this method is used to set textures to uniforms, but this is here if you need it.

Parameters:

sampler

The sampler texture unit

texture

A FoxTexture

staticactiveTextures(context:Context3D, textureInput:Map<String, FoxShaderTextureInput>):Int

staticuseMaterial(context:Context3D, material:FoxMaterial):Int

Prepares a material for the render state.

Returns:

The next sampler index available for a texture, useful if you want to add more textures to the render state afterwards.

staticuseMaterialForShadow(context:Context3D, material:FoxMaterial):Int

staticdrawMesh(context:Context3D, mesh:FoxMesh, shader:FoxShader):Void

Renders a mesh, simple as that! Render pipeline must be set up for this.

staticdrawMeshInstanced(context:Context3D, mesh:FoxMesh, shader:FoxShader, count:Int, instanceData:FoxInstanceData):Void

Draws a mesh multiple times via instancing, useful for particles.

Note: For this, you need to supply extra data for each individual transform, aswell as using an instancing-compatible shader.

Note 2: Instancing operations only works in OpenGL 3.0+

staticenableAlphaBlending(context:Context3D):Void

Enables alpha blending without changing the color function

staticsetBlendMode(context:Context3D, blendMode:Int):Void

staticsetScissorRect(rect:Rectangle):Void

@:value({ type : "unsigned_byte", format : "rgba" })staticcreateTextureStorage(width:Int, height:Int, format:String = "rgba", type:String = "unsigned_byte"):Texture

A GPU texture that can be of any available format It can hold any sort of values, for deferred renderers and storage.

For a friendly list of available formats, check MDN's texImage2D() types.

It applies for standard OpenGL aswell, with the exception of WEBGL_.

@:value({ type : "unsigned_byte", format : "rgba" })staticcreateTextureCubemapStorage(size:Int, format:String = "rgba", type:String = "unsigned_byte"):CubeTexture

staticcheckFrameBuffer():Bool

staticgetTextureFormat(fmt:String):{internalFormat:Null<Int>, format:Null<Int>}

staticuploadFromGLSLProgram3D(program:Program3D, vertexSource:String, fragmentSource:String):Void

Uploads vertex and fragment sources for the GLSL program. This is a cut-down copy of Program3D.uploadSources() to remove that annoying prefix and reduce memory usage/processing

@:value({ offset : 0 })staticupdateVertexBuffer(context:Context3D, buffer:VertexBuffer3D, data:Float32Array, offset:Int = 0):Void

@:value({ bufferOffet : 0 })staticvertexAtrribPtrUByte(context:Context3D, index:Int, buffer:VertexBuffer3D, bufferOffet:Int = 0):Void