Context3D.hx 4.7 KB

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