Stage3DProxy provides a proxy class to manage a single Stage3D instance as well as handling the creation and attachment of the Context3D (and in turn the back buffer) is uses. Stage3DProxy should never be created directly, but requested through Stage3DManager.

See also:

  • away3d.core.managers.Stage3DProxy todo: consider moving all creation methods (createVertexBuffer etc) in here, so that disposal can occur here along with the context, instead of scattered throughout the framework

Static variables

Static methods

staticdisposeIndexBuffer(ib:IndexBuffer3D):Void

staticdisposeVertexBuffer(vb:VertexBuffer3D):Void

staticuploadIndexBufferFromVector(ib:IndexBuffer3D, data:Vector<UInt>, startOffset:Int, count:Int):Void

staticuploadVertexBufferFromVector(vb:VertexBuffer3D, data:Vector<Float>, startVertex:Int, numVertices:Int):Void

Constructor

@:value({ profile : "baseline", forceSoftware : false })new(stage3DIndex:Int, stage3D:Stage3D, stage3DManager:Stage3DManager, forceSoftware:Bool = false, profile:String = "baseline")

Creates a Stage3DProxy object. This method should not be called directly. Creation of Stage3DProxy objects should be handled by Stage3DManager.

Parameters:

stage3DIndex

The index of the Stage3D to be proxied.

stage3D

The Stage3D to be proxied.

stage3DManager
forceSoftware

Whether to force software mode even if hardware acceleration is available.

Variables

color:Int

read onlycontext3D:Context3D

read onlydriverInfo:String

height:Int

read onlyprofile:String

read onlyrenderTarget:TextureBase

scissorRect:Rectangle

read onlystage3D:Stage3D

read onlystage3DIndex:Int

read onlyusesSoftwareRendering:Bool

read onlyviewPort:Rectangle

visible:Bool

width:Int

x:Float

y:Float

Methods

@:value({ useWeakReference : false, priority : 0, useCapture : false })addEventListener(type:String, listener:Dynamic ‑> Void, useCapture:Bool = false, priority:Int = 0, useWeakReference:Bool = false):Void

Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event. Special case for enterframe and exitframe events - will switch Stage3DProxy into automatic render mode. You can register event listeners on all nodes in the display list for a specific type of event, phase, and priority.

Parameters:

type

The type of event.

listener

The listener function that processes the event.

useCapture

Determines whether the listener works in the capture phase or the target and bubbling phases. If useCapture is set to true, the listener processes the event only during the capture phase and not in the target or bubbling phase. If useCapture is false, the listener processes the event only during the target or bubbling phase. To listen for the event in all three phases, call addEventListener twice, once with useCapture set to true, then again with useCapture set to false.

priority

The priority level of the event listener. The priority is designated by a signed 32-bit integer. The higher the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1. If two or more listeners share the same priority, they are processed in the order in which they were added. The default priority is 0.

useWeakReference

Determines whether the reference to the listener is strong or weak. A strong reference (the default) prevents your listener from being garbage-collected. A weak reference does not.

clear():Void

configureBackBuffer(backBufferWidth:Int, backBufferHeight:Int, antiAlias:Int, enableDepthAndStencil:Bool):Void

Configures the back buffer associated with the Stage3D object.

Parameters:

backBufferWidth

The width of the backbuffer.

backBufferHeight

The height of the backbuffer.

antiAlias

The amount of anti-aliasing to use.

enableDepthAndStencil

Indicates whether the back buffer contains a depth and stencil buffer.

createIndexBuffer(numIndices:Int):IndexBuffer3D

createVertexBuffer(numVertices:Int, data32PerVertex:Int):VertexBuffer3D

dispose():Void

Disposes the Stage3DProxy object, freeing the Context3D attached to the Stage3D.

@:value({ numTriangles : -1, firstIndex : 0 })drawTriangles(indexBuffer:IndexBuffer3D, firstIndex:Int = 0, numTriangles:Int = -1):Void

present():Void

@:value({ useCapture : false })removeEventListener(type:String, listener:Dynamic ‑> Void, useCapture:Bool = false):Void

Removes a listener from the EventDispatcher object. Special case for enterframe and exitframe events - will switch Stage3DProxy out of automatic render mode. If there is no matching listener registered with the EventDispatcher object, a call to this method has no effect.

Parameters:

type

The type of event.

listener

The listener object to remove.

useCapture

Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true, and another call with useCapture() set to false.

@:value({ surfaceSelector : 0, enableDepthAndStencil : false })setRenderTarget(target:TextureBase, enableDepthAndStencil:Bool = false, surfaceSelector:Int = 0):Void