Context3D.hx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package flash.display3D;
  2. @:final extern class Context3D extends flash.events.EventDispatcher {
  3. @:require(flash15) var backBufferHeight(default,null) : Int;
  4. @:require(flash15) var backBufferWidth(default,null) : Int;
  5. var driverInfo(default,null) : String;
  6. var enableErrorChecking : Bool;
  7. @:require(flash15) var maxBackBufferHeight : Int;
  8. @:require(flash15) var maxBackBufferWidth : Int;
  9. @:require(flash12) var profile(default,null) : String;
  10. function clear(red : Float = 0, green : Float = 0, blue : Float = 0, alpha : Float = 1, depth : Float = 1, stencil : UInt = 0, mask : UInt = 0xFFFFFFFF) : Void;
  11. function configureBackBuffer(width : Int, height : Int, antiAlias : Int, enableDepthAndStencil : Bool = true, wantsBestResolution : Bool = false, wantsBestResolutionOnBrowserZoom : Bool = false) : Void;
  12. function createCubeTexture(size : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool, streamingLevels : Int = 0) : flash.display3D.textures.CubeTexture;
  13. function createIndexBuffer(numIndices : Int, ?bufferUsage : Context3DBufferUsage) : IndexBuffer3D;
  14. function createProgram() : Program3D;
  15. @:require(flash11_8) function createRectangleTexture(width : Int, height : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool) : flash.display3D.textures.RectangleTexture;
  16. function createTexture(width : Int, height : Int, format : Context3DTextureFormat, optimizeForRenderToTexture : Bool, streamingLevels : Int = 0) : flash.display3D.textures.Texture;
  17. function createVertexBuffer(numVertices : Int, data32PerVertex : Int, ?bufferUsage : Context3DBufferUsage) : VertexBuffer3D;
  18. @:require(flash15) function createVideoTexture() : flash.display3D.textures.VideoTexture;
  19. function dispose(recreate : Bool = true) : Void;
  20. function drawToBitmapData(destination : flash.display.BitmapData) : Void;
  21. function drawTriangles(indexBuffer : IndexBuffer3D, firstIndex : Int = 0, numTriangles : Int = -1) : Void;
  22. function present() : Void;
  23. function setBlendFactors(sourceFactor : Context3DBlendFactor, destinationFactor : Context3DBlendFactor) : Void;
  24. function setColorMask(red : Bool, green : Bool, blue : Bool, alpha : Bool) : Void;
  25. function setCulling(triangleFaceToCull : Context3DTriangleFace) : Void;
  26. function setDepthTest(depthMask : Bool, passCompareMode : Context3DCompareMode) : Void;
  27. @:require(flash16) function setFillMode( fillMode : Context3DFillMode ) : Void;
  28. function setProgram(program : Program3D) : Void;
  29. @:require(flash11_2) function setProgramConstantsFromByteArray(programType : Context3DProgramType, firstRegister : Int, numRegisters : Int, data : flash.utils.ByteArray, byteArrayOffset : UInt) : Void;
  30. function setProgramConstantsFromMatrix(programType : Context3DProgramType, firstRegister : Int, matrix : flash.geom.Matrix3D, transposedMatrix : Bool = false) : Void;
  31. function setProgramConstantsFromVector(programType : Context3DProgramType, firstRegister : Int, data : flash.Vector<Float>, numRegisters : Int = -1) : Void;
  32. function setRenderToBackBuffer() : Void;
  33. function setRenderToTexture(texture : flash.display3D.textures.TextureBase, enableDepthAndStencil : Bool = false, antiAlias : Int = 0, surfaceSelector : Int = 0, colorOutputIndex : Int = 0) : Void;
  34. @:require(flash11_6) function setSamplerStateAt(sampler : Int, wrap : Context3DWrapMode, filter : Context3DTextureFilter, mipfilter : Context3DMipFilter) : Void;
  35. function setScissorRectangle(rectangle : flash.geom.Rectangle) : Void;
  36. function setStencilActions(?triangleFace : Context3DTriangleFace, ?compareMode : Context3DCompareMode, ?actionOnBothPass : Context3DStencilAction, ?actionOnDepthFail : Context3DStencilAction, ?actionOnDepthPassStencilFail : Context3DStencilAction) : Void;
  37. function setStencilReferenceValue(referenceValue : UInt, readMask : UInt = 255, writeMask : UInt = 255) : Void;
  38. function setTextureAt(sampler : Int, texture : flash.display3D.textures.TextureBase) : Void;
  39. function setVertexBufferAt(index : Int, buffer : VertexBuffer3D, bufferOffset : Int = 0, ?format : Context3DVertexBufferFormat) : Void;
  40. @:require(flash15) static var supportsVideoTexture(default,null) : Bool;
  41. }