diff --git a/.gitignore b/.gitignore index b7a34b6..5529cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,9 @@ dist/ *~ *.tix *.project +.cabal-sandbox +cabal.sandbox.config +node_modules/ +bower_components/ +.psci +output/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a4cde5b --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +## Graphics.WebGL.Raw + +See the [module documentation][1] for all exported functions, constants, and +types. + + [1]: docs/README.md + +This library is the thinnest possible PureScript wrapper for JavaScript WebGL +methods, providing just enough to wrap possible `null`/`undefined` values in +their respective empty contexts. Returned values are wrapped in the `Eff` +monad, using the `Canvas` effect provided by [`purescript-canvas`][2] for +compatibility with general `HTMLCanvasElement` functions. + + [2]: https://github.com/purescript-contrib/purescript-canvas + +This library is generated by parsing the [Khronos IDL][2] for the WebGL +specification with the included Haskell parser and pretty-printer. This +library should not be altered manually but instead by modifying the +parser/printer. + + [3]: https://www.khronos.org/registry/webgl/specs/1.0.3/ + +This library is not intended for production use, but instead to be wrapped by +additional libraries providing type-safety and error checking and handling. +Users should note that a returned `Nothing` value is indicative of a WebGL +failure and handle accordingly. + +## Khronos IDL Parser and PureScript Printer + +To build the parser/printer, ensure you have a recent version of Haskell and +`cabal-install` installed, and then: + +```sh +> cabal sandbox init +> cabal install --only-dependencies +> cabal build +``` + +To run the generator on the included IDL and output the contents into the +correct PureScript modules: + +```sh +> cabal run docs/WebGL-1.0.3.idl +``` + +If modifying the parser, be sure to regenerate the module documentation by +running the default Grunt task. Ensure you have a recent version of Node and +`npm` installed, and then: + +```sh +> npm install +> bower install +> grunt +``` + +## Credits + +This package is built upon the amazing amounts of hard work done by [Jurgen +Nicklisch-Franken][3], from whom the original parser/printer was forked. + + [3]: https://github.com/jutaro diff --git a/WebGL.idl b/WebGL.idl deleted file mode 100644 index ed12364..0000000 --- a/WebGL.idl +++ /dev/null @@ -1,739 +0,0 @@ -/* - * webgl.idl - * - * WebGL IDL definitions scraped from the Khronos specification. - * - * Original Khronos Working Draft: - * - * https://www.khronos.org/registry/webgl/specs/latest/ - */ - -// This module depends on the typedarrays module defined at: -// https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl - -module webgl { - -typedef events::Event Event; -typedef html::HTMLCanvasElement HTMLCanvasElement; -typedef html::HTMLImageElement HTMLImageElement; -typedef html::HTMLVideoElement HTMLVideoElement; -typedef html::ImageData ImageData; -typedef typedarrays::ArrayBuffer ArrayBuffer; -typedef typedarrays::ArrayBufferView ArrayBufferView; -typedef typedarrays::FloatArray FloatArray; -typedef typedarrays::Int32Array Int32Array; - -typedef unsigned long GLenum; -typedef boolean GLboolean; -typedef unsigned long GLbitfield; -typedef byte GLbyte; /* 'byte' should be a signed 8 bit type. */ -typedef short GLshort; -typedef long GLint; -typedef long GLsizei; -typedef long long GLintptr; -typedef long long GLsizeiptr; -typedef unsigned byte GLubyte; /* 'unsigned byte' should be an unsigned 8 bit type. */ -typedef unsigned short GLushort; -typedef unsigned long GLuint; -typedef float GLfloat; -typedef float GLclampf; - -interface WebGLContextAttributes { - attribute boolean alpha; - attribute boolean depth; - attribute boolean stencil; - attribute boolean antialias; - attribute boolean premultipliedAlpha; -}; - -interface WebGLObject { -}; - -interface WebGLBuffer : WebGLObject { -}; - -interface WebGLFramebuffer : WebGLObject { -}; - -interface WebGLProgram : WebGLObject { -}; - -interface WebGLRenderbuffer : WebGLObject { -}; - -interface WebGLShader : WebGLObject { -}; - -interface WebGLTexture : WebGLObject { -}; - -interface WebGLUniformLocation { -}; - -interface WebGLActiveInfo { - readonly attribute GLint size; - readonly attribute GLenum type; - readonly attribute DOMString name; -}; - -interface WebGLRenderingContext { - - /* ClearBufferMask */ - const GLenum DEPTH_BUFFER_BIT = 0x00000100; - const GLenum STENCIL_BUFFER_BIT = 0x00000400; - const GLenum COLOR_BUFFER_BIT = 0x00004000; - - /* BeginMode */ - const GLenum POINTS = 0x0000; - const GLenum LINES = 0x0001; - const GLenum LINE_LOOP = 0x0002; - const GLenum LINE_STRIP = 0x0003; - const GLenum TRIANGLES = 0x0004; - const GLenum TRIANGLE_STRIP = 0x0005; - const GLenum TRIANGLE_FAN = 0x0006; - - /* AlphaFunction (not supported in ES20) */ - /* NEVER */ - /* LESS */ - /* EQUAL */ - /* LEQUAL */ - /* GREATER */ - /* NOTEQUAL */ - /* GEQUAL */ - /* ALWAYS */ - - /* BlendingFactorDest */ - const GLenum ZERO = 0; - const GLenum ONE = 1; - const GLenum SRC_COLOR = 0x0300; - const GLenum ONE_MINUS_SRC_COLOR = 0x0301; - const GLenum SRC_ALPHA = 0x0302; - const GLenum ONE_MINUS_SRC_ALPHA = 0x0303; - const GLenum DST_ALPHA = 0x0304; - const GLenum ONE_MINUS_DST_ALPHA = 0x0305; - - /* BlendingFactorSrc */ - /* ZERO */ - /* ONE */ - const GLenum DST_COLOR = 0x0306; - const GLenum ONE_MINUS_DST_COLOR = 0x0307; - const GLenum SRC_ALPHA_SATURATE = 0x0308; - /* SRC_ALPHA */ - /* ONE_MINUS_SRC_ALPHA */ - /* DST_ALPHA */ - /* ONE_MINUS_DST_ALPHA */ - - /* BlendEquationSeparate */ - const GLenum FUNC_ADD = 0x8006; - const GLenum BLEND_EQUATION = 0x8009; - const GLenum BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */ - const GLenum BLEND_EQUATION_ALPHA = 0x883D; - - /* BlendSubtract */ - const GLenum FUNC_SUBTRACT = 0x800A; - const GLenum FUNC_REVERSE_SUBTRACT = 0x800B; - - /* Separate Blend Functions */ - const GLenum BLEND_DST_RGB = 0x80C8; - const GLenum BLEND_SRC_RGB = 0x80C9; - const GLenum BLEND_DST_ALPHA = 0x80CA; - const GLenum BLEND_SRC_ALPHA = 0x80CB; - const GLenum CONSTANT_COLOR = 0x8001; - const GLenum ONE_MINUS_CONSTANT_COLOR = 0x8002; - const GLenum CONSTANT_ALPHA = 0x8003; - const GLenum ONE_MINUS_CONSTANT_ALPHA = 0x8004; - const GLenum BLEND_COLOR = 0x8005; - - /* Buffer Objects */ - const GLenum ARRAY_BUFFER = 0x8892; - const GLenum ELEMENT_ARRAY_BUFFER = 0x8893; - const GLenum ARRAY_BUFFER_BINDING = 0x8894; - const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; - - const GLenum STREAM_DRAW = 0x88E0; - const GLenum STATIC_DRAW = 0x88E4; - const GLenum DYNAMIC_DRAW = 0x88E8; - - const GLenum BUFFER_SIZE = 0x8764; - const GLenum BUFFER_USAGE = 0x8765; - - const GLenum CURRENT_VERTEX_ATTRIB = 0x8626; - - /* CullFaceMode */ - const GLenum FRONT = 0x0404; - const GLenum BACK = 0x0405; - const GLenum FRONT_AND_BACK = 0x0408; - - /* DepthFunction */ - /* NEVER */ - /* LESS */ - /* EQUAL */ - /* LEQUAL */ - /* GREATER */ - /* NOTEQUAL */ - /* GEQUAL */ - /* ALWAYS */ - - /* EnableCap */ - const GLenum TEXTURE_2D = 0x0DE1; - const GLenum CULL_FACE = 0x0B44; - const GLenum BLEND = 0x0BE2; - const GLenum DITHER = 0x0BD0; - const GLenum STENCIL_TEST = 0x0B90; - const GLenum DEPTH_TEST = 0x0B71; - const GLenum SCISSOR_TEST = 0x0C11; - const GLenum POLYGON_OFFSET_FILL = 0x8037; - const GLenum SAMPLE_ALPHA_TO_COVERAGE = 0x809E; - const GLenum SAMPLE_COVERAGE = 0x80A0; - - /* ErrorCode */ - const GLenum NO_ERROR = 0; - const GLenum INVALID_ENUM = 0x0500; - const GLenum INVALID_VALUE = 0x0501; - const GLenum INVALID_OPERATION = 0x0502; - const GLenum OUT_OF_MEMORY = 0x0505; - - /* FrontFaceDirection */ - const GLenum CW = 0x0900; - const GLenum CCW = 0x0901; - - /* GetPName */ - const GLenum LINE_WIDTH = 0x0B21; - const GLenum ALIASED_POINT_SIZE_RANGE = 0x846D; - const GLenum ALIASED_LINE_WIDTH_RANGE = 0x846E; - const GLenum CULL_FACE_MODE = 0x0B45; - const GLenum FRONT_FACE = 0x0B46; - const GLenum DEPTH_RANGE = 0x0B70; - const GLenum DEPTH_WRITEMASK = 0x0B72; - const GLenum DEPTH_CLEAR_VALUE = 0x0B73; - const GLenum DEPTH_FUNC = 0x0B74; - const GLenum STENCIL_CLEAR_VALUE = 0x0B91; - const GLenum STENCIL_FUNC = 0x0B92; - const GLenum STENCIL_FAIL = 0x0B94; - const GLenum STENCIL_PASS_DEPTH_FAIL = 0x0B95; - const GLenum STENCIL_PASS_DEPTH_PASS = 0x0B96; - const GLenum STENCIL_REF = 0x0B97; - const GLenum STENCIL_VALUE_MASK = 0x0B93; - const GLenum STENCIL_WRITEMASK = 0x0B98; - const GLenum STENCIL_BACK_FUNC = 0x8800; - const GLenum STENCIL_BACK_FAIL = 0x8801; - const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - const GLenum STENCIL_BACK_REF = 0x8CA3; - const GLenum STENCIL_BACK_VALUE_MASK = 0x8CA4; - const GLenum STENCIL_BACK_WRITEMASK = 0x8CA5; - const GLenum VIEWPORT = 0x0BA2; - const GLenum SCISSOR_BOX = 0x0C10; - /* SCISSOR_TEST */ - const GLenum COLOR_CLEAR_VALUE = 0x0C22; - const GLenum COLOR_WRITEMASK = 0x0C23; - const GLenum UNPACK_ALIGNMENT = 0x0CF5; - const GLenum PACK_ALIGNMENT = 0x0D05; - const GLenum MAX_TEXTURE_SIZE = 0x0D33; - const GLenum MAX_VIEWPORT_DIMS = 0x0D3A; - const GLenum SUBPIXEL_BITS = 0x0D50; - const GLenum RED_BITS = 0x0D52; - const GLenum GREEN_BITS = 0x0D53; - const GLenum BLUE_BITS = 0x0D54; - const GLenum ALPHA_BITS = 0x0D55; - const GLenum DEPTH_BITS = 0x0D56; - const GLenum STENCIL_BITS = 0x0D57; - const GLenum POLYGON_OFFSET_UNITS = 0x2A00; - /* POLYGON_OFFSET_FILL */ - const GLenum POLYGON_OFFSET_FACTOR = 0x8038; - const GLenum TEXTURE_BINDING_2D = 0x8069; - const GLenum SAMPLE_BUFFERS = 0x80A8; - const GLenum SAMPLES = 0x80A9; - const GLenum SAMPLE_COVERAGE_VALUE = 0x80AA; - const GLenum SAMPLE_COVERAGE_INVERT = 0x80AB; - - /* GetTextureParameter */ - /* TEXTURE_MAG_FILTER */ - /* TEXTURE_MIN_FILTER */ - /* TEXTURE_WRAP_S */ - /* TEXTURE_WRAP_T */ - - const GLenum NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; - const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3; - - /* HintMode */ - const GLenum DONT_CARE = 0x1100; - const GLenum FASTEST = 0x1101; - const GLenum NICEST = 0x1102; - - /* HintTarget */ - const GLenum GENERATE_MIPMAP_HINT = 0x8192; - - /* DataType */ - const GLenum BYTE = 0x1400; - const GLenum UNSIGNED_BYTE = 0x1401; - const GLenum SHORT = 0x1402; - const GLenum UNSIGNED_SHORT = 0x1403; - const GLenum INT = 0x1404; - const GLenum UNSIGNED_INT = 0x1405; - const GLenum FLOAT = 0x1406; - - /* PixelFormat */ - const GLenum DEPTH_COMPONENT = 0x1902; - const GLenum ALPHA = 0x1906; - const GLenum RGB = 0x1907; - const GLenum RGBA = 0x1908; - const GLenum LUMINANCE = 0x1909; - const GLenum LUMINANCE_ALPHA = 0x190A; - - /* PixelType */ - /* UNSIGNED_BYTE */ - const GLenum UNSIGNED_SHORT_4_4_4_4 = 0x8033; - const GLenum UNSIGNED_SHORT_5_5_5_1 = 0x8034; - const GLenum UNSIGNED_SHORT_5_6_5 = 0x8363; - - /* Shaders */ - const GLenum FRAGMENT_SHADER = 0x8B30; - const GLenum VERTEX_SHADER = 0x8B31; - const GLenum MAX_VERTEX_ATTRIBS = 0x8869; - const GLenum MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - const GLenum MAX_VARYING_VECTORS = 0x8DFC; - const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - const GLenum MAX_TEXTURE_IMAGE_UNITS = 0x8872; - const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - const GLenum SHADER_TYPE = 0x8B4F; - const GLenum DELETE_STATUS = 0x8B80; - const GLenum LINK_STATUS = 0x8B82; - const GLenum VALIDATE_STATUS = 0x8B83; - const GLenum ATTACHED_SHADERS = 0x8B85; - const GLenum ACTIVE_UNIFORMS = 0x8B86; - const GLenum ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; - const GLenum ACTIVE_ATTRIBUTES = 0x8B89; - const GLenum ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; - const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C; - const GLenum CURRENT_PROGRAM = 0x8B8D; - - /* StencilFunction */ - const GLenum NEVER = 0x0200; - const GLenum LESS = 0x0201; - const GLenum EQUAL = 0x0202; - const GLenum LEQUAL = 0x0203; - const GLenum GREATER = 0x0204; - const GLenum NOTEQUAL = 0x0205; - const GLenum GEQUAL = 0x0206; - const GLenum ALWAYS = 0x0207; - - /* StencilOp */ - /* ZERO */ - const GLenum KEEP = 0x1E00; - const GLenum REPLACE = 0x1E01; - const GLenum INCR = 0x1E02; - const GLenum DECR = 0x1E03; - const GLenum INVERT = 0x150A; - const GLenum INCR_WRAP = 0x8507; - const GLenum DECR_WRAP = 0x8508; - - /* StringName */ - const GLenum VENDOR = 0x1F00; - const GLenum RENDERER = 0x1F01; - const GLenum VERSION = 0x1F02; - - /* TextureMagFilter */ - const GLenum NEAREST = 0x2600; - const GLenum LINEAR = 0x2601; - - /* TextureMinFilter */ - /* NEAREST */ - /* LINEAR */ - const GLenum NEAREST_MIPMAP_NEAREST = 0x2700; - const GLenum LINEAR_MIPMAP_NEAREST = 0x2701; - const GLenum NEAREST_MIPMAP_LINEAR = 0x2702; - const GLenum LINEAR_MIPMAP_LINEAR = 0x2703; - - /* TextureParameterName */ - const GLenum TEXTURE_MAG_FILTER = 0x2800; - const GLenum TEXTURE_MIN_FILTER = 0x2801; - const GLenum TEXTURE_WRAP_S = 0x2802; - const GLenum TEXTURE_WRAP_T = 0x2803; - - /* TextureTarget */ - /* TEXTURE_2D */ - const GLenum TEXTURE = 0x1702; - - const GLenum TEXTURE_CUBE_MAP = 0x8513; - const GLenum TEXTURE_BINDING_CUBE_MAP = 0x8514; - const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; - const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; - const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; - const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; - const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; - const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; - const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; - - /* TextureUnit */ - const GLenum TEXTURE0 = 0x84C0; - const GLenum TEXTURE1 = 0x84C1; - const GLenum TEXTURE2 = 0x84C2; - const GLenum TEXTURE3 = 0x84C3; - const GLenum TEXTURE4 = 0x84C4; - const GLenum TEXTURE5 = 0x84C5; - const GLenum TEXTURE6 = 0x84C6; - const GLenum TEXTURE7 = 0x84C7; - const GLenum TEXTURE8 = 0x84C8; - const GLenum TEXTURE9 = 0x84C9; - const GLenum TEXTURE10 = 0x84CA; - const GLenum TEXTURE11 = 0x84CB; - const GLenum TEXTURE12 = 0x84CC; - const GLenum TEXTURE13 = 0x84CD; - const GLenum TEXTURE14 = 0x84CE; - const GLenum TEXTURE15 = 0x84CF; - const GLenum TEXTURE16 = 0x84D0; - const GLenum TEXTURE17 = 0x84D1; - const GLenum TEXTURE18 = 0x84D2; - const GLenum TEXTURE19 = 0x84D3; - const GLenum TEXTURE20 = 0x84D4; - const GLenum TEXTURE21 = 0x84D5; - const GLenum TEXTURE22 = 0x84D6; - const GLenum TEXTURE23 = 0x84D7; - const GLenum TEXTURE24 = 0x84D8; - const GLenum TEXTURE25 = 0x84D9; - const GLenum TEXTURE26 = 0x84DA; - const GLenum TEXTURE27 = 0x84DB; - const GLenum TEXTURE28 = 0x84DC; - const GLenum TEXTURE29 = 0x84DD; - const GLenum TEXTURE30 = 0x84DE; - const GLenum TEXTURE31 = 0x84DF; - const GLenum ACTIVE_TEXTURE = 0x84E0; - - /* TextureWrapMode */ - const GLenum REPEAT = 0x2901; - const GLenum CLAMP_TO_EDGE = 0x812F; - const GLenum MIRRORED_REPEAT = 0x8370; - - /* Uniform Types */ - const GLenum FLOAT_VEC2 = 0x8B50; - const GLenum FLOAT_VEC3 = 0x8B51; - const GLenum FLOAT_VEC4 = 0x8B52; - const GLenum INT_VEC2 = 0x8B53; - const GLenum INT_VEC3 = 0x8B54; - const GLenum INT_VEC4 = 0x8B55; - const GLenum BOOL = 0x8B56; - const GLenum BOOL_VEC2 = 0x8B57; - const GLenum BOOL_VEC3 = 0x8B58; - const GLenum BOOL_VEC4 = 0x8B59; - const GLenum FLOAT_MAT2 = 0x8B5A; - const GLenum FLOAT_MAT3 = 0x8B5B; - const GLenum FLOAT_MAT4 = 0x8B5C; - const GLenum SAMPLER_2D = 0x8B5E; - const GLenum SAMPLER_CUBE = 0x8B60; - - /* Vertex Arrays */ - const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - - /* Shader Source */ - const GLenum COMPILE_STATUS = 0x8B81; - const GLenum INFO_LOG_LENGTH = 0x8B84; - const GLenum SHADER_SOURCE_LENGTH = 0x8B88; - - /* Shader Precision-Specified Types */ - const GLenum LOW_FLOAT = 0x8DF0; - const GLenum MEDIUM_FLOAT = 0x8DF1; - const GLenum HIGH_FLOAT = 0x8DF2; - const GLenum LOW_INT = 0x8DF3; - const GLenum MEDIUM_INT = 0x8DF4; - const GLenum HIGH_INT = 0x8DF5; - - /* Framebuffer Object. */ - const GLenum FRAMEBUFFER = 0x8D40; - const GLenum RENDERBUFFER = 0x8D41; - - const GLenum RGBA4 = 0x8056; - const GLenum RGB5_A1 = 0x8057; - const GLenum RGB565 = 0x8D62; - const GLenum DEPTH_COMPONENT16 = 0x81A5; - const GLenum STENCIL_INDEX = 0x1901; - const GLenum STENCIL_INDEX8 = 0x8D48; - const GLenum DEPTH_STENCIL = 0x84F9; - - const GLenum RENDERBUFFER_WIDTH = 0x8D42; - const GLenum RENDERBUFFER_HEIGHT = 0x8D43; - const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; - const GLenum RENDERBUFFER_RED_SIZE = 0x8D50; - const GLenum RENDERBUFFER_GREEN_SIZE = 0x8D51; - const GLenum RENDERBUFFER_BLUE_SIZE = 0x8D52; - const GLenum RENDERBUFFER_ALPHA_SIZE = 0x8D53; - const GLenum RENDERBUFFER_DEPTH_SIZE = 0x8D54; - const GLenum RENDERBUFFER_STENCIL_SIZE = 0x8D55; - - const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; - const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; - const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; - const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; - - const GLenum COLOR_ATTACHMENT0 = 0x8CE0; - const GLenum DEPTH_ATTACHMENT = 0x8D00; - const GLenum STENCIL_ATTACHMENT = 0x8D20; - const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A; - - const GLenum NONE = 0; - - const GLenum FRAMEBUFFER_COMPLETE = 0x8CD5; - const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; - const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; - const GLenum FRAMEBUFFER_UNSUPPORTED = 0x8CDD; - - const GLenum FRAMEBUFFER_BINDING = 0x8CA6; - const GLenum RENDERBUFFER_BINDING = 0x8CA7; - const GLenum MAX_RENDERBUFFER_SIZE = 0x84E8; - - const GLenum INVALID_FRAMEBUFFER_OPERATION = 0x0506; - - /* WebGL-specific enums */ - const GLenum UNPACK_FLIP_Y_WEBGL = 0x9240; - const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241; - const GLenum CONTEXT_LOST_WEBGL = 0x9242; - const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243; - const GLenum BROWSER_DEFAULT_WEBGL = 0x9244; - - readonly attribute HTMLCanvasElement canvas; - - WebGLContextAttributes getContextAttributes(); - - boolean isContextLost(); - - DOMString[ ] getSupportedExtensions(); - object getExtension(DOMString name); - - void activeTexture(GLenum texture); - void attachShader(WebGLProgram program, WebGLShader shader); - void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name); - void bindBuffer(GLenum target, WebGLBuffer buffer); - void bindFramebuffer(GLenum target, WebGLFramebuffer framebuffer); - void bindRenderbuffer(GLenum target, WebGLRenderbuffer renderbuffer); - void bindTexture(GLenum target, WebGLTexture texture); - void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - void blendEquation(GLenum mode); - void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); - void blendFunc(GLenum sfactor, GLenum dfactor); - void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, - GLenum srcAlpha, GLenum dstAlpha); - -/* void bufferData(GLenum target, GLsizeiptr size, GLenum usage); - void bufferData(GLenum target, ArrayBufferView data, GLenum usage);*/ - void bufferData(GLenum target, ArrayBuffer data, GLenum usage); - void bufferSubData(GLenum target, GLintptr offset, ArrayBufferView data); - void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer data); - - GLenum checkFramebufferStatus(GLenum target); - void clear(GLbitfield mask); - void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - void clearDepth(GLclampf depth); - void clearStencil(GLint s); - void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); - void compileShader(WebGLShader shader); - - void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border); - void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - - WebGLBuffer createBuffer(); - WebGLFramebuffer createFramebuffer(); - WebGLProgram createProgram(); - WebGLRenderbuffer createRenderbuffer(); - WebGLShader createShader(GLenum type); - WebGLTexture createTexture(); - - void cullFace(GLenum mode); - - void deleteBuffer(WebGLBuffer buffer); - void deleteFramebuffer(WebGLFramebuffer framebuffer); - void deleteProgram(WebGLProgram program); - void deleteRenderbuffer(WebGLRenderbuffer renderbuffer); - void deleteShader(WebGLShader shader); - void deleteTexture(WebGLTexture texture); - - void depthFunc(GLenum func); - void depthMask(GLboolean flag); - void depthRange(GLclampf zNear, GLclampf zFar); - void detachShader(WebGLProgram program, WebGLShader shader); - void disable(GLenum cap); - void disableVertexAttribArray(GLuint index); - void drawArrays(GLenum mode, GLint first, GLsizei count); - void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset); - - void enable(GLenum cap); - void enableVertexAttribArray(GLuint index); - void finish(); - void flush(); - void framebufferRenderbuffer(GLenum target, GLenum attachment, - GLenum renderbuffertarget, - WebGLRenderbuffer renderbuffer); - void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, - WebGLTexture texture, GLint level); - void frontFace(GLenum mode); - - void generateMipmap(GLenum target); - - WebGLActiveInfo getActiveAttrib(WebGLProgram program, GLuint index); - WebGLActiveInfo getActiveUniform(WebGLProgram program, GLuint index); - WebGLShader[ ] getAttachedShaders(WebGLProgram program); - - GLint getAttribLocation(WebGLProgram program, DOMString name); - - any getParameter(GLenum pname); - any getBufferParameter(GLenum target, GLenum pname); - - GLenum getError(); - - any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, - GLenum pname); - any getProgramParameter(WebGLProgram program, GLenum pname); - DOMString getProgramInfoLog(WebGLProgram program); - any getRenderbufferParameter(GLenum target, GLenum pname); - any getShaderParameter(WebGLShader shader, GLenum pname); - DOMString getShaderInfoLog(WebGLShader shader); - - DOMString getShaderSource(WebGLShader shader); - - any getTexParameter(GLenum target, GLenum pname); - - any getUniform(WebGLProgram program, WebGLUniformLocation location); - - WebGLUniformLocation getUniformLocation(WebGLProgram program, DOMString name); - - any getVertexAttrib(GLuint index, GLenum pname); - - GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname); - - void hint(GLenum target, GLenum mode); - GLboolean isBuffer(WebGLBuffer buffer); - GLboolean isEnabled(GLenum cap); - GLboolean isFramebuffer(WebGLFramebuffer framebuffer); - GLboolean isProgram(WebGLProgram program); - GLboolean isRenderbuffer(WebGLRenderbuffer renderbuffer); - GLboolean isShader(WebGLShader shader); - GLboolean isTexture(WebGLTexture texture); - void lineWidth(GLfloat width); - void linkProgram(WebGLProgram program); - void pixelStorei(GLenum pname, GLint param); - void polygonOffset(GLfloat factor, GLfloat units); - - void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, ArrayBufferView pixels); - - void renderbufferStorage(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height); - void sampleCoverage(GLclampf value, GLboolean invert); - void scissor(GLint x, GLint y, GLsizei width, GLsizei height); - - void shaderSource(WebGLShader shader, DOMString source); - - void stencilFunc(GLenum func, GLint ref, GLuint mask); - void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); - void stencilMask(GLuint mask); - void stencilMaskSeparate(GLenum face, GLuint mask); - void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); - void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); - - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLsizei width, GLsizei height, GLint border, GLenum format, - GLenum type, ArrayBufferView pixels); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, ImageData pixels); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, HTMLImageElement image) raises (DOMException); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, HTMLCanvasElement canvas) raises (DOMException); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, HTMLVideoElement video) raises (DOMException); - - void texParameterf(GLenum target, GLenum pname, GLfloat param); - void texParameteri(GLenum target, GLenum pname, GLint param); - - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, ArrayBufferView pixels); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, ImageData pixels); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, HTMLImageElement image) raises (DOMException); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, HTMLCanvasElement canvas) raises (DOMException); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, HTMLVideoElement video) raises (DOMException); - - void uniform1f(WebGLUniformLocation location, GLfloat x); - void uniform1fv(WebGLUniformLocation location, FloatArray v); - void uniform1fv(WebGLUniformLocation location, sequence v); - void uniform1i(WebGLUniformLocation location, GLint x); - void uniform1iv(WebGLUniformLocation location, Int32Array v); - void uniform1iv(WebGLUniformLocation location, sequence v); - void uniform2f(WebGLUniformLocation location, GLfloat x, GLfloat y); - void uniform2fv(WebGLUniformLocation location, FloatArray v); - void uniform2fv(WebGLUniformLocation location, sequence v); - void uniform2i(WebGLUniformLocation location, GLint x, GLint y); - void uniform2iv(WebGLUniformLocation location, Int32Array v); - void uniform2iv(WebGLUniformLocation location, sequence v); - void uniform3f(WebGLUniformLocation location, GLfloat x, GLfloat y, GLfloat z); - void uniform3fv(WebGLUniformLocation location, FloatArray v); - void uniform3fv(WebGLUniformLocation location, sequence v); - void uniform3i(WebGLUniformLocation location, GLint x, GLint y, GLint z); - void uniform3iv(WebGLUniformLocation location, Int32Array v); - void uniform3iv(WebGLUniformLocation location, sequence v); - void uniform4f(WebGLUniformLocation location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void uniform4fv(WebGLUniformLocation location, FloatArray v); - void uniform4fv(WebGLUniformLocation location, sequence v); - void uniform4i(WebGLUniformLocation location, GLint x, GLint y, GLint z, GLint w); - void uniform4iv(WebGLUniformLocation location, Int32Array v); - void uniform4iv(WebGLUniformLocation location, sequence v); - - void uniformMatrix2fv(WebGLUniformLocation location, GLboolean transpose, - FloatArray value); - void uniformMatrix2fv(WebGLUniformLocation location, GLboolean transpose, - sequence value); - void uniformMatrix3fv(WebGLUniformLocation location, GLboolean transpose, - FloatArray value); - void uniformMatrix3fv(WebGLUniformLocation location, GLboolean transpose, - sequence value); - void uniformMatrix4fv(WebGLUniformLocation location, GLboolean transpose, - FloatArray value); - void uniformMatrix4fv(WebGLUniformLocation location, GLboolean transpose, - sequence value); - - void useProgram(WebGLProgram program); - void validateProgram(WebGLProgram program); - - void vertexAttrib1f(GLuint indx, GLfloat x); - void vertexAttrib1fv(GLuint indx, FloatArray values); - void vertexAttrib1fv(GLuint indx, sequence values); - void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); - void vertexAttrib2fv(GLuint indx, FloatArray values); - void vertexAttrib2fv(GLuint indx, sequence values); - void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); - void vertexAttrib3fv(GLuint indx, FloatArray values); - void vertexAttrib3fv(GLuint indx, sequence values); - void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void vertexAttrib4fv(GLuint indx, FloatArray values); - void vertexAttrib4fv(GLuint indx, sequence values); - void vertexAttribPointer(GLuint indx, GLint size, GLenum type, - GLboolean normalized, GLsizei stride, GLintptr offset); - - void viewport(GLint x, GLint y, GLsizei width, GLsizei height); -}; - -[Constructor(DOMString type, optional WebGLContextEventInit eventInit)] -interface WebGLContextEvent : Event { - readonly attribute DOMString statusMessage; -}; - -// EventInit is defined in the DOM4 specification. -dictionary WebGLContextEventInit : EventInit { - DOMString statusMessage; -}; - -}; diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..54a4fb5 --- /dev/null +++ b/bower.json @@ -0,0 +1,23 @@ +{ + "name": "purescript-webgl-raw", + "description": "a generated low-level PureScript wrapper of WebGL methods", + "version": "0.3.0", + "license": "GPL-2", + + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "dist", + "generator" + ], + + "dependencies": { + "purescript-canvas": "0.3.*", + "purescript-eff": "0.1.*", + "purescript-functions": "0.1.*", + "purescript-arraybuffer-types": "0.2.*", + "purescript-maybe": "0.3.*", + "purescript-typedarray": "0.4.*" + } +} diff --git a/docs/Graphics/WebGL/Raw.md b/docs/Graphics/WebGL/Raw.md new file mode 100644 index 0000000..f174c1e --- /dev/null +++ b/docs/Graphics/WebGL/Raw.md @@ -0,0 +1,927 @@ +## Module Graphics.WebGL.Raw + +#### `activeTexture` + +``` purescript +activeTexture :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `attachShader` + +``` purescript +attachShader :: forall eff. WebGLContext -> WebGLProgram -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bindAttribLocation` + +``` purescript +bindAttribLocation :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> DOMString -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bindBuffer` + +``` purescript +bindBuffer :: forall eff. WebGLContext -> GLenum -> WebGLBuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bindFramebuffer` + +``` purescript +bindFramebuffer :: forall eff. WebGLContext -> GLenum -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bindRenderbuffer` + +``` purescript +bindRenderbuffer :: forall eff. WebGLContext -> GLenum -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bindTexture` + +``` purescript +bindTexture :: forall eff. WebGLContext -> GLenum -> WebGLTexture -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `blendColor` + +``` purescript +blendColor :: forall eff. WebGLContext -> GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `blendEquation` + +``` purescript +blendEquation :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `blendEquationSeparate` + +``` purescript +blendEquationSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `blendFunc` + +``` purescript +blendFunc :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `blendFuncSeparate` + +``` purescript +blendFuncSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bufferData` + +``` purescript +bufferData :: forall eff. WebGLContext -> GLenum -> BufferDataSource -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bufferData_` + +``` purescript +bufferData_ :: forall eff. WebGLContext -> GLenum -> GLsizeiptr -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `bufferSubData` + +``` purescript +bufferSubData :: forall eff. WebGLContext -> GLenum -> GLintptr -> BufferDataSource -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `checkFramebufferStatus` + +``` purescript +checkFramebufferStatus :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) GLenum +``` + +#### `clear` + +``` purescript +clear :: forall eff. WebGLContext -> GLbitfield -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `clearColor` + +``` purescript +clearColor :: forall eff. WebGLContext -> GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `clearDepth` + +``` purescript +clearDepth :: forall eff. WebGLContext -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `clearStencil` + +``` purescript +clearStencil :: forall eff. WebGLContext -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `colorMask` + +``` purescript +colorMask :: forall eff. WebGLContext -> GLboolean -> GLboolean -> GLboolean -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `compileShader` + +``` purescript +compileShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `compressedTexImage2D` + +``` purescript +compressedTexImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLsizei -> GLsizei -> GLint -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `compressedTexSubImage2D` + +``` purescript +compressedTexSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `copyTexImage2D` + +``` purescript +copyTexImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLint -> GLint -> GLsizei -> GLsizei -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `copyTexSubImage2D` + +``` purescript +copyTexSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `createBuffer` + +``` purescript +createBuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLBuffer) +``` + +#### `createFramebuffer` + +``` purescript +createFramebuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLFramebuffer) +``` + +#### `createProgram` + +``` purescript +createProgram :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLProgram) +``` + +#### `createRenderbuffer` + +``` purescript +createRenderbuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLRenderbuffer) +``` + +#### `createShader` + +``` purescript +createShader :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe WebGLShader) +``` + +#### `createTexture` + +``` purescript +createTexture :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLTexture) +``` + +#### `cullFace` + +``` purescript +cullFace :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `deleteBuffer` + +``` purescript +deleteBuffer :: forall eff. WebGLContext -> WebGLBuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `deleteFramebuffer` + +``` purescript +deleteFramebuffer :: forall eff. WebGLContext -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `deleteProgram` + +``` purescript +deleteProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `deleteRenderbuffer` + +``` purescript +deleteRenderbuffer :: forall eff. WebGLContext -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `deleteShader` + +``` purescript +deleteShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `deleteTexture` + +``` purescript +deleteTexture :: forall eff. WebGLContext -> WebGLTexture -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `depthFunc` + +``` purescript +depthFunc :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `depthMask` + +``` purescript +depthMask :: forall eff. WebGLContext -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `depthRange` + +``` purescript +depthRange :: forall eff. WebGLContext -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `detachShader` + +``` purescript +detachShader :: forall eff. WebGLContext -> WebGLProgram -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `disable` + +``` purescript +disable :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `disableVertexAttribArray` + +``` purescript +disableVertexAttribArray :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `drawArrays` + +``` purescript +drawArrays :: forall eff. WebGLContext -> GLenum -> GLint -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `drawElements` + +``` purescript +drawElements :: forall eff. WebGLContext -> GLenum -> GLsizei -> GLenum -> GLintptr -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `enable` + +``` purescript +enable :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `enableVertexAttribArray` + +``` purescript +enableVertexAttribArray :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `finish` + +``` purescript +finish :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `flush` + +``` purescript +flush :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `framebufferRenderbuffer` + +``` purescript +framebufferRenderbuffer :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `framebufferTexture2D` + +``` purescript +framebufferTexture2D :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> WebGLTexture -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `frontFace` + +``` purescript +frontFace :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `generateMipmap` + +``` purescript +generateMipmap :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `getActiveAttrib` + +``` purescript +getActiveAttrib :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> Eff (canvas :: Canvas | eff) (Maybe WebGLActiveInfo) +``` + +#### `getActiveUniform` + +``` purescript +getActiveUniform :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> Eff (canvas :: Canvas | eff) (Maybe WebGLActiveInfo) +``` + +#### `getAttachedShaders` + +``` purescript +getAttachedShaders :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) (Array WebGLShader) +``` + +#### `getAttribLocation` + +``` purescript +getAttribLocation :: forall eff. WebGLContext -> WebGLProgram -> DOMString -> Eff (canvas :: Canvas | eff) GLint +``` + +#### `getBufferParameter` + +``` purescript +getBufferParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getContextAttributes` + +``` purescript +getContextAttributes :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLContextAttributes) +``` + +#### `getError` + +``` purescript +getError :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) GLenum +``` + +#### `getExtension` + +``` purescript +getExtension :: forall eff a. WebGLContext -> DOMString -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getFramebufferAttachmentParameter` + +``` purescript +getFramebufferAttachmentParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getParameter` + +``` purescript +getParameter :: forall eff a. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getProgramInfoLog` + +``` purescript +getProgramInfoLog :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +``` + +#### `getProgramParameter` + +``` purescript +getProgramParameter :: forall eff a. WebGLContext -> WebGLProgram -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getRenderbufferParameter` + +``` purescript +getRenderbufferParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getShaderInfoLog` + +``` purescript +getShaderInfoLog :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +``` + +#### `getShaderParameter` + +``` purescript +getShaderParameter :: forall eff a. WebGLContext -> WebGLShader -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getShaderPrecisionFormat` + +``` purescript +getShaderPrecisionFormat :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe WebGLShaderPrecisionFormat) +``` + +#### `getShaderSource` + +``` purescript +getShaderSource :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +``` + +#### `getSupportedExtensions` + +``` purescript +getSupportedExtensions :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Array DOMString) +``` + +#### `getTexParameter` + +``` purescript +getTexParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getUniform` + +``` purescript +getUniform :: forall eff a. WebGLContext -> WebGLProgram -> WebGLUniformLocation -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getUniformLocation` + +``` purescript +getUniformLocation :: forall eff. WebGLContext -> WebGLProgram -> DOMString -> Eff (canvas :: Canvas | eff) (Maybe WebGLUniformLocation) +``` + +#### `getVertexAttrib` + +``` purescript +getVertexAttrib :: forall eff a. WebGLContext -> GLuint -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + +#### `getVertexAttribOffset` + +``` purescript +getVertexAttribOffset :: forall eff. WebGLContext -> GLuint -> GLenum -> Eff (canvas :: Canvas | eff) GLsizeiptr +``` + +#### `hint` + +``` purescript +hint :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `isBuffer` + +``` purescript +isBuffer :: forall eff. WebGLContext -> WebGLBuffer -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `isContextLost` + +``` purescript +isContextLost :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Boolean +``` + +#### `isEnabled` + +``` purescript +isEnabled :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `isFramebuffer` + +``` purescript +isFramebuffer :: forall eff. WebGLContext -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `isProgram` + +``` purescript +isProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `isRenderbuffer` + +``` purescript +isRenderbuffer :: forall eff. WebGLContext -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `isShader` + +``` purescript +isShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `isTexture` + +``` purescript +isTexture :: forall eff. WebGLContext -> WebGLTexture -> Eff (canvas :: Canvas | eff) GLboolean +``` + +#### `lineWidth` + +``` purescript +lineWidth :: forall eff. WebGLContext -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `linkProgram` + +``` purescript +linkProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `pixelStorei` + +``` purescript +pixelStorei :: forall eff. WebGLContext -> GLenum -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `polygonOffset` + +``` purescript +polygonOffset :: forall eff. WebGLContext -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `readPixels` + +``` purescript +readPixels :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `renderbufferStorage` + +``` purescript +renderbufferStorage :: forall eff. WebGLContext -> GLenum -> GLenum -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `sampleCoverage` + +``` purescript +sampleCoverage :: forall eff. WebGLContext -> GLclampf -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `scissor` + +``` purescript +scissor :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `shaderSource` + +``` purescript +shaderSource :: forall eff. WebGLContext -> WebGLShader -> DOMString -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `stencilFunc` + +``` purescript +stencilFunc :: forall eff. WebGLContext -> GLenum -> GLint -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `stencilFuncSeparate` + +``` purescript +stencilFuncSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLint -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `stencilMask` + +``` purescript +stencilMask :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `stencilMaskSeparate` + +``` purescript +stencilMaskSeparate :: forall eff. WebGLContext -> GLenum -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `stencilOp` + +``` purescript +stencilOp :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `stencilOpSeparate` + +``` purescript +stencilOpSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `texImage2D` + +``` purescript +texImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLenum -> GLenum -> TexImageSource -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `texImage2D_` + +``` purescript +texImage2D_ :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLsizei -> GLsizei -> GLint -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `texParameterf` + +``` purescript +texParameterf :: forall eff. WebGLContext -> GLenum -> GLenum -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `texParameteri` + +``` purescript +texParameteri :: forall eff. WebGLContext -> GLenum -> GLenum -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `texSubImage2D` + +``` purescript +texSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLenum -> GLenum -> TexImageSource -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `texSubImage2D_` + +``` purescript +texSubImage2D_ :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform1f` + +``` purescript +uniform1f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform1fv` + +``` purescript +uniform1fv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform1fv_` + +``` purescript +uniform1fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform1i` + +``` purescript +uniform1i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform1iv` + +``` purescript +uniform1iv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array Int -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform1iv_` + +``` purescript +uniform1iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform2f` + +``` purescript +uniform2f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform2fv` + +``` purescript +uniform2fv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform2fv_` + +``` purescript +uniform2fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform2i` + +``` purescript +uniform2i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform2iv` + +``` purescript +uniform2iv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array Int -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform2iv_` + +``` purescript +uniform2iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform3f` + +``` purescript +uniform3f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform3fv` + +``` purescript +uniform3fv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform3fv_` + +``` purescript +uniform3fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform3i` + +``` purescript +uniform3i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform3iv` + +``` purescript +uniform3iv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array Int -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform3iv_` + +``` purescript +uniform3iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform4f` + +``` purescript +uniform4f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform4fv` + +``` purescript +uniform4fv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform4fv_` + +``` purescript +uniform4fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform4i` + +``` purescript +uniform4i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform4iv` + +``` purescript +uniform4iv :: forall eff. WebGLContext -> WebGLUniformLocation -> Array Int -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniform4iv_` + +``` purescript +uniform4iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniformMatrix2fv` + +``` purescript +uniformMatrix2fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniformMatrix2fv_` + +``` purescript +uniformMatrix2fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniformMatrix3fv` + +``` purescript +uniformMatrix3fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniformMatrix3fv_` + +``` purescript +uniformMatrix3fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniformMatrix4fv` + +``` purescript +uniformMatrix4fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `uniformMatrix4fv_` + +``` purescript +uniformMatrix4fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `useProgram` + +``` purescript +useProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `validateProgram` + +``` purescript +validateProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib1f` + +``` purescript +vertexAttrib1f :: forall eff. WebGLContext -> GLuint -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib1fv` + +``` purescript +vertexAttrib1fv :: forall eff. WebGLContext -> GLuint -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib1fv_` + +``` purescript +vertexAttrib1fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib2f` + +``` purescript +vertexAttrib2f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib2fv` + +``` purescript +vertexAttrib2fv :: forall eff. WebGLContext -> GLuint -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib2fv_` + +``` purescript +vertexAttrib2fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib3f` + +``` purescript +vertexAttrib3f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib3fv` + +``` purescript +vertexAttrib3fv :: forall eff. WebGLContext -> GLuint -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib3fv_` + +``` purescript +vertexAttrib3fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib4f` + +``` purescript +vertexAttrib4f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib4fv` + +``` purescript +vertexAttrib4fv :: forall eff. WebGLContext -> GLuint -> Array GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttrib4fv_` + +``` purescript +vertexAttrib4fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `vertexAttribPointer` + +``` purescript +vertexAttribPointer :: forall eff. WebGLContext -> GLuint -> GLint -> GLenum -> GLboolean -> GLsizei -> GLintptr -> Eff (canvas :: Canvas | eff) Unit +``` + +#### `viewport` + +``` purescript +viewport :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + + diff --git a/docs/Graphics/WebGL/Raw/Enums.md b/docs/Graphics/WebGL/Raw/Enums.md new file mode 100644 index 0000000..96fc9ed --- /dev/null +++ b/docs/Graphics/WebGL/Raw/Enums.md @@ -0,0 +1,1785 @@ +## Module Graphics.WebGL.Raw.Enums + +#### `activeAttributes` + +``` purescript +activeAttributes :: GLenum +``` + +#### `activeTexture` + +``` purescript +activeTexture :: GLenum +``` + +#### `activeUniforms` + +``` purescript +activeUniforms :: GLenum +``` + +#### `aliasedLineWidthRange` + +``` purescript +aliasedLineWidthRange :: GLenum +``` + +#### `aliasedPointSizeRange` + +``` purescript +aliasedPointSizeRange :: GLenum +``` + +#### `alpha` + +``` purescript +alpha :: GLenum +``` + +#### `alphaBits` + +``` purescript +alphaBits :: GLenum +``` + +#### `always` + +``` purescript +always :: GLenum +``` + +#### `arrayBuffer` + +``` purescript +arrayBuffer :: GLenum +``` + +#### `arrayBufferBinding` + +``` purescript +arrayBufferBinding :: GLenum +``` + +#### `attachedShaders` + +``` purescript +attachedShaders :: GLenum +``` + +#### `back` + +``` purescript +back :: GLenum +``` + +#### `blend` + +``` purescript +blend :: GLenum +``` + +#### `blendColor` + +``` purescript +blendColor :: GLenum +``` + +#### `blendDstAlpha` + +``` purescript +blendDstAlpha :: GLenum +``` + +#### `blendDstRgb` + +``` purescript +blendDstRgb :: GLenum +``` + +#### `blendEquation` + +``` purescript +blendEquation :: GLenum +``` + +#### `blendEquationAlpha` + +``` purescript +blendEquationAlpha :: GLenum +``` + +#### `blendEquationRgb` + +``` purescript +blendEquationRgb :: GLenum +``` + +#### `blendSrcAlpha` + +``` purescript +blendSrcAlpha :: GLenum +``` + +#### `blendSrcRgb` + +``` purescript +blendSrcRgb :: GLenum +``` + +#### `blueBits` + +``` purescript +blueBits :: GLenum +``` + +#### `bool` + +``` purescript +bool :: GLenum +``` + +#### `boolVec2` + +``` purescript +boolVec2 :: GLenum +``` + +#### `boolVec3` + +``` purescript +boolVec3 :: GLenum +``` + +#### `boolVec4` + +``` purescript +boolVec4 :: GLenum +``` + +#### `browserDefaultWebgl` + +``` purescript +browserDefaultWebgl :: GLenum +``` + +#### `bufferSize` + +``` purescript +bufferSize :: GLenum +``` + +#### `bufferUsage` + +``` purescript +bufferUsage :: GLenum +``` + +#### `byte` + +``` purescript +byte :: GLenum +``` + +#### `ccw` + +``` purescript +ccw :: GLenum +``` + +#### `clampToEdge` + +``` purescript +clampToEdge :: GLenum +``` + +#### `colorAttachment0` + +``` purescript +colorAttachment0 :: GLenum +``` + +#### `colorBufferBit` + +``` purescript +colorBufferBit :: GLenum +``` + +#### `colorClearValue` + +``` purescript +colorClearValue :: GLenum +``` + +#### `colorWritemask` + +``` purescript +colorWritemask :: GLenum +``` + +#### `compileStatus` + +``` purescript +compileStatus :: GLenum +``` + +#### `compressedTextureFormats` + +``` purescript +compressedTextureFormats :: GLenum +``` + +#### `constantAlpha` + +``` purescript +constantAlpha :: GLenum +``` + +#### `constantColor` + +``` purescript +constantColor :: GLenum +``` + +#### `contextLostWebgl` + +``` purescript +contextLostWebgl :: GLenum +``` + +#### `cullFace` + +``` purescript +cullFace :: GLenum +``` + +#### `cullFaceMode` + +``` purescript +cullFaceMode :: GLenum +``` + +#### `currentProgram` + +``` purescript +currentProgram :: GLenum +``` + +#### `currentVertexAttrib` + +``` purescript +currentVertexAttrib :: GLenum +``` + +#### `cw` + +``` purescript +cw :: GLenum +``` + +#### `decr` + +``` purescript +decr :: GLenum +``` + +#### `decrWrap` + +``` purescript +decrWrap :: GLenum +``` + +#### `deleteStatus` + +``` purescript +deleteStatus :: GLenum +``` + +#### `depthAttachment` + +``` purescript +depthAttachment :: GLenum +``` + +#### `depthBits` + +``` purescript +depthBits :: GLenum +``` + +#### `depthBufferBit` + +``` purescript +depthBufferBit :: GLenum +``` + +#### `depthClearValue` + +``` purescript +depthClearValue :: GLenum +``` + +#### `depthComponent` + +``` purescript +depthComponent :: GLenum +``` + +#### `depthComponent16` + +``` purescript +depthComponent16 :: GLenum +``` + +#### `depthFunc` + +``` purescript +depthFunc :: GLenum +``` + +#### `depthRange` + +``` purescript +depthRange :: GLenum +``` + +#### `depthStencil` + +``` purescript +depthStencil :: GLenum +``` + +#### `depthStencilAttachment` + +``` purescript +depthStencilAttachment :: GLenum +``` + +#### `depthTest` + +``` purescript +depthTest :: GLenum +``` + +#### `depthWritemask` + +``` purescript +depthWritemask :: GLenum +``` + +#### `dither` + +``` purescript +dither :: GLenum +``` + +#### `dontCare` + +``` purescript +dontCare :: GLenum +``` + +#### `dstAlpha` + +``` purescript +dstAlpha :: GLenum +``` + +#### `dstColor` + +``` purescript +dstColor :: GLenum +``` + +#### `dynamicDraw` + +``` purescript +dynamicDraw :: GLenum +``` + +#### `elementArrayBuffer` + +``` purescript +elementArrayBuffer :: GLenum +``` + +#### `elementArrayBufferBinding` + +``` purescript +elementArrayBufferBinding :: GLenum +``` + +#### `equal` + +``` purescript +equal :: GLenum +``` + +#### `fastest` + +``` purescript +fastest :: GLenum +``` + +#### `float` + +``` purescript +float :: GLenum +``` + +#### `floatMat2` + +``` purescript +floatMat2 :: GLenum +``` + +#### `floatMat3` + +``` purescript +floatMat3 :: GLenum +``` + +#### `floatMat4` + +``` purescript +floatMat4 :: GLenum +``` + +#### `floatVec2` + +``` purescript +floatVec2 :: GLenum +``` + +#### `floatVec3` + +``` purescript +floatVec3 :: GLenum +``` + +#### `floatVec4` + +``` purescript +floatVec4 :: GLenum +``` + +#### `fragmentShader` + +``` purescript +fragmentShader :: GLenum +``` + +#### `framebuffer` + +``` purescript +framebuffer :: GLenum +``` + +#### `framebufferAttachmentObjectName` + +``` purescript +framebufferAttachmentObjectName :: GLenum +``` + +#### `framebufferAttachmentObjectType` + +``` purescript +framebufferAttachmentObjectType :: GLenum +``` + +#### `framebufferAttachmentTextureCubeMapFace` + +``` purescript +framebufferAttachmentTextureCubeMapFace :: GLenum +``` + +#### `framebufferAttachmentTextureLevel` + +``` purescript +framebufferAttachmentTextureLevel :: GLenum +``` + +#### `framebufferBinding` + +``` purescript +framebufferBinding :: GLenum +``` + +#### `framebufferComplete` + +``` purescript +framebufferComplete :: GLenum +``` + +#### `framebufferIncompleteAttachment` + +``` purescript +framebufferIncompleteAttachment :: GLenum +``` + +#### `framebufferIncompleteDimensions` + +``` purescript +framebufferIncompleteDimensions :: GLenum +``` + +#### `framebufferIncompleteMissingAttachment` + +``` purescript +framebufferIncompleteMissingAttachment :: GLenum +``` + +#### `framebufferUnsupported` + +``` purescript +framebufferUnsupported :: GLenum +``` + +#### `front` + +``` purescript +front :: GLenum +``` + +#### `frontAndBack` + +``` purescript +frontAndBack :: GLenum +``` + +#### `frontFace` + +``` purescript +frontFace :: GLenum +``` + +#### `funcAdd` + +``` purescript +funcAdd :: GLenum +``` + +#### `funcReverseSubtract` + +``` purescript +funcReverseSubtract :: GLenum +``` + +#### `funcSubtract` + +``` purescript +funcSubtract :: GLenum +``` + +#### `generateMipmapHint` + +``` purescript +generateMipmapHint :: GLenum +``` + +#### `gequal` + +``` purescript +gequal :: GLenum +``` + +#### `greater` + +``` purescript +greater :: GLenum +``` + +#### `greenBits` + +``` purescript +greenBits :: GLenum +``` + +#### `highFloat` + +``` purescript +highFloat :: GLenum +``` + +#### `highInt` + +``` purescript +highInt :: GLenum +``` + +#### `implementationColorReadFormat` + +``` purescript +implementationColorReadFormat :: GLenum +``` + +#### `implementationColorReadType` + +``` purescript +implementationColorReadType :: GLenum +``` + +#### `incr` + +``` purescript +incr :: GLenum +``` + +#### `incrWrap` + +``` purescript +incrWrap :: GLenum +``` + +#### `int` + +``` purescript +int :: GLenum +``` + +#### `intVec2` + +``` purescript +intVec2 :: GLenum +``` + +#### `intVec3` + +``` purescript +intVec3 :: GLenum +``` + +#### `intVec4` + +``` purescript +intVec4 :: GLenum +``` + +#### `invalidEnum` + +``` purescript +invalidEnum :: GLenum +``` + +#### `invalidFramebufferOperation` + +``` purescript +invalidFramebufferOperation :: GLenum +``` + +#### `invalidOperation` + +``` purescript +invalidOperation :: GLenum +``` + +#### `invalidValue` + +``` purescript +invalidValue :: GLenum +``` + +#### `invert` + +``` purescript +invert :: GLenum +``` + +#### `keep` + +``` purescript +keep :: GLenum +``` + +#### `lequal` + +``` purescript +lequal :: GLenum +``` + +#### `less` + +``` purescript +less :: GLenum +``` + +#### `linear` + +``` purescript +linear :: GLenum +``` + +#### `linearMipmapLinear` + +``` purescript +linearMipmapLinear :: GLenum +``` + +#### `linearMipmapNearest` + +``` purescript +linearMipmapNearest :: GLenum +``` + +#### `lines` + +``` purescript +lines :: GLenum +``` + +#### `lineLoop` + +``` purescript +lineLoop :: GLenum +``` + +#### `lineStrip` + +``` purescript +lineStrip :: GLenum +``` + +#### `lineWidth` + +``` purescript +lineWidth :: GLenum +``` + +#### `linkStatus` + +``` purescript +linkStatus :: GLenum +``` + +#### `lowFloat` + +``` purescript +lowFloat :: GLenum +``` + +#### `lowInt` + +``` purescript +lowInt :: GLenum +``` + +#### `luminance` + +``` purescript +luminance :: GLenum +``` + +#### `luminanceAlpha` + +``` purescript +luminanceAlpha :: GLenum +``` + +#### `maxCombinedTextureImageUnits` + +``` purescript +maxCombinedTextureImageUnits :: GLenum +``` + +#### `maxCubeMapTextureSize` + +``` purescript +maxCubeMapTextureSize :: GLenum +``` + +#### `maxFragmentUniformVectors` + +``` purescript +maxFragmentUniformVectors :: GLenum +``` + +#### `maxRenderbufferSize` + +``` purescript +maxRenderbufferSize :: GLenum +``` + +#### `maxTextureImageUnits` + +``` purescript +maxTextureImageUnits :: GLenum +``` + +#### `maxTextureSize` + +``` purescript +maxTextureSize :: GLenum +``` + +#### `maxVaryingVectors` + +``` purescript +maxVaryingVectors :: GLenum +``` + +#### `maxVertexAttribs` + +``` purescript +maxVertexAttribs :: GLenum +``` + +#### `maxVertexTextureImageUnits` + +``` purescript +maxVertexTextureImageUnits :: GLenum +``` + +#### `maxVertexUniformVectors` + +``` purescript +maxVertexUniformVectors :: GLenum +``` + +#### `maxViewportDims` + +``` purescript +maxViewportDims :: GLenum +``` + +#### `mediumFloat` + +``` purescript +mediumFloat :: GLenum +``` + +#### `mediumInt` + +``` purescript +mediumInt :: GLenum +``` + +#### `mirroredRepeat` + +``` purescript +mirroredRepeat :: GLenum +``` + +#### `nearest` + +``` purescript +nearest :: GLenum +``` + +#### `nearestMipmapLinear` + +``` purescript +nearestMipmapLinear :: GLenum +``` + +#### `nearestMipmapNearest` + +``` purescript +nearestMipmapNearest :: GLenum +``` + +#### `never` + +``` purescript +never :: GLenum +``` + +#### `nicest` + +``` purescript +nicest :: GLenum +``` + +#### `none` + +``` purescript +none :: GLenum +``` + +#### `notequal` + +``` purescript +notequal :: GLenum +``` + +#### `noError` + +``` purescript +noError :: GLenum +``` + +#### `one` + +``` purescript +one :: GLenum +``` + +#### `oneMinusConstantAlpha` + +``` purescript +oneMinusConstantAlpha :: GLenum +``` + +#### `oneMinusConstantColor` + +``` purescript +oneMinusConstantColor :: GLenum +``` + +#### `oneMinusDstAlpha` + +``` purescript +oneMinusDstAlpha :: GLenum +``` + +#### `oneMinusDstColor` + +``` purescript +oneMinusDstColor :: GLenum +``` + +#### `oneMinusSrcAlpha` + +``` purescript +oneMinusSrcAlpha :: GLenum +``` + +#### `oneMinusSrcColor` + +``` purescript +oneMinusSrcColor :: GLenum +``` + +#### `outOfMemory` + +``` purescript +outOfMemory :: GLenum +``` + +#### `packAlignment` + +``` purescript +packAlignment :: GLenum +``` + +#### `points` + +``` purescript +points :: GLenum +``` + +#### `polygonOffsetFactor` + +``` purescript +polygonOffsetFactor :: GLenum +``` + +#### `polygonOffsetFill` + +``` purescript +polygonOffsetFill :: GLenum +``` + +#### `polygonOffsetUnits` + +``` purescript +polygonOffsetUnits :: GLenum +``` + +#### `redBits` + +``` purescript +redBits :: GLenum +``` + +#### `renderbuffer` + +``` purescript +renderbuffer :: GLenum +``` + +#### `renderbufferAlphaSize` + +``` purescript +renderbufferAlphaSize :: GLenum +``` + +#### `renderbufferBinding` + +``` purescript +renderbufferBinding :: GLenum +``` + +#### `renderbufferBlueSize` + +``` purescript +renderbufferBlueSize :: GLenum +``` + +#### `renderbufferDepthSize` + +``` purescript +renderbufferDepthSize :: GLenum +``` + +#### `renderbufferGreenSize` + +``` purescript +renderbufferGreenSize :: GLenum +``` + +#### `renderbufferHeight` + +``` purescript +renderbufferHeight :: GLenum +``` + +#### `renderbufferInternalFormat` + +``` purescript +renderbufferInternalFormat :: GLenum +``` + +#### `renderbufferRedSize` + +``` purescript +renderbufferRedSize :: GLenum +``` + +#### `renderbufferStencilSize` + +``` purescript +renderbufferStencilSize :: GLenum +``` + +#### `renderbufferWidth` + +``` purescript +renderbufferWidth :: GLenum +``` + +#### `renderer` + +``` purescript +renderer :: GLenum +``` + +#### `repeat` + +``` purescript +repeat :: GLenum +``` + +#### `replace` + +``` purescript +replace :: GLenum +``` + +#### `rgb` + +``` purescript +rgb :: GLenum +``` + +#### `rgb565` + +``` purescript +rgb565 :: GLenum +``` + +#### `rgb5A1` + +``` purescript +rgb5A1 :: GLenum +``` + +#### `rgba` + +``` purescript +rgba :: GLenum +``` + +#### `rgba4` + +``` purescript +rgba4 :: GLenum +``` + +#### `sampler2d` + +``` purescript +sampler2d :: GLenum +``` + +#### `samplerCube` + +``` purescript +samplerCube :: GLenum +``` + +#### `samples` + +``` purescript +samples :: GLenum +``` + +#### `sampleAlphaToCoverage` + +``` purescript +sampleAlphaToCoverage :: GLenum +``` + +#### `sampleBuffers` + +``` purescript +sampleBuffers :: GLenum +``` + +#### `sampleCoverage` + +``` purescript +sampleCoverage :: GLenum +``` + +#### `sampleCoverageInvert` + +``` purescript +sampleCoverageInvert :: GLenum +``` + +#### `sampleCoverageValue` + +``` purescript +sampleCoverageValue :: GLenum +``` + +#### `scissorBox` + +``` purescript +scissorBox :: GLenum +``` + +#### `scissorTest` + +``` purescript +scissorTest :: GLenum +``` + +#### `shaderType` + +``` purescript +shaderType :: GLenum +``` + +#### `shadingLanguageVersion` + +``` purescript +shadingLanguageVersion :: GLenum +``` + +#### `short` + +``` purescript +short :: GLenum +``` + +#### `srcAlpha` + +``` purescript +srcAlpha :: GLenum +``` + +#### `srcAlphaSaturate` + +``` purescript +srcAlphaSaturate :: GLenum +``` + +#### `srcColor` + +``` purescript +srcColor :: GLenum +``` + +#### `staticDraw` + +``` purescript +staticDraw :: GLenum +``` + +#### `stencilAttachment` + +``` purescript +stencilAttachment :: GLenum +``` + +#### `stencilBackFail` + +``` purescript +stencilBackFail :: GLenum +``` + +#### `stencilBackFunc` + +``` purescript +stencilBackFunc :: GLenum +``` + +#### `stencilBackPassDepthFail` + +``` purescript +stencilBackPassDepthFail :: GLenum +``` + +#### `stencilBackPassDepthPass` + +``` purescript +stencilBackPassDepthPass :: GLenum +``` + +#### `stencilBackRef` + +``` purescript +stencilBackRef :: GLenum +``` + +#### `stencilBackValueMask` + +``` purescript +stencilBackValueMask :: GLenum +``` + +#### `stencilBackWritemask` + +``` purescript +stencilBackWritemask :: GLenum +``` + +#### `stencilBits` + +``` purescript +stencilBits :: GLenum +``` + +#### `stencilBufferBit` + +``` purescript +stencilBufferBit :: GLenum +``` + +#### `stencilClearValue` + +``` purescript +stencilClearValue :: GLenum +``` + +#### `stencilFail` + +``` purescript +stencilFail :: GLenum +``` + +#### `stencilFunc` + +``` purescript +stencilFunc :: GLenum +``` + +#### `stencilIndex` + +``` purescript +stencilIndex :: GLenum +``` + +#### `stencilIndex8` + +``` purescript +stencilIndex8 :: GLenum +``` + +#### `stencilPassDepthFail` + +``` purescript +stencilPassDepthFail :: GLenum +``` + +#### `stencilPassDepthPass` + +``` purescript +stencilPassDepthPass :: GLenum +``` + +#### `stencilRef` + +``` purescript +stencilRef :: GLenum +``` + +#### `stencilTest` + +``` purescript +stencilTest :: GLenum +``` + +#### `stencilValueMask` + +``` purescript +stencilValueMask :: GLenum +``` + +#### `stencilWritemask` + +``` purescript +stencilWritemask :: GLenum +``` + +#### `streamDraw` + +``` purescript +streamDraw :: GLenum +``` + +#### `subpixelBits` + +``` purescript +subpixelBits :: GLenum +``` + +#### `texture` + +``` purescript +texture :: GLenum +``` + +#### `texture0` + +``` purescript +texture0 :: GLenum +``` + +#### `texture1` + +``` purescript +texture1 :: GLenum +``` + +#### `texture10` + +``` purescript +texture10 :: GLenum +``` + +#### `texture11` + +``` purescript +texture11 :: GLenum +``` + +#### `texture12` + +``` purescript +texture12 :: GLenum +``` + +#### `texture13` + +``` purescript +texture13 :: GLenum +``` + +#### `texture14` + +``` purescript +texture14 :: GLenum +``` + +#### `texture15` + +``` purescript +texture15 :: GLenum +``` + +#### `texture16` + +``` purescript +texture16 :: GLenum +``` + +#### `texture17` + +``` purescript +texture17 :: GLenum +``` + +#### `texture18` + +``` purescript +texture18 :: GLenum +``` + +#### `texture19` + +``` purescript +texture19 :: GLenum +``` + +#### `texture2` + +``` purescript +texture2 :: GLenum +``` + +#### `texture20` + +``` purescript +texture20 :: GLenum +``` + +#### `texture21` + +``` purescript +texture21 :: GLenum +``` + +#### `texture22` + +``` purescript +texture22 :: GLenum +``` + +#### `texture23` + +``` purescript +texture23 :: GLenum +``` + +#### `texture24` + +``` purescript +texture24 :: GLenum +``` + +#### `texture25` + +``` purescript +texture25 :: GLenum +``` + +#### `texture26` + +``` purescript +texture26 :: GLenum +``` + +#### `texture27` + +``` purescript +texture27 :: GLenum +``` + +#### `texture28` + +``` purescript +texture28 :: GLenum +``` + +#### `texture29` + +``` purescript +texture29 :: GLenum +``` + +#### `texture3` + +``` purescript +texture3 :: GLenum +``` + +#### `texture30` + +``` purescript +texture30 :: GLenum +``` + +#### `texture31` + +``` purescript +texture31 :: GLenum +``` + +#### `texture4` + +``` purescript +texture4 :: GLenum +``` + +#### `texture5` + +``` purescript +texture5 :: GLenum +``` + +#### `texture6` + +``` purescript +texture6 :: GLenum +``` + +#### `texture7` + +``` purescript +texture7 :: GLenum +``` + +#### `texture8` + +``` purescript +texture8 :: GLenum +``` + +#### `texture9` + +``` purescript +texture9 :: GLenum +``` + +#### `texture2d` + +``` purescript +texture2d :: GLenum +``` + +#### `textureBinding2d` + +``` purescript +textureBinding2d :: GLenum +``` + +#### `textureBindingCubeMap` + +``` purescript +textureBindingCubeMap :: GLenum +``` + +#### `textureCubeMap` + +``` purescript +textureCubeMap :: GLenum +``` + +#### `textureCubeMapNegativeX` + +``` purescript +textureCubeMapNegativeX :: GLenum +``` + +#### `textureCubeMapNegativeY` + +``` purescript +textureCubeMapNegativeY :: GLenum +``` + +#### `textureCubeMapNegativeZ` + +``` purescript +textureCubeMapNegativeZ :: GLenum +``` + +#### `textureCubeMapPositiveX` + +``` purescript +textureCubeMapPositiveX :: GLenum +``` + +#### `textureCubeMapPositiveY` + +``` purescript +textureCubeMapPositiveY :: GLenum +``` + +#### `textureCubeMapPositiveZ` + +``` purescript +textureCubeMapPositiveZ :: GLenum +``` + +#### `textureMagFilter` + +``` purescript +textureMagFilter :: GLenum +``` + +#### `textureMinFilter` + +``` purescript +textureMinFilter :: GLenum +``` + +#### `textureWrapS` + +``` purescript +textureWrapS :: GLenum +``` + +#### `textureWrapT` + +``` purescript +textureWrapT :: GLenum +``` + +#### `triangles` + +``` purescript +triangles :: GLenum +``` + +#### `triangleFan` + +``` purescript +triangleFan :: GLenum +``` + +#### `triangleStrip` + +``` purescript +triangleStrip :: GLenum +``` + +#### `unpackAlignment` + +``` purescript +unpackAlignment :: GLenum +``` + +#### `unpackColorspaceConversionWebgl` + +``` purescript +unpackColorspaceConversionWebgl :: GLenum +``` + +#### `unpackFlipYWebgl` + +``` purescript +unpackFlipYWebgl :: GLenum +``` + +#### `unpackPremultiplyAlphaWebgl` + +``` purescript +unpackPremultiplyAlphaWebgl :: GLenum +``` + +#### `unsignedByte` + +``` purescript +unsignedByte :: GLenum +``` + +#### `unsignedInt` + +``` purescript +unsignedInt :: GLenum +``` + +#### `unsignedShort` + +``` purescript +unsignedShort :: GLenum +``` + +#### `unsignedShort4444` + +``` purescript +unsignedShort4444 :: GLenum +``` + +#### `unsignedShort5551` + +``` purescript +unsignedShort5551 :: GLenum +``` + +#### `unsignedShort565` + +``` purescript +unsignedShort565 :: GLenum +``` + +#### `validateStatus` + +``` purescript +validateStatus :: GLenum +``` + +#### `vendor` + +``` purescript +vendor :: GLenum +``` + +#### `version` + +``` purescript +version :: GLenum +``` + +#### `vertexAttribArrayBufferBinding` + +``` purescript +vertexAttribArrayBufferBinding :: GLenum +``` + +#### `vertexAttribArrayEnabled` + +``` purescript +vertexAttribArrayEnabled :: GLenum +``` + +#### `vertexAttribArrayNormalized` + +``` purescript +vertexAttribArrayNormalized :: GLenum +``` + +#### `vertexAttribArrayPointer` + +``` purescript +vertexAttribArrayPointer :: GLenum +``` + +#### `vertexAttribArraySize` + +``` purescript +vertexAttribArraySize :: GLenum +``` + +#### `vertexAttribArrayStride` + +``` purescript +vertexAttribArrayStride :: GLenum +``` + +#### `vertexAttribArrayType` + +``` purescript +vertexAttribArrayType :: GLenum +``` + +#### `vertexShader` + +``` purescript +vertexShader :: GLenum +``` + +#### `viewport` + +``` purescript +viewport :: GLenum +``` + +#### `zero` + +``` purescript +zero :: GLenum +``` + + diff --git a/docs/Graphics/WebGL/Raw/Types.md b/docs/Graphics/WebGL/Raw/Types.md new file mode 100644 index 0000000..b35a92c --- /dev/null +++ b/docs/Graphics/WebGL/Raw/Types.md @@ -0,0 +1,183 @@ +## Module Graphics.WebGL.Raw.Types + +#### `DOMString` + +``` purescript +type DOMString = String +``` + +#### `BufferDataSource` + +``` purescript +type BufferDataSource = Float32Array +``` + +#### `FloatArray` + +``` purescript +type FloatArray = Float32Array +``` + +#### `GLbitfield` + +``` purescript +type GLbitfield = Int +``` + +#### `GLboolean` + +``` purescript +type GLboolean = Boolean +``` + +#### `GLbyte` + +``` purescript +type GLbyte = Int +``` + +#### `GLclampf` + +``` purescript +type GLclampf = Number +``` + +#### `GLenum` + +``` purescript +type GLenum = Int +``` + +#### `GLfloat` + +``` purescript +type GLfloat = Number +``` + +#### `GLint` + +``` purescript +type GLint = Int +``` + +#### `GLintptr` + +``` purescript +type GLintptr = Int +``` + +#### `GLshort` + +``` purescript +type GLshort = Int +``` + +#### `GLsizei` + +``` purescript +type GLsizei = Int +``` + +#### `GLsizeiptr` + +``` purescript +type GLsizeiptr = Int +``` + +#### `GLubyte` + +``` purescript +type GLubyte = Int +``` + +#### `GLuint` + +``` purescript +type GLuint = Int +``` + +#### `GLushort` + +``` purescript +type GLushort = Int +``` + +#### `ArrayBufferView` + +``` purescript +data ArrayBufferView :: * +``` + +#### `TexImageSource` + +``` purescript +data TexImageSource :: * +``` + +#### `WebGLActiveInfo` + +``` purescript +data WebGLActiveInfo :: * +``` + +#### `WebGLBuffer` + +``` purescript +data WebGLBuffer :: * +``` + +#### `WebGLContext` + +``` purescript +data WebGLContext :: * +``` + +#### `WebGLFramebuffer` + +``` purescript +data WebGLFramebuffer :: * +``` + +#### `WebGLProgram` + +``` purescript +data WebGLProgram :: * +``` + +#### `WebGLRenderbuffer` + +``` purescript +data WebGLRenderbuffer :: * +``` + +#### `WebGLShader` + +``` purescript +data WebGLShader :: * +``` + +#### `WebGLShaderPrecisionFormat` + +``` purescript +data WebGLShaderPrecisionFormat :: * +``` + +#### `WebGLTexture` + +``` purescript +data WebGLTexture :: * +``` + +#### `WebGLUniformLocation` + +``` purescript +data WebGLUniformLocation :: * +``` + +#### `WebGLContextAttributes` + +``` purescript +type WebGLContextAttributes = { alpha :: Boolean, depth :: Boolean, stencil :: Boolean, antialias :: Boolean, premultipliedAlpha :: Boolean, preserveDrawingBuffer :: Boolean, preferLowPowerToHighPerformance :: Boolean, failIfMajorPerformanceCaveat :: Boolean } +``` + + diff --git a/docs/Graphics/WebGL/Raw/Util.md b/docs/Graphics/WebGL/Raw/Util.md new file mode 100644 index 0000000..cb7ab13 --- /dev/null +++ b/docs/Graphics/WebGL/Raw/Util.md @@ -0,0 +1,15 @@ +## Module Graphics.WebGL.Raw.Util + +#### `toMaybe` + +``` purescript +toMaybe :: forall a. a -> Maybe a +``` + +#### `nullAsEmpty` + +``` purescript +nullAsEmpty :: forall a. Array a -> Array a +``` + + diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..b2a759e --- /dev/null +++ b/docs/README.md @@ -0,0 +1,3395 @@ +# Module Documentation + +## Module Graphics.WebGL.Raw + + +#### `activeTexture` + +``` purescript +activeTexture :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `attachShader` + +``` purescript +attachShader :: forall eff. WebGLContext -> WebGLProgram -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bindAttribLocation` + +``` purescript +bindAttribLocation :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> DOMString -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bindBuffer` + +``` purescript +bindBuffer :: forall eff. WebGLContext -> GLenum -> WebGLBuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bindFramebuffer` + +``` purescript +bindFramebuffer :: forall eff. WebGLContext -> GLenum -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bindRenderbuffer` + +``` purescript +bindRenderbuffer :: forall eff. WebGLContext -> GLenum -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bindTexture` + +``` purescript +bindTexture :: forall eff. WebGLContext -> GLenum -> WebGLTexture -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `blendColor` + +``` purescript +blendColor :: forall eff. WebGLContext -> GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `blendEquation` + +``` purescript +blendEquation :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `blendEquationSeparate` + +``` purescript +blendEquationSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `blendFunc` + +``` purescript +blendFunc :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `blendFuncSeparate` + +``` purescript +blendFuncSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bufferData` + +``` purescript +bufferData :: forall eff. WebGLContext -> GLenum -> BufferDataSource -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bufferData_` + +``` purescript +bufferData_ :: forall eff. WebGLContext -> GLenum -> GLsizeiptr -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `bufferSubData` + +``` purescript +bufferSubData :: forall eff. WebGLContext -> GLenum -> GLintptr -> BufferDataSource -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `checkFramebufferStatus` + +``` purescript +checkFramebufferStatus :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) GLenum +``` + + +#### `clear` + +``` purescript +clear :: forall eff. WebGLContext -> GLbitfield -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `clearColor` + +``` purescript +clearColor :: forall eff. WebGLContext -> GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `clearDepth` + +``` purescript +clearDepth :: forall eff. WebGLContext -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `clearStencil` + +``` purescript +clearStencil :: forall eff. WebGLContext -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `colorMask` + +``` purescript +colorMask :: forall eff. WebGLContext -> GLboolean -> GLboolean -> GLboolean -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `compileShader` + +``` purescript +compileShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `compressedTexImage2D` + +``` purescript +compressedTexImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLsizei -> GLsizei -> GLint -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `compressedTexSubImage2D` + +``` purescript +compressedTexSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `copyTexImage2D` + +``` purescript +copyTexImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLint -> GLint -> GLsizei -> GLsizei -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `copyTexSubImage2D` + +``` purescript +copyTexSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `createBuffer` + +``` purescript +createBuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLBuffer) +``` + + +#### `createFramebuffer` + +``` purescript +createFramebuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLFramebuffer) +``` + + +#### `createProgram` + +``` purescript +createProgram :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLProgram) +``` + + +#### `createRenderbuffer` + +``` purescript +createRenderbuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLRenderbuffer) +``` + + +#### `createShader` + +``` purescript +createShader :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe WebGLShader) +``` + + +#### `createTexture` + +``` purescript +createTexture :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLTexture) +``` + + +#### `cullFace` + +``` purescript +cullFace :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `deleteBuffer` + +``` purescript +deleteBuffer :: forall eff. WebGLContext -> WebGLBuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `deleteFramebuffer` + +``` purescript +deleteFramebuffer :: forall eff. WebGLContext -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `deleteProgram` + +``` purescript +deleteProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `deleteRenderbuffer` + +``` purescript +deleteRenderbuffer :: forall eff. WebGLContext -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `deleteShader` + +``` purescript +deleteShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `deleteTexture` + +``` purescript +deleteTexture :: forall eff. WebGLContext -> WebGLTexture -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `depthFunc` + +``` purescript +depthFunc :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `depthMask` + +``` purescript +depthMask :: forall eff. WebGLContext -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `depthRange` + +``` purescript +depthRange :: forall eff. WebGLContext -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `detachShader` + +``` purescript +detachShader :: forall eff. WebGLContext -> WebGLProgram -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `disable` + +``` purescript +disable :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `disableVertexAttribArray` + +``` purescript +disableVertexAttribArray :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `drawArrays` + +``` purescript +drawArrays :: forall eff. WebGLContext -> GLenum -> GLint -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `drawElements` + +``` purescript +drawElements :: forall eff. WebGLContext -> GLenum -> GLsizei -> GLenum -> GLintptr -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `enable` + +``` purescript +enable :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `enableVertexAttribArray` + +``` purescript +enableVertexAttribArray :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `finish` + +``` purescript +finish :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `flush` + +``` purescript +flush :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `framebufferRenderbuffer` + +``` purescript +framebufferRenderbuffer :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `framebufferTexture2D` + +``` purescript +framebufferTexture2D :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> WebGLTexture -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `frontFace` + +``` purescript +frontFace :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `generateMipmap` + +``` purescript +generateMipmap :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `getActiveAttrib` + +``` purescript +getActiveAttrib :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> Eff (canvas :: Canvas | eff) (Maybe WebGLActiveInfo) +``` + + +#### `getActiveUniform` + +``` purescript +getActiveUniform :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> Eff (canvas :: Canvas | eff) (Maybe WebGLActiveInfo) +``` + + +#### `getAttachedShaders` + +``` purescript +getAttachedShaders :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) [WebGLShader] +``` + + +#### `getAttribLocation` + +``` purescript +getAttribLocation :: forall eff. WebGLContext -> WebGLProgram -> DOMString -> Eff (canvas :: Canvas | eff) GLint +``` + + +#### `getBufferParameter` + +``` purescript +getBufferParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getContextAttributes` + +``` purescript +getContextAttributes :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLContextAttributes) +``` + + +#### `getError` + +``` purescript +getError :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) GLenum +``` + + +#### `getExtension` + +``` purescript +getExtension :: forall eff a. WebGLContext -> DOMString -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getFramebufferAttachmentParameter` + +``` purescript +getFramebufferAttachmentParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getParameter` + +``` purescript +getParameter :: forall eff a. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getProgramInfoLog` + +``` purescript +getProgramInfoLog :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +``` + + +#### `getProgramParameter` + +``` purescript +getProgramParameter :: forall eff a. WebGLContext -> WebGLProgram -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getRenderbufferParameter` + +``` purescript +getRenderbufferParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getShaderInfoLog` + +``` purescript +getShaderInfoLog :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +``` + + +#### `getShaderParameter` + +``` purescript +getShaderParameter :: forall eff a. WebGLContext -> WebGLShader -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getShaderPrecisionFormat` + +``` purescript +getShaderPrecisionFormat :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe WebGLShaderPrecisionFormat) +``` + + +#### `getShaderSource` + +``` purescript +getShaderSource :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +``` + + +#### `getSupportedExtensions` + +``` purescript +getSupportedExtensions :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) [DOMString] +``` + + +#### `getTexParameter` + +``` purescript +getTexParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getUniform` + +``` purescript +getUniform :: forall eff a. WebGLContext -> WebGLProgram -> WebGLUniformLocation -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getUniformLocation` + +``` purescript +getUniformLocation :: forall eff. WebGLContext -> WebGLProgram -> DOMString -> Eff (canvas :: Canvas | eff) (Maybe WebGLUniformLocation) +``` + + +#### `getVertexAttrib` + +``` purescript +getVertexAttrib :: forall eff a. WebGLContext -> GLuint -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +``` + + +#### `getVertexAttribOffset` + +``` purescript +getVertexAttribOffset :: forall eff. WebGLContext -> GLuint -> GLenum -> Eff (canvas :: Canvas | eff) GLsizeiptr +``` + + +#### `hint` + +``` purescript +hint :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `isBuffer` + +``` purescript +isBuffer :: forall eff. WebGLContext -> WebGLBuffer -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `isContextLost` + +``` purescript +isContextLost :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Boolean +``` + + +#### `isEnabled` + +``` purescript +isEnabled :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `isFramebuffer` + +``` purescript +isFramebuffer :: forall eff. WebGLContext -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `isProgram` + +``` purescript +isProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `isRenderbuffer` + +``` purescript +isRenderbuffer :: forall eff. WebGLContext -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `isShader` + +``` purescript +isShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `isTexture` + +``` purescript +isTexture :: forall eff. WebGLContext -> WebGLTexture -> Eff (canvas :: Canvas | eff) GLboolean +``` + + +#### `lineWidth` + +``` purescript +lineWidth :: forall eff. WebGLContext -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `linkProgram` + +``` purescript +linkProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `pixelStorei` + +``` purescript +pixelStorei :: forall eff. WebGLContext -> GLenum -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `polygonOffset` + +``` purescript +polygonOffset :: forall eff. WebGLContext -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `readPixels` + +``` purescript +readPixels :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `renderbufferStorage` + +``` purescript +renderbufferStorage :: forall eff. WebGLContext -> GLenum -> GLenum -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `sampleCoverage` + +``` purescript +sampleCoverage :: forall eff. WebGLContext -> GLclampf -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `scissor` + +``` purescript +scissor :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `shaderSource` + +``` purescript +shaderSource :: forall eff. WebGLContext -> WebGLShader -> DOMString -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `stencilFunc` + +``` purescript +stencilFunc :: forall eff. WebGLContext -> GLenum -> GLint -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `stencilFuncSeparate` + +``` purescript +stencilFuncSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLint -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `stencilMask` + +``` purescript +stencilMask :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `stencilMaskSeparate` + +``` purescript +stencilMaskSeparate :: forall eff. WebGLContext -> GLenum -> GLuint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `stencilOp` + +``` purescript +stencilOp :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `stencilOpSeparate` + +``` purescript +stencilOpSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `texImage2D` + +``` purescript +texImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLenum -> GLenum -> TexImageSource -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `texImage2D_` + +``` purescript +texImage2D_ :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLsizei -> GLsizei -> GLint -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `texParameterf` + +``` purescript +texParameterf :: forall eff. WebGLContext -> GLenum -> GLenum -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `texParameteri` + +``` purescript +texParameteri :: forall eff. WebGLContext -> GLenum -> GLenum -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `texSubImage2D` + +``` purescript +texSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLenum -> GLenum -> TexImageSource -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `texSubImage2D_` + +``` purescript +texSubImage2D_ :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform1f` + +``` purescript +uniform1f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform1fv` + +``` purescript +uniform1fv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform1fv_` + +``` purescript +uniform1fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform1i` + +``` purescript +uniform1i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform1iv` + +``` purescript +uniform1iv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform1iv_` + +``` purescript +uniform1iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform2f` + +``` purescript +uniform2f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform2fv` + +``` purescript +uniform2fv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform2fv_` + +``` purescript +uniform2fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform2i` + +``` purescript +uniform2i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform2iv` + +``` purescript +uniform2iv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform2iv_` + +``` purescript +uniform2iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform3f` + +``` purescript +uniform3f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform3fv` + +``` purescript +uniform3fv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform3fv_` + +``` purescript +uniform3fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform3i` + +``` purescript +uniform3i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform3iv` + +``` purescript +uniform3iv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform3iv_` + +``` purescript +uniform3iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform4f` + +``` purescript +uniform4f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform4fv` + +``` purescript +uniform4fv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform4fv_` + +``` purescript +uniform4fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform4i` + +``` purescript +uniform4i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform4iv` + +``` purescript +uniform4iv :: forall eff. WebGLContext -> WebGLUniformLocation -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniform4iv_` + +``` purescript +uniform4iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniformMatrix2fv` + +``` purescript +uniformMatrix2fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniformMatrix2fv_` + +``` purescript +uniformMatrix2fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniformMatrix3fv` + +``` purescript +uniformMatrix3fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniformMatrix3fv_` + +``` purescript +uniformMatrix3fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniformMatrix4fv` + +``` purescript +uniformMatrix4fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `uniformMatrix4fv_` + +``` purescript +uniformMatrix4fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `useProgram` + +``` purescript +useProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `validateProgram` + +``` purescript +validateProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib1f` + +``` purescript +vertexAttrib1f :: forall eff. WebGLContext -> GLuint -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib1fv` + +``` purescript +vertexAttrib1fv :: forall eff. WebGLContext -> GLuint -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib1fv_` + +``` purescript +vertexAttrib1fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib2f` + +``` purescript +vertexAttrib2f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib2fv` + +``` purescript +vertexAttrib2fv :: forall eff. WebGLContext -> GLuint -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib2fv_` + +``` purescript +vertexAttrib2fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib3f` + +``` purescript +vertexAttrib3f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib3fv` + +``` purescript +vertexAttrib3fv :: forall eff. WebGLContext -> GLuint -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib3fv_` + +``` purescript +vertexAttrib3fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib4f` + +``` purescript +vertexAttrib4f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib4fv` + +``` purescript +vertexAttrib4fv :: forall eff. WebGLContext -> GLuint -> [GLfloat] -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttrib4fv_` + +``` purescript +vertexAttrib4fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `vertexAttribPointer` + +``` purescript +vertexAttribPointer :: forall eff. WebGLContext -> GLuint -> GLint -> GLenum -> GLboolean -> GLsizei -> GLintptr -> Eff (canvas :: Canvas | eff) Unit +``` + + +#### `viewport` + +``` purescript +viewport :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +``` + + + +## Module Graphics.WebGL.Raw.Enums + + +#### `activeAttributes` + +``` purescript +activeAttributes :: GLenum +``` + + +#### `activeTexture` + +``` purescript +activeTexture :: GLenum +``` + + +#### `activeUniforms` + +``` purescript +activeUniforms :: GLenum +``` + + +#### `aliasedLineWidthRange` + +``` purescript +aliasedLineWidthRange :: GLenum +``` + + +#### `aliasedPointSizeRange` + +``` purescript +aliasedPointSizeRange :: GLenum +``` + + +#### `alpha` + +``` purescript +alpha :: GLenum +``` + + +#### `alphaBits` + +``` purescript +alphaBits :: GLenum +``` + + +#### `always` + +``` purescript +always :: GLenum +``` + + +#### `arrayBuffer` + +``` purescript +arrayBuffer :: GLenum +``` + + +#### `arrayBufferBinding` + +``` purescript +arrayBufferBinding :: GLenum +``` + + +#### `attachedShaders` + +``` purescript +attachedShaders :: GLenum +``` + + +#### `back` + +``` purescript +back :: GLenum +``` + + +#### `blend` + +``` purescript +blend :: GLenum +``` + + +#### `blendColor` + +``` purescript +blendColor :: GLenum +``` + + +#### `blendDstAlpha` + +``` purescript +blendDstAlpha :: GLenum +``` + + +#### `blendDstRgb` + +``` purescript +blendDstRgb :: GLenum +``` + + +#### `blendEquation` + +``` purescript +blendEquation :: GLenum +``` + + +#### `blendEquationAlpha` + +``` purescript +blendEquationAlpha :: GLenum +``` + + +#### `blendEquationRgb` + +``` purescript +blendEquationRgb :: GLenum +``` + + +#### `blendSrcAlpha` + +``` purescript +blendSrcAlpha :: GLenum +``` + + +#### `blendSrcRgb` + +``` purescript +blendSrcRgb :: GLenum +``` + + +#### `blueBits` + +``` purescript +blueBits :: GLenum +``` + + +#### `bool` + +``` purescript +bool :: GLenum +``` + + +#### `boolVec2` + +``` purescript +boolVec2 :: GLenum +``` + + +#### `boolVec3` + +``` purescript +boolVec3 :: GLenum +``` + + +#### `boolVec4` + +``` purescript +boolVec4 :: GLenum +``` + + +#### `browserDefaultWebgl` + +``` purescript +browserDefaultWebgl :: GLenum +``` + + +#### `bufferSize` + +``` purescript +bufferSize :: GLenum +``` + + +#### `bufferUsage` + +``` purescript +bufferUsage :: GLenum +``` + + +#### `byte` + +``` purescript +byte :: GLenum +``` + + +#### `ccw` + +``` purescript +ccw :: GLenum +``` + + +#### `clampToEdge` + +``` purescript +clampToEdge :: GLenum +``` + + +#### `colorAttachment0` + +``` purescript +colorAttachment0 :: GLenum +``` + + +#### `colorBufferBit` + +``` purescript +colorBufferBit :: GLenum +``` + + +#### `colorClearValue` + +``` purescript +colorClearValue :: GLenum +``` + + +#### `colorWritemask` + +``` purescript +colorWritemask :: GLenum +``` + + +#### `compileStatus` + +``` purescript +compileStatus :: GLenum +``` + + +#### `compressedTextureFormats` + +``` purescript +compressedTextureFormats :: GLenum +``` + + +#### `constantAlpha` + +``` purescript +constantAlpha :: GLenum +``` + + +#### `constantColor` + +``` purescript +constantColor :: GLenum +``` + + +#### `contextLostWebgl` + +``` purescript +contextLostWebgl :: GLenum +``` + + +#### `cullFace` + +``` purescript +cullFace :: GLenum +``` + + +#### `cullFaceMode` + +``` purescript +cullFaceMode :: GLenum +``` + + +#### `currentProgram` + +``` purescript +currentProgram :: GLenum +``` + + +#### `currentVertexAttrib` + +``` purescript +currentVertexAttrib :: GLenum +``` + + +#### `cw` + +``` purescript +cw :: GLenum +``` + + +#### `decr` + +``` purescript +decr :: GLenum +``` + + +#### `decrWrap` + +``` purescript +decrWrap :: GLenum +``` + + +#### `deleteStatus` + +``` purescript +deleteStatus :: GLenum +``` + + +#### `depthAttachment` + +``` purescript +depthAttachment :: GLenum +``` + + +#### `depthBits` + +``` purescript +depthBits :: GLenum +``` + + +#### `depthBufferBit` + +``` purescript +depthBufferBit :: GLenum +``` + + +#### `depthClearValue` + +``` purescript +depthClearValue :: GLenum +``` + + +#### `depthComponent` + +``` purescript +depthComponent :: GLenum +``` + + +#### `depthComponent16` + +``` purescript +depthComponent16 :: GLenum +``` + + +#### `depthFunc` + +``` purescript +depthFunc :: GLenum +``` + + +#### `depthRange` + +``` purescript +depthRange :: GLenum +``` + + +#### `depthStencil` + +``` purescript +depthStencil :: GLenum +``` + + +#### `depthStencilAttachment` + +``` purescript +depthStencilAttachment :: GLenum +``` + + +#### `depthTest` + +``` purescript +depthTest :: GLenum +``` + + +#### `depthWritemask` + +``` purescript +depthWritemask :: GLenum +``` + + +#### `dither` + +``` purescript +dither :: GLenum +``` + + +#### `dontCare` + +``` purescript +dontCare :: GLenum +``` + + +#### `dstAlpha` + +``` purescript +dstAlpha :: GLenum +``` + + +#### `dstColor` + +``` purescript +dstColor :: GLenum +``` + + +#### `dynamicDraw` + +``` purescript +dynamicDraw :: GLenum +``` + + +#### `elementArrayBuffer` + +``` purescript +elementArrayBuffer :: GLenum +``` + + +#### `elementArrayBufferBinding` + +``` purescript +elementArrayBufferBinding :: GLenum +``` + + +#### `equal` + +``` purescript +equal :: GLenum +``` + + +#### `fastest` + +``` purescript +fastest :: GLenum +``` + + +#### `float` + +``` purescript +float :: GLenum +``` + + +#### `floatMat2` + +``` purescript +floatMat2 :: GLenum +``` + + +#### `floatMat3` + +``` purescript +floatMat3 :: GLenum +``` + + +#### `floatMat4` + +``` purescript +floatMat4 :: GLenum +``` + + +#### `floatVec2` + +``` purescript +floatVec2 :: GLenum +``` + + +#### `floatVec3` + +``` purescript +floatVec3 :: GLenum +``` + + +#### `floatVec4` + +``` purescript +floatVec4 :: GLenum +``` + + +#### `fragmentShader` + +``` purescript +fragmentShader :: GLenum +``` + + +#### `framebuffer` + +``` purescript +framebuffer :: GLenum +``` + + +#### `framebufferAttachmentObjectName` + +``` purescript +framebufferAttachmentObjectName :: GLenum +``` + + +#### `framebufferAttachmentObjectType` + +``` purescript +framebufferAttachmentObjectType :: GLenum +``` + + +#### `framebufferAttachmentTextureCubeMapFace` + +``` purescript +framebufferAttachmentTextureCubeMapFace :: GLenum +``` + + +#### `framebufferAttachmentTextureLevel` + +``` purescript +framebufferAttachmentTextureLevel :: GLenum +``` + + +#### `framebufferBinding` + +``` purescript +framebufferBinding :: GLenum +``` + + +#### `framebufferComplete` + +``` purescript +framebufferComplete :: GLenum +``` + + +#### `framebufferIncompleteAttachment` + +``` purescript +framebufferIncompleteAttachment :: GLenum +``` + + +#### `framebufferIncompleteDimensions` + +``` purescript +framebufferIncompleteDimensions :: GLenum +``` + + +#### `framebufferIncompleteMissingAttachment` + +``` purescript +framebufferIncompleteMissingAttachment :: GLenum +``` + + +#### `framebufferUnsupported` + +``` purescript +framebufferUnsupported :: GLenum +``` + + +#### `front` + +``` purescript +front :: GLenum +``` + + +#### `frontAndBack` + +``` purescript +frontAndBack :: GLenum +``` + + +#### `frontFace` + +``` purescript +frontFace :: GLenum +``` + + +#### `funcAdd` + +``` purescript +funcAdd :: GLenum +``` + + +#### `funcReverseSubtract` + +``` purescript +funcReverseSubtract :: GLenum +``` + + +#### `funcSubtract` + +``` purescript +funcSubtract :: GLenum +``` + + +#### `generateMipmapHint` + +``` purescript +generateMipmapHint :: GLenum +``` + + +#### `gequal` + +``` purescript +gequal :: GLenum +``` + + +#### `greater` + +``` purescript +greater :: GLenum +``` + + +#### `greenBits` + +``` purescript +greenBits :: GLenum +``` + + +#### `highFloat` + +``` purescript +highFloat :: GLenum +``` + + +#### `highInt` + +``` purescript +highInt :: GLenum +``` + + +#### `implementationColorReadFormat` + +``` purescript +implementationColorReadFormat :: GLenum +``` + + +#### `implementationColorReadType` + +``` purescript +implementationColorReadType :: GLenum +``` + + +#### `incr` + +``` purescript +incr :: GLenum +``` + + +#### `incrWrap` + +``` purescript +incrWrap :: GLenum +``` + + +#### `int` + +``` purescript +int :: GLenum +``` + + +#### `intVec2` + +``` purescript +intVec2 :: GLenum +``` + + +#### `intVec3` + +``` purescript +intVec3 :: GLenum +``` + + +#### `intVec4` + +``` purescript +intVec4 :: GLenum +``` + + +#### `invalidEnum` + +``` purescript +invalidEnum :: GLenum +``` + + +#### `invalidFramebufferOperation` + +``` purescript +invalidFramebufferOperation :: GLenum +``` + + +#### `invalidOperation` + +``` purescript +invalidOperation :: GLenum +``` + + +#### `invalidValue` + +``` purescript +invalidValue :: GLenum +``` + + +#### `invert` + +``` purescript +invert :: GLenum +``` + + +#### `keep` + +``` purescript +keep :: GLenum +``` + + +#### `lequal` + +``` purescript +lequal :: GLenum +``` + + +#### `less` + +``` purescript +less :: GLenum +``` + + +#### `linear` + +``` purescript +linear :: GLenum +``` + + +#### `linearMipmapLinear` + +``` purescript +linearMipmapLinear :: GLenum +``` + + +#### `linearMipmapNearest` + +``` purescript +linearMipmapNearest :: GLenum +``` + + +#### `lines` + +``` purescript +lines :: GLenum +``` + + +#### `lineLoop` + +``` purescript +lineLoop :: GLenum +``` + + +#### `lineStrip` + +``` purescript +lineStrip :: GLenum +``` + + +#### `lineWidth` + +``` purescript +lineWidth :: GLenum +``` + + +#### `linkStatus` + +``` purescript +linkStatus :: GLenum +``` + + +#### `lowFloat` + +``` purescript +lowFloat :: GLenum +``` + + +#### `lowInt` + +``` purescript +lowInt :: GLenum +``` + + +#### `luminance` + +``` purescript +luminance :: GLenum +``` + + +#### `luminanceAlpha` + +``` purescript +luminanceAlpha :: GLenum +``` + + +#### `maxCombinedTextureImageUnits` + +``` purescript +maxCombinedTextureImageUnits :: GLenum +``` + + +#### `maxCubeMapTextureSize` + +``` purescript +maxCubeMapTextureSize :: GLenum +``` + + +#### `maxFragmentUniformVectors` + +``` purescript +maxFragmentUniformVectors :: GLenum +``` + + +#### `maxRenderbufferSize` + +``` purescript +maxRenderbufferSize :: GLenum +``` + + +#### `maxTextureImageUnits` + +``` purescript +maxTextureImageUnits :: GLenum +``` + + +#### `maxTextureSize` + +``` purescript +maxTextureSize :: GLenum +``` + + +#### `maxVaryingVectors` + +``` purescript +maxVaryingVectors :: GLenum +``` + + +#### `maxVertexAttribs` + +``` purescript +maxVertexAttribs :: GLenum +``` + + +#### `maxVertexTextureImageUnits` + +``` purescript +maxVertexTextureImageUnits :: GLenum +``` + + +#### `maxVertexUniformVectors` + +``` purescript +maxVertexUniformVectors :: GLenum +``` + + +#### `maxViewportDims` + +``` purescript +maxViewportDims :: GLenum +``` + + +#### `mediumFloat` + +``` purescript +mediumFloat :: GLenum +``` + + +#### `mediumInt` + +``` purescript +mediumInt :: GLenum +``` + + +#### `mirroredRepeat` + +``` purescript +mirroredRepeat :: GLenum +``` + + +#### `nearest` + +``` purescript +nearest :: GLenum +``` + + +#### `nearestMipmapLinear` + +``` purescript +nearestMipmapLinear :: GLenum +``` + + +#### `nearestMipmapNearest` + +``` purescript +nearestMipmapNearest :: GLenum +``` + + +#### `never` + +``` purescript +never :: GLenum +``` + + +#### `nicest` + +``` purescript +nicest :: GLenum +``` + + +#### `none` + +``` purescript +none :: GLenum +``` + + +#### `notequal` + +``` purescript +notequal :: GLenum +``` + + +#### `noError` + +``` purescript +noError :: GLenum +``` + + +#### `one` + +``` purescript +one :: GLenum +``` + + +#### `oneMinusConstantAlpha` + +``` purescript +oneMinusConstantAlpha :: GLenum +``` + + +#### `oneMinusConstantColor` + +``` purescript +oneMinusConstantColor :: GLenum +``` + + +#### `oneMinusDstAlpha` + +``` purescript +oneMinusDstAlpha :: GLenum +``` + + +#### `oneMinusDstColor` + +``` purescript +oneMinusDstColor :: GLenum +``` + + +#### `oneMinusSrcAlpha` + +``` purescript +oneMinusSrcAlpha :: GLenum +``` + + +#### `oneMinusSrcColor` + +``` purescript +oneMinusSrcColor :: GLenum +``` + + +#### `outOfMemory` + +``` purescript +outOfMemory :: GLenum +``` + + +#### `packAlignment` + +``` purescript +packAlignment :: GLenum +``` + + +#### `points` + +``` purescript +points :: GLenum +``` + + +#### `polygonOffsetFactor` + +``` purescript +polygonOffsetFactor :: GLenum +``` + + +#### `polygonOffsetFill` + +``` purescript +polygonOffsetFill :: GLenum +``` + + +#### `polygonOffsetUnits` + +``` purescript +polygonOffsetUnits :: GLenum +``` + + +#### `redBits` + +``` purescript +redBits :: GLenum +``` + + +#### `renderbuffer` + +``` purescript +renderbuffer :: GLenum +``` + + +#### `renderbufferAlphaSize` + +``` purescript +renderbufferAlphaSize :: GLenum +``` + + +#### `renderbufferBinding` + +``` purescript +renderbufferBinding :: GLenum +``` + + +#### `renderbufferBlueSize` + +``` purescript +renderbufferBlueSize :: GLenum +``` + + +#### `renderbufferDepthSize` + +``` purescript +renderbufferDepthSize :: GLenum +``` + + +#### `renderbufferGreenSize` + +``` purescript +renderbufferGreenSize :: GLenum +``` + + +#### `renderbufferHeight` + +``` purescript +renderbufferHeight :: GLenum +``` + + +#### `renderbufferInternalFormat` + +``` purescript +renderbufferInternalFormat :: GLenum +``` + + +#### `renderbufferRedSize` + +``` purescript +renderbufferRedSize :: GLenum +``` + + +#### `renderbufferStencilSize` + +``` purescript +renderbufferStencilSize :: GLenum +``` + + +#### `renderbufferWidth` + +``` purescript +renderbufferWidth :: GLenum +``` + + +#### `renderer` + +``` purescript +renderer :: GLenum +``` + + +#### `repeat` + +``` purescript +repeat :: GLenum +``` + + +#### `replace` + +``` purescript +replace :: GLenum +``` + + +#### `rgb` + +``` purescript +rgb :: GLenum +``` + + +#### `rgb565` + +``` purescript +rgb565 :: GLenum +``` + + +#### `rgb5A1` + +``` purescript +rgb5A1 :: GLenum +``` + + +#### `rgba` + +``` purescript +rgba :: GLenum +``` + + +#### `rgba4` + +``` purescript +rgba4 :: GLenum +``` + + +#### `sampler2d` + +``` purescript +sampler2d :: GLenum +``` + + +#### `samplerCube` + +``` purescript +samplerCube :: GLenum +``` + + +#### `samples` + +``` purescript +samples :: GLenum +``` + + +#### `sampleAlphaToCoverage` + +``` purescript +sampleAlphaToCoverage :: GLenum +``` + + +#### `sampleBuffers` + +``` purescript +sampleBuffers :: GLenum +``` + + +#### `sampleCoverage` + +``` purescript +sampleCoverage :: GLenum +``` + + +#### `sampleCoverageInvert` + +``` purescript +sampleCoverageInvert :: GLenum +``` + + +#### `sampleCoverageValue` + +``` purescript +sampleCoverageValue :: GLenum +``` + + +#### `scissorBox` + +``` purescript +scissorBox :: GLenum +``` + + +#### `scissorTest` + +``` purescript +scissorTest :: GLenum +``` + + +#### `shaderType` + +``` purescript +shaderType :: GLenum +``` + + +#### `shadingLanguageVersion` + +``` purescript +shadingLanguageVersion :: GLenum +``` + + +#### `short` + +``` purescript +short :: GLenum +``` + + +#### `srcAlpha` + +``` purescript +srcAlpha :: GLenum +``` + + +#### `srcAlphaSaturate` + +``` purescript +srcAlphaSaturate :: GLenum +``` + + +#### `srcColor` + +``` purescript +srcColor :: GLenum +``` + + +#### `staticDraw` + +``` purescript +staticDraw :: GLenum +``` + + +#### `stencilAttachment` + +``` purescript +stencilAttachment :: GLenum +``` + + +#### `stencilBackFail` + +``` purescript +stencilBackFail :: GLenum +``` + + +#### `stencilBackFunc` + +``` purescript +stencilBackFunc :: GLenum +``` + + +#### `stencilBackPassDepthFail` + +``` purescript +stencilBackPassDepthFail :: GLenum +``` + + +#### `stencilBackPassDepthPass` + +``` purescript +stencilBackPassDepthPass :: GLenum +``` + + +#### `stencilBackRef` + +``` purescript +stencilBackRef :: GLenum +``` + + +#### `stencilBackValueMask` + +``` purescript +stencilBackValueMask :: GLenum +``` + + +#### `stencilBackWritemask` + +``` purescript +stencilBackWritemask :: GLenum +``` + + +#### `stencilBits` + +``` purescript +stencilBits :: GLenum +``` + + +#### `stencilBufferBit` + +``` purescript +stencilBufferBit :: GLenum +``` + + +#### `stencilClearValue` + +``` purescript +stencilClearValue :: GLenum +``` + + +#### `stencilFail` + +``` purescript +stencilFail :: GLenum +``` + + +#### `stencilFunc` + +``` purescript +stencilFunc :: GLenum +``` + + +#### `stencilIndex` + +``` purescript +stencilIndex :: GLenum +``` + + +#### `stencilIndex8` + +``` purescript +stencilIndex8 :: GLenum +``` + + +#### `stencilPassDepthFail` + +``` purescript +stencilPassDepthFail :: GLenum +``` + + +#### `stencilPassDepthPass` + +``` purescript +stencilPassDepthPass :: GLenum +``` + + +#### `stencilRef` + +``` purescript +stencilRef :: GLenum +``` + + +#### `stencilTest` + +``` purescript +stencilTest :: GLenum +``` + + +#### `stencilValueMask` + +``` purescript +stencilValueMask :: GLenum +``` + + +#### `stencilWritemask` + +``` purescript +stencilWritemask :: GLenum +``` + + +#### `streamDraw` + +``` purescript +streamDraw :: GLenum +``` + + +#### `subpixelBits` + +``` purescript +subpixelBits :: GLenum +``` + + +#### `texture` + +``` purescript +texture :: GLenum +``` + + +#### `texture0` + +``` purescript +texture0 :: GLenum +``` + + +#### `texture1` + +``` purescript +texture1 :: GLenum +``` + + +#### `texture10` + +``` purescript +texture10 :: GLenum +``` + + +#### `texture11` + +``` purescript +texture11 :: GLenum +``` + + +#### `texture12` + +``` purescript +texture12 :: GLenum +``` + + +#### `texture13` + +``` purescript +texture13 :: GLenum +``` + + +#### `texture14` + +``` purescript +texture14 :: GLenum +``` + + +#### `texture15` + +``` purescript +texture15 :: GLenum +``` + + +#### `texture16` + +``` purescript +texture16 :: GLenum +``` + + +#### `texture17` + +``` purescript +texture17 :: GLenum +``` + + +#### `texture18` + +``` purescript +texture18 :: GLenum +``` + + +#### `texture19` + +``` purescript +texture19 :: GLenum +``` + + +#### `texture2` + +``` purescript +texture2 :: GLenum +``` + + +#### `texture20` + +``` purescript +texture20 :: GLenum +``` + + +#### `texture21` + +``` purescript +texture21 :: GLenum +``` + + +#### `texture22` + +``` purescript +texture22 :: GLenum +``` + + +#### `texture23` + +``` purescript +texture23 :: GLenum +``` + + +#### `texture24` + +``` purescript +texture24 :: GLenum +``` + + +#### `texture25` + +``` purescript +texture25 :: GLenum +``` + + +#### `texture26` + +``` purescript +texture26 :: GLenum +``` + + +#### `texture27` + +``` purescript +texture27 :: GLenum +``` + + +#### `texture28` + +``` purescript +texture28 :: GLenum +``` + + +#### `texture29` + +``` purescript +texture29 :: GLenum +``` + + +#### `texture3` + +``` purescript +texture3 :: GLenum +``` + + +#### `texture30` + +``` purescript +texture30 :: GLenum +``` + + +#### `texture31` + +``` purescript +texture31 :: GLenum +``` + + +#### `texture4` + +``` purescript +texture4 :: GLenum +``` + + +#### `texture5` + +``` purescript +texture5 :: GLenum +``` + + +#### `texture6` + +``` purescript +texture6 :: GLenum +``` + + +#### `texture7` + +``` purescript +texture7 :: GLenum +``` + + +#### `texture8` + +``` purescript +texture8 :: GLenum +``` + + +#### `texture9` + +``` purescript +texture9 :: GLenum +``` + + +#### `texture2d` + +``` purescript +texture2d :: GLenum +``` + + +#### `textureBinding2d` + +``` purescript +textureBinding2d :: GLenum +``` + + +#### `textureBindingCubeMap` + +``` purescript +textureBindingCubeMap :: GLenum +``` + + +#### `textureCubeMap` + +``` purescript +textureCubeMap :: GLenum +``` + + +#### `textureCubeMapNegativeX` + +``` purescript +textureCubeMapNegativeX :: GLenum +``` + + +#### `textureCubeMapNegativeY` + +``` purescript +textureCubeMapNegativeY :: GLenum +``` + + +#### `textureCubeMapNegativeZ` + +``` purescript +textureCubeMapNegativeZ :: GLenum +``` + + +#### `textureCubeMapPositiveX` + +``` purescript +textureCubeMapPositiveX :: GLenum +``` + + +#### `textureCubeMapPositiveY` + +``` purescript +textureCubeMapPositiveY :: GLenum +``` + + +#### `textureCubeMapPositiveZ` + +``` purescript +textureCubeMapPositiveZ :: GLenum +``` + + +#### `textureMagFilter` + +``` purescript +textureMagFilter :: GLenum +``` + + +#### `textureMinFilter` + +``` purescript +textureMinFilter :: GLenum +``` + + +#### `textureWrapS` + +``` purescript +textureWrapS :: GLenum +``` + + +#### `textureWrapT` + +``` purescript +textureWrapT :: GLenum +``` + + +#### `triangles` + +``` purescript +triangles :: GLenum +``` + + +#### `triangleFan` + +``` purescript +triangleFan :: GLenum +``` + + +#### `triangleStrip` + +``` purescript +triangleStrip :: GLenum +``` + + +#### `unpackAlignment` + +``` purescript +unpackAlignment :: GLenum +``` + + +#### `unpackColorspaceConversionWebgl` + +``` purescript +unpackColorspaceConversionWebgl :: GLenum +``` + + +#### `unpackFlipYWebgl` + +``` purescript +unpackFlipYWebgl :: GLenum +``` + + +#### `unpackPremultiplyAlphaWebgl` + +``` purescript +unpackPremultiplyAlphaWebgl :: GLenum +``` + + +#### `unsignedByte` + +``` purescript +unsignedByte :: GLenum +``` + + +#### `unsignedInt` + +``` purescript +unsignedInt :: GLenum +``` + + +#### `unsignedShort` + +``` purescript +unsignedShort :: GLenum +``` + + +#### `unsignedShort4444` + +``` purescript +unsignedShort4444 :: GLenum +``` + + +#### `unsignedShort5551` + +``` purescript +unsignedShort5551 :: GLenum +``` + + +#### `unsignedShort565` + +``` purescript +unsignedShort565 :: GLenum +``` + + +#### `validateStatus` + +``` purescript +validateStatus :: GLenum +``` + + +#### `vendor` + +``` purescript +vendor :: GLenum +``` + + +#### `version` + +``` purescript +version :: GLenum +``` + + +#### `vertexAttribArrayBufferBinding` + +``` purescript +vertexAttribArrayBufferBinding :: GLenum +``` + + +#### `vertexAttribArrayEnabled` + +``` purescript +vertexAttribArrayEnabled :: GLenum +``` + + +#### `vertexAttribArrayNormalized` + +``` purescript +vertexAttribArrayNormalized :: GLenum +``` + + +#### `vertexAttribArrayPointer` + +``` purescript +vertexAttribArrayPointer :: GLenum +``` + + +#### `vertexAttribArraySize` + +``` purescript +vertexAttribArraySize :: GLenum +``` + + +#### `vertexAttribArrayStride` + +``` purescript +vertexAttribArrayStride :: GLenum +``` + + +#### `vertexAttribArrayType` + +``` purescript +vertexAttribArrayType :: GLenum +``` + + +#### `vertexShader` + +``` purescript +vertexShader :: GLenum +``` + + +#### `viewport` + +``` purescript +viewport :: GLenum +``` + + +#### `zero` + +``` purescript +zero :: GLenum +``` + + + +## Module Graphics.WebGL.Raw.Types + + +#### `DOMString` + +``` purescript +type DOMString = String +``` + + +#### `BufferDataSource` + +``` purescript +type BufferDataSource = Float32Array +``` + + +#### `FloatArray` + +``` purescript +type FloatArray = Float32Array +``` + + +#### `GLbitfield` + +``` purescript +type GLbitfield = Number +``` + + +#### `GLboolean` + +``` purescript +type GLboolean = Boolean +``` + + +#### `GLbyte` + +``` purescript +type GLbyte = Number +``` + + +#### `GLclampf` + +``` purescript +type GLclampf = Number +``` + + +#### `GLenum` + +``` purescript +type GLenum = Number +``` + + +#### `GLfloat` + +``` purescript +type GLfloat = Number +``` + + +#### `GLint` + +``` purescript +type GLint = Number +``` + + +#### `GLintptr` + +``` purescript +type GLintptr = Number +``` + + +#### `GLshort` + +``` purescript +type GLshort = Number +``` + + +#### `GLsizei` + +``` purescript +type GLsizei = Number +``` + + +#### `GLsizeiptr` + +``` purescript +type GLsizeiptr = Number +``` + + +#### `GLubyte` + +``` purescript +type GLubyte = Number +``` + + +#### `GLuint` + +``` purescript +type GLuint = Number +``` + + +#### `GLushort` + +``` purescript +type GLushort = Number +``` + + +#### `ArrayBufferView` + +``` purescript +data ArrayBufferView :: * +``` + + +#### `TexImageSource` + +``` purescript +data TexImageSource :: * +``` + + +#### `WebGLActiveInfo` + +``` purescript +data WebGLActiveInfo :: * +``` + + +#### `WebGLBuffer` + +``` purescript +data WebGLBuffer :: * +``` + + +#### `WebGLContext` + +``` purescript +data WebGLContext :: * +``` + + +#### `WebGLFramebuffer` + +``` purescript +data WebGLFramebuffer :: * +``` + + +#### `WebGLProgram` + +``` purescript +data WebGLProgram :: * +``` + + +#### `WebGLRenderbuffer` + +``` purescript +data WebGLRenderbuffer :: * +``` + + +#### `WebGLShader` + +``` purescript +data WebGLShader :: * +``` + + +#### `WebGLShaderPrecisionFormat` + +``` purescript +data WebGLShaderPrecisionFormat :: * +``` + + +#### `WebGLTexture` + +``` purescript +data WebGLTexture :: * +``` + + +#### `WebGLUniformLocation` + +``` purescript +data WebGLUniformLocation :: * +``` + + +#### `WebGLContextAttributes` + +``` purescript +type WebGLContextAttributes = { failIfMajorPerformanceCaveat :: Boolean, preferLowPowerToHighPerformance :: Boolean, preserveDrawingBuffer :: Boolean, premultipliedAlpha :: Boolean, antialias :: Boolean, stencil :: Boolean, depth :: Boolean, alpha :: Boolean } +``` + + + +## Module Graphics.WebGL.Raw.Util + +#### `toMaybe` + +``` purescript +toMaybe :: forall a. a -> Maybe a +``` + + +#### `nullAsEmpty` + +``` purescript +nullAsEmpty :: forall a. [a] -> [a] +``` \ No newline at end of file diff --git a/WebGL_enum.idl b/docs/WebGL-1.0.3.idl similarity index 75% rename from WebGL_enum.idl rename to docs/WebGL-1.0.3.idl index a3211e0..cad6844 100644 --- a/WebGL_enum.idl +++ b/docs/WebGL-1.0.3.idl @@ -1,3 +1,4 @@ + /* ClearBufferMask */ const GLenum DEPTH_BUFFER_BIT = 0x00000100; const GLenum STENCIL_BUFFER_BIT = 0x00000400; @@ -95,7 +96,7 @@ /* ALWAYS */ /* EnableCap */ - const GLenum TEXTURE_2D = 0x0DE1; + /* TEXTURE_2D */ const GLenum CULL_FACE = 0x0B44; const GLenum BLEND = 0x0BE2; const GLenum DITHER = 0x0BD0; @@ -173,7 +174,6 @@ /* TEXTURE_WRAP_S */ /* TEXTURE_WRAP_T */ - const GLenum NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3; /* HintMode */ @@ -223,9 +223,7 @@ const GLenum VALIDATE_STATUS = 0x8B83; const GLenum ATTACHED_SHADERS = 0x8B85; const GLenum ACTIVE_UNIFORMS = 0x8B86; - const GLenum ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; const GLenum ACTIVE_ATTRIBUTES = 0x8B89; - const GLenum ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C; const GLenum CURRENT_PROGRAM = 0x8B8D; @@ -273,7 +271,7 @@ const GLenum TEXTURE_WRAP_T = 0x2803; /* TextureTarget */ - /* TEXTURE_2D */ + const GLenum TEXTURE_2D = 0x0DE1; const GLenum TEXTURE = 0x1702; const GLenum TEXTURE_CUBE_MAP = 0x8513; @@ -352,10 +350,12 @@ const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + /* Read Format */ + const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; + const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + /* Shader Source */ const GLenum COMPILE_STATUS = 0x8B81; - const GLenum INFO_LOG_LENGTH = 0x8B84; - const GLenum SHADER_SOURCE_LENGTH = 0x8B88; /* Shader Precision-Specified Types */ const GLenum LOW_FLOAT = 0x8DF0; @@ -419,21 +419,22 @@ const GLenum BROWSER_DEFAULT_WEBGL = 0x9244; readonly attribute HTMLCanvasElement canvas; + readonly attribute GLsizei drawingBufferWidth; + readonly attribute GLsizei drawingBufferHeight; - WebGLContextAttributes getContextAttributes(); + [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes(); + [WebGLHandlesContextLoss] boolean isContextLost(); - boolean isContextLost(); - - DOMString[ ] getSupportedExtensions(); - object getExtension(DOMString name); + sequence? getSupportedExtensions(); + object? getExtension(DOMString name); void activeTexture(GLenum texture); - void attachShader(WebGLProgram program, WebGLShader shader); - void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name); - void bindBuffer(GLenum target, WebGLBuffer buffer); - void bindFramebuffer(GLenum target, WebGLFramebuffer framebuffer); - void bindRenderbuffer(GLenum target, WebGLRenderbuffer renderbuffer); - void bindTexture(GLenum target, WebGLTexture texture); + void attachShader(WebGLProgram? program, WebGLShader? shader); + void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name); + void bindBuffer(GLenum target, WebGLBuffer? buffer); + void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer); + void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer); + void bindTexture(GLenum target, WebGLTexture? texture); void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void blendEquation(GLenum mode); void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha); @@ -441,19 +442,26 @@ void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -/* void bufferData(GLenum target, GLsizeiptr size, GLenum usage); - void bufferData(GLenum target, ArrayBufferView data, GLenum usage);*/ - void bufferData(GLenum target, ArrayBuffer data, GLenum usage); -/* void bufferSubData(GLenum target, GLintptr offset, ArrayBufferView data);*/ - void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer data); + typedef (ArrayBuffer or ArrayBufferView) BufferDataSource; + void bufferData(GLenum target, GLsizeiptr size, GLenum usage); + void bufferData(GLenum target, BufferDataSource? data, GLenum usage); + void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data); - GLenum checkFramebufferStatus(GLenum target); + [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target); void clear(GLbitfield mask); void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); void clearDepth(GLclampf depth); void clearStencil(GLint s); void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); - void compileShader(WebGLShader shader); + void compileShader(WebGLShader? shader); + + void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, + GLsizei width, GLsizei height, GLint border, + ArrayBufferView data); + void compressedTexSubImage2D(GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLsizei width, GLsizei height, GLenum format, + ArrayBufferView data); void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, @@ -461,26 +469,26 @@ void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); - WebGLBuffer createBuffer(); - WebGLFramebuffer createFramebuffer(); - WebGLProgram createProgram(); - WebGLRenderbuffer createRenderbuffer(); - WebGLShader createShader(GLenum type); - WebGLTexture createTexture(); + WebGLBuffer? createBuffer(); + WebGLFramebuffer? createFramebuffer(); + WebGLProgram? createProgram(); + WebGLRenderbuffer? createRenderbuffer(); + WebGLShader? createShader(GLenum type); + WebGLTexture? createTexture(); void cullFace(GLenum mode); - void deleteBuffer(WebGLBuffer buffer); - void deleteFramebuffer(WebGLFramebuffer framebuffer); - void deleteProgram(WebGLProgram program); - void deleteRenderbuffer(WebGLRenderbuffer renderbuffer); - void deleteShader(WebGLShader shader); - void deleteTexture(WebGLTexture texture); + void deleteBuffer(WebGLBuffer? buffer); + void deleteFramebuffer(WebGLFramebuffer? framebuffer); + void deleteProgram(WebGLProgram? program); + void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer); + void deleteShader(WebGLShader? shader); + void deleteTexture(WebGLTexture? texture); void depthFunc(GLenum func); void depthMask(GLboolean flag); void depthRange(GLclampf zNear, GLclampf zFar); - void detachShader(WebGLProgram program, WebGLShader shader); + void detachShader(WebGLProgram? program, WebGLShader? shader); void disable(GLenum cap); void disableVertexAttribArray(GLuint index); void drawArrays(GLenum mode, GLint first, GLsizei count); @@ -492,66 +500,67 @@ void flush(); void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, - WebGLRenderbuffer renderbuffer); + WebGLRenderbuffer? renderbuffer); void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, - WebGLTexture texture, GLint level); + WebGLTexture? texture, GLint level); void frontFace(GLenum mode); void generateMipmap(GLenum target); - WebGLActiveInfo getActiveAttrib(WebGLProgram program, GLuint index); - WebGLActiveInfo getActiveUniform(WebGLProgram program, GLuint index); - WebGLShader[ ] getAttachedShaders(WebGLProgram program); + WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index); + WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index); + sequence? getAttachedShaders(WebGLProgram? program); - GLint getAttribLocation(WebGLProgram program, DOMString name); + [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name); - any getParameter(GLenum pname); any getBufferParameter(GLenum target, GLenum pname); + any getParameter(GLenum pname); - GLenum getError(); + [WebGLHandlesContextLoss] GLenum getError(); any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname); - any getProgramParameter(WebGLProgram program, GLenum pname); - DOMString getProgramInfoLog(WebGLProgram program); + any getProgramParameter(WebGLProgram? program, GLenum pname); + DOMString? getProgramInfoLog(WebGLProgram? program); any getRenderbufferParameter(GLenum target, GLenum pname); - any getShaderParameter(WebGLShader shader, GLenum pname); - DOMString getShaderInfoLog(WebGLShader shader); + any getShaderParameter(WebGLShader? shader, GLenum pname); + WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype); + DOMString? getShaderInfoLog(WebGLShader? shader); - DOMString getShaderSource(WebGLShader shader); + DOMString? getShaderSource(WebGLShader? shader); any getTexParameter(GLenum target, GLenum pname); - any getUniform(WebGLProgram program, WebGLUniformLocation location); + any getUniform(WebGLProgram? program, WebGLUniformLocation? location); - WebGLUniformLocation getUniformLocation(WebGLProgram program, DOMString name); + WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name); any getVertexAttrib(GLuint index, GLenum pname); - GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname); + [WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname); void hint(GLenum target, GLenum mode); - GLboolean isBuffer(WebGLBuffer buffer); - GLboolean isEnabled(GLenum cap); - GLboolean isFramebuffer(WebGLFramebuffer framebuffer); - GLboolean isProgram(WebGLProgram program); - GLboolean isRenderbuffer(WebGLRenderbuffer renderbuffer); - GLboolean isShader(WebGLShader shader); - GLboolean isTexture(WebGLTexture texture); + [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer); + [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap); + [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer); + [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program); + [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer); + [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader); + [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture); void lineWidth(GLfloat width); - void linkProgram(WebGLProgram program); + void linkProgram(WebGLProgram? program); void pixelStorei(GLenum pname, GLint param); void polygonOffset(GLfloat factor, GLfloat units); void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, ArrayBufferView pixels); + GLenum format, GLenum type, ArrayBufferView? pixels); void renderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); void sampleCoverage(GLclampf value, GLboolean invert); void scissor(GLint x, GLint y, GLsizei width, GLsizei height); - void shaderSource(WebGLShader shader, DOMString source); + void shaderSource(WebGLShader? shader, DOMString source); void stencilFunc(GLenum func, GLint ref, GLuint mask); void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); @@ -560,87 +569,80 @@ void stencilOp(GLenum fail, GLenum zfail, GLenum zpass); void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); + typedef (ImageData or + HTMLImageElement or + HTMLCanvasElement or + HTMLVideoElement) TexImageSource; void texImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, - GLenum type, ArrayBufferView pixels); + GLenum type, ArrayBufferView? pixels); void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, ImageData pixels); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, HTMLImageElement image) raises (DOMException); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, HTMLCanvasElement canvas) raises (DOMException); - void texImage2D(GLenum target, GLint level, GLenum internalformat, - GLenum format, GLenum type, HTMLVideoElement video) raises (DOMException); + GLenum format, GLenum type, TexImageSource? source); // May throw DOMException void texParameterf(GLenum target, GLenum pname, GLfloat param); void texParameteri(GLenum target, GLenum pname, GLint param); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, - GLenum format, GLenum type, ArrayBufferView pixels); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, ImageData pixels); + GLenum format, GLenum type, ArrayBufferView? pixels); void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, HTMLImageElement image) raises (DOMException); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, HTMLCanvasElement canvas) raises (DOMException); - void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, - GLenum format, GLenum type, HTMLVideoElement video) raises (DOMException); - - void uniform1f(WebGLUniformLocation location, GLfloat x); - void uniform1fv(WebGLUniformLocation location, FloatArray v); - void uniform1fv(WebGLUniformLocation location, sequence v); - void uniform1i(WebGLUniformLocation location, GLint x); - void uniform1iv(WebGLUniformLocation location, Int32Array v); - void uniform1iv(WebGLUniformLocation location, sequence v); - void uniform2f(WebGLUniformLocation location, GLfloat x, GLfloat y); - void uniform2fv(WebGLUniformLocation location, FloatArray v); - void uniform2fv(WebGLUniformLocation location, sequence v); - void uniform2i(WebGLUniformLocation location, GLint x, GLint y); - void uniform2iv(WebGLUniformLocation location, Int32Array v); - void uniform2iv(WebGLUniformLocation location, sequence v); - void uniform3f(WebGLUniformLocation location, GLfloat x, GLfloat y, GLfloat z); - void uniform3fv(WebGLUniformLocation location, FloatArray v); - void uniform3fv(WebGLUniformLocation location, sequence v); - void uniform3i(WebGLUniformLocation location, GLint x, GLint y, GLint z); - void uniform3iv(WebGLUniformLocation location, Int32Array v); - void uniform3iv(WebGLUniformLocation location, sequence v); - void uniform4f(WebGLUniformLocation location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void uniform4fv(WebGLUniformLocation location, FloatArray v); - void uniform4fv(WebGLUniformLocation location, sequence v); - void uniform4i(WebGLUniformLocation location, GLint x, GLint y, GLint z, GLint w); - void uniform4iv(WebGLUniformLocation location, Int32Array v); - void uniform4iv(WebGLUniformLocation location, sequence v); - - void uniformMatrix2fv(WebGLUniformLocation location, GLboolean transpose, - FloatArray value); - void uniformMatrix2fv(WebGLUniformLocation location, GLboolean transpose, - sequence value); - void uniformMatrix3fv(WebGLUniformLocation location, GLboolean transpose, - FloatArray value); - void uniformMatrix3fv(WebGLUniformLocation location, GLboolean transpose, - sequence value); - void uniformMatrix4fv(WebGLUniformLocation location, GLboolean transpose, - FloatArray value); - void uniformMatrix4fv(WebGLUniformLocation location, GLboolean transpose, - sequence value); - - void useProgram(WebGLProgram program); - void validateProgram(WebGLProgram program); + GLenum format, GLenum type, TexImageSource? source); // May throw DOMException + + void uniform1f(WebGLUniformLocation? location, GLfloat x); + void uniform1fv(WebGLUniformLocation? location, Float32Array v); + void uniform1fv(WebGLUniformLocation? location, sequence v); + void uniform1i(WebGLUniformLocation? location, GLint x); + void uniform1iv(WebGLUniformLocation? location, Int32Array v); + void uniform1iv(WebGLUniformLocation? location, sequence v); + void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y); + void uniform2fv(WebGLUniformLocation? location, Float32Array v); + void uniform2fv(WebGLUniformLocation? location, sequence v); + void uniform2i(WebGLUniformLocation? location, GLint x, GLint y); + void uniform2iv(WebGLUniformLocation? location, Int32Array v); + void uniform2iv(WebGLUniformLocation? location, sequence v); + void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z); + void uniform3fv(WebGLUniformLocation? location, Float32Array v); + void uniform3fv(WebGLUniformLocation? location, sequence v); + void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z); + void uniform3iv(WebGLUniformLocation? location, Int32Array v); + void uniform3iv(WebGLUniformLocation? location, sequence v); + void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + void uniform4fv(WebGLUniformLocation? location, Float32Array v); + void uniform4fv(WebGLUniformLocation? location, sequence v); + void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w); + void uniform4iv(WebGLUniformLocation? location, Int32Array v); + void uniform4iv(WebGLUniformLocation? location, sequence v); + + void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, + Float32Array value); + void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, + sequence value); + void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, + Float32Array value); + void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, + sequence value); + void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, + Float32Array value); + void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, + sequence value); + + void useProgram(WebGLProgram? program); + void validateProgram(WebGLProgram? program); void vertexAttrib1f(GLuint indx, GLfloat x); - void vertexAttrib1fv(GLuint indx, FloatArray values); - void vertexAttrib1fv(GLuint indx, sequence values); + void vertexAttrib1fv(GLuint indx, Float32Array values); + void vertexAttrib1fv(GLuint indx, sequence values); void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y); - void vertexAttrib2fv(GLuint indx, FloatArray values); - void vertexAttrib2fv(GLuint indx, sequence values); + void vertexAttrib2fv(GLuint indx, Float32Array values); + void vertexAttrib2fv(GLuint indx, sequence values); void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z); - void vertexAttrib3fv(GLuint indx, FloatArray values); - void vertexAttrib3fv(GLuint indx, sequence values); + void vertexAttrib3fv(GLuint indx, Float32Array values); + void vertexAttrib3fv(GLuint indx, sequence values); void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); - void vertexAttrib4fv(GLuint indx, FloatArray values); - void vertexAttrib4fv(GLuint indx, sequence values); + void vertexAttrib4fv(GLuint indx, Float32Array values); + void vertexAttrib4fv(GLuint indx, sequence values); void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); void viewport(GLint x, GLint y, GLsizei width, GLsizei height); + diff --git a/generator/IDL/AST.hs b/generator/IDL/AST.hs new file mode 100644 index 0000000..b4b0789 --- /dev/null +++ b/generator/IDL/AST.hs @@ -0,0 +1,61 @@ +module IDL.AST where + +import qualified Data.Map as Map + +data Type + = Generic + | Concrete + { typeName :: String + , typeIsArray :: Bool + , typeIsMaybe' :: Bool + } + deriving Show + +data Arg = Arg + { argType :: Type + , argName :: String + } + deriving Show + +data Decl + = Enum + { enumName :: String + , enumValue :: Integer + } + | Comment + { comment :: String + } + | Function + { methodName :: String + , actualName :: String + , methodRetType :: Type + , methodArgs :: [Arg] + , methodRaises :: Maybe String + } + | Attribute + { attrIsReadonly :: Bool + , attrType :: Type + , attrName :: String + } + | Typedef + deriving Show + +data IDL = IDL + { enums :: Map.Map String Decl + , functions :: Map.Map String Decl + , types :: Map.Map String Type + } + deriving Show + +emptyIdl :: IDL +emptyIdl = IDL Map.empty Map.empty Map.empty + +webglContext :: Arg +webglContext = Arg (Concrete "WebGLContext" False False) "webgl" + +funcArgs :: Decl -> [Arg] +funcArgs f = webglContext : methodArgs f + +typeIsMaybe :: Type -> Bool +typeIsMaybe t@Concrete{} = typeIsMaybe' t && not (typeIsArray t) +typeIsMaybe _ = True diff --git a/generator/IDL/Cleaner.hs b/generator/IDL/Cleaner.hs new file mode 100644 index 0000000..f67b948 --- /dev/null +++ b/generator/IDL/Cleaner.hs @@ -0,0 +1,91 @@ +module IDL.Cleaner +( declsToIdl +, getEnums +, getFuncs +, getTypes +) where + +import Data.List (foldl') + +import qualified Data.Map as Map + +import IDL.AST + +-- constants + +excludedTypes :: [String] +excludedTypes = + [ "ArrayBuffer" + , "BufferDataSource" + , "DOMString" + , "Float32Array" + , "FloatArray" + , "GLbitfield" + , "GLboolean" + , "GLbyte" + , "GLclampf" + , "GLenum" + , "GLfloat" + , "GLint" + , "GLintptr" + , "GLshort" + , "GLsizei" + , "GLsizeiptr" + , "GLubyte" + , "GLuint" + , "GLushort" + , "HTMLCanvasElement" + , "Int32Array" + , "WebGLContextAttributes" + , "any" + , "boolean" + , "long" + , "object" + , "sequence" + , "void" + ] + +-- public functions + +declsToIdl :: [Decl] -> IDL +declsToIdl = cleanup . foldr partition emptyIdl + +getTypes :: IDL -> [Type] +getTypes = map snd . Map.toList . types + +getEnums :: IDL -> [Decl] +getEnums = map snd . Map.toList . enums + +getFuncs :: IDL -> [Decl] +getFuncs = map snd . Map.toList . functions + +-- private functions + +partition :: Decl -> IDL -> IDL +partition e@Enum{} idl = idl + { enums = Map.insert (enumName e) e (enums idl) + } +partition f@Function{} idl = idl + { functions = underscore f $ functions idl + , types = insertFuncTypes f $ types idl + } +partition _ idl = idl + +underscore :: Decl -> Map.Map String Decl -> Map.Map String Decl +underscore f fs + | Map.member name fs = underscore (f { methodName = name ++ "_" }) fs + | otherwise = Map.insert name f fs + where + name = methodName f + +insertFuncTypes :: Decl -> Map.Map String Type -> Map.Map String Type +insertFuncTypes f types = foldl' insert types ftypes + where + ftypes = methodRetType f : map argType (funcArgs f) + insert ts Generic = ts + insert ts t = Map.insert (typeName t) t ts + +cleanup :: IDL -> IDL +cleanup idl = idl { types = removeExcluded $ types idl } + where + removeExcluded types = foldl' (flip Map.delete) types excludedTypes diff --git a/generator/IDL/Parser.hs b/generator/IDL/Parser.hs new file mode 100644 index 0000000..851a832 --- /dev/null +++ b/generator/IDL/Parser.hs @@ -0,0 +1,143 @@ +module IDL.Parser (parseDecls) where + +import Control.Monad (liftM) +import Data.Functor.Identity (Identity(..)) + +import qualified Text.Parsec.Token as Par +import qualified Text.Parsec as Par +import qualified Text.Parsec.Error as Par +import qualified Text.ParserCombinators.Parsec.Language as Par +import qualified Text.ParserCombinators.Parsec as Par (Parser) + +import IDL.AST + +type Parse a = Par.Parsec String () a + +-- constants + +symbol' = Par.symbol lexer +whiteSpace' = Par.whiteSpace lexer +identifier' = Par.identifier lexer +integer' = Par.integer lexer +semi' = Par.semi lexer +parens' = Par.parens lexer +brackets' = Par.brackets lexer +angles' = Par.angles lexer + +lexer :: Par.GenTokenParser String u Identity +lexer = Par.makeTokenParser Par.emptyDef + +-- public functions + +parseDecls :: Parse [Decl] +parseDecls = + Par.manyTill (whiteSpace' >> parseDecl) Par.eof Par. "expecting idl" + +-- private functions + +parseDecl :: Parse Decl +parseDecl = decl Par. "expecting decl" + where + decl = Par.try parseConst Par.<|> + Par.try parseComment Par.<|> + Par.try parseMethod Par.<|> + Par.try parseAttr Par.<|> + Par.try parseTypedef + +parseConst :: Parse Decl +parseConst = do + symbol' "const" + symbol' "GLenum" + name <- identifier' + symbol' "=" + value <- integer' + semi' + return Enum + { enumName = name + , enumValue = value + } + +parseComment :: Parse Decl +parseComment = inlineComment Par.<|> blockComment + where + inlineComment = Par.try $ do + symbol' "//" + comment <- Par.manyTill Par.anyChar Par.newline + Par.optional whiteSpace' + return Comment { comment = comment } + blockComment = do + symbol' "/*" + comment <- Par.manyTill Par.anyChar $ symbol' "*/" + return Comment { comment = comment } + +parseMethod :: Parse Decl +parseMethod = do + Par.optional $ symbol' "[WebGLHandlesContextLoss]" + returnType <- parseType + methodName <- identifier' + args <- parens' . Par.sepBy parseArg $ symbol' "," + condRaises <- Par.option Nothing parseRaises + semi' + return Function + { methodName = methodName + , actualName = methodName + , methodRetType = returnType + , methodArgs = args + , methodRaises = condRaises + } + +parseAttr :: Parse Decl +parseAttr = do + isReadonly <- Par.option False $ symbol' "readonly" >> return True + symbol' "attribute" + typ <- parseType + name <- identifier' + semi' + return Attribute + { attrIsReadonly = isReadonly + , attrType = typ + , attrName = name + } + +parseTypedef :: Parse Decl +parseTypedef = do + symbol' "typedef" + Par.manyTill Par.anyChar semi' + return Typedef + + +parseType :: Parse Type +parseType = typ Par. "expecting type" + where + arrayName = do + symbol' "sequence" + name <- angles' identifier' + return (name, True) + singleName = do + name <- identifier' + return (name, False) + typ = do + (name, isArray) <- Par.try arrayName Par.<|> singleName + isMaybe <- Par.option False $ symbol' "?" >> return True + return $ + if name `elem` ["any", "object"] + then Generic + else Concrete + { typeName = name + , typeIsArray = isArray + , typeIsMaybe' = isMaybe + } + +parseArg :: Parse Arg +parseArg = do + typ <- parseType + name <- identifier' + return Arg + { argType = typ + , argName = name + } + +parseRaises :: Parse (Maybe String) +parseRaises = do + symbol' "raises" + liftM Just $ parens' identifier' diff --git a/generator/IDL/Printer.hs b/generator/IDL/Printer.hs new file mode 100644 index 0000000..b587e87 --- /dev/null +++ b/generator/IDL/Printer.hs @@ -0,0 +1,279 @@ +{-# LANGUAGE OverloadedStrings #-} + +module IDL.Printer +( typesFFI +, enumsFFI +, exportsFFI +, importsFFI +) where + +import Data.Char (toLower, toUpper) +import Data.Maybe (isNothing) +import IDL.Cleaner (getEnums, getFuncs, getTypes) +import Text.PrettyPrint (Doc, ($+$), ($$), (<>), (<+>), char, empty, + hcat, int, integer, nest, parens, punctuate, text, vcat) + +import IDL.AST + +typesFFI :: IDL -> Doc +typesFFI idl = + header $+$ blank $+$ + typeDefs $+$ blank $+$ + typeDecls $+$ blank $+$ + contextAttrs $+$ blank + where + header = vcat + [ "module Graphics.WebGL.Raw.Types where" + , "" + , "import Data.ArrayBuffer.Types" + ] + typeDecls = vcat . map ppTypeDecl $ getTypes idl + +enumsFFI :: IDL -> Doc +enumsFFI idl = + header $+$ blank $+$ + constants $+$ blank + where + header = vcat + [ "module Graphics.WebGL.Raw.Enums where" + , "" + , "import Graphics.WebGL.Raw.Types (GLenum ())" + ] + constants = vcat . map ppConstant $ getEnums idl + +exportsFFI :: IDL -> Doc +exportsFFI idl = + header $+$ blank $+$ + methods $+$ blank + where + header = vcat + [ "\"use strict\";" + , "" + , "// module Graphics.WebGL.Raw" + ] + methods = vcat . map ppJsFunc $ getFuncs idl + +importsFFI :: IDL -> Doc +importsFFI idl = + header $+$ blank $+$ + funcs $+$ blank + where + header = vcat + [ "module Graphics.WebGL.Raw" + , expList + , ") where" + , "" + , "import Control.Monad.Eff" + , "import Data.ArrayBuffer.Types" + , "import Data.Function" + , "import Data.Maybe" + , "import Graphics.Canvas" + , "import Graphics.WebGL.Raw.Types" + , "import Graphics.WebGL.Raw.Util" + , "import Prelude" + ] + expList = ppExportList $ getFuncs idl + funcs = vcat . map ppImport $ getFuncs idl + +-- predefined text + +typeDefs :: Doc +typeDefs = vcat + [ "type DOMString = String" + , "type BufferDataSource = Float32Array" + , "type FloatArray = Float32Array" + , "type GLbitfield = Int" + , "type GLboolean = Boolean" + , "type GLbyte = Int" + , "type GLclampf = Number" + , "type GLenum = Int" + , "type GLfloat = Number" + , "type GLint = Int" + , "type GLintptr = Int" + , "type GLshort = Int" + , "type GLsizei = Int" + , "type GLsizeiptr = Int" + , "type GLubyte = Int" + , "type GLuint = Int" + , "type GLushort = Int" + ] + +contextAttrs :: Doc +contextAttrs = vcat + [ "type WebGLContextAttributes =" + , " { alpha :: Boolean" + , " , depth :: Boolean" + , " , stencil :: Boolean" + , " , antialias :: Boolean" + , " , premultipliedAlpha :: Boolean" + , " , preserveDrawingBuffer :: Boolean" + , " , preferLowPowerToHighPerformance :: Boolean" + , " , failIfMajorPerformanceCaveat :: Boolean" + , " }" + ] + +-- javascript pretty-printers + +ppJsFunc :: Decl -> Doc +ppJsFunc f = + expName <+> "=" <+> func <+> parens (ppJsArgs funcArgs f) <+> "{" $+$ + nest 2 (ret <+> func <+> "() {") $+$ + nest 4 (ret <+> ppJsFuncInner f) $+$ + nest 2 "};" $+$ + "}" $+$ + blank + where + expName = "exports." <> implName f + func = "function" + ret = "return" + +ppJsFuncInner :: Decl -> Doc +ppJsFuncInner f@Function{} = + prefixWebgl <> text (actualName f) <> parens (ppJsArgs methodArgs f) <> ";" + +ppJsArgs :: (Decl -> [Arg]) -> Decl -> Doc +ppJsArgs f = hcat . punctuate ", " . map (text . argName) . f + +-- purescript raw module pretty-printers + +ppExportList :: [Decl] -> Doc +ppExportList = vcat . addOpener . prePunct (", ") . map (text . methodName) + where + addOpener (x:xs) = "(" <+> x : xs + addOpener xs = xs + +ppImport :: Decl -> Doc +ppImport f@Function{} = + ppImpl f $+$ blank $+$ + ppFunc f $+$ blank + +ppConvertType :: Type -> Doc +ppConvertType Concrete{ typeName = name, typeIsArray = isArray } + | name == "void" = toType "Unit" + | name == "boolean" = toType "Boolean" + | name == "ArrayBuffer" = toType "Float32Array" + | name == "long" = toType "Int" + | otherwise = toType name + where + toType = wrapArray . text + wrapArray t = if isArray + then parens $ "Array" <+> t + else t +ppConvertType _ = genericType + +ppSigForall :: Decl -> Doc +ppSigForall Function{ methodRetType = ret } = + case ret of + Generic -> ":: forall eff" <+> genericType <> "." + _ -> ":: forall eff." + +-- purescript impl pretty-printers + +ppImpl :: Decl -> Doc +ppImpl f@Function{} = "foreign import" <+> implName f <+> ppImplTypeSig f + +ppImplTypeSig :: Decl -> Doc +ppImplTypeSig f@Function{} = + ppSigForall f <+> funcType <+> argList <+> parens (ppImplReturnType f) + where + args = funcArgs f + funcType = "Fn" <> int (length args) + argList = hcat . punctuate " " $ map (ppConvertType . argType) args + +ppImplReturnType :: Decl -> Doc +ppImplReturnType fn = effMonad <+> ppConvertType (methodRetType fn) + +-- purescript function pretty-printers + +ppFunc :: Decl -> Doc +ppFunc f@Function{} = ppFuncTypeSig f $+$ ppFuncDef f + +ppFuncTypeSig :: Decl -> Doc +ppFuncTypeSig f@Function{ methodName = name } = + text name <+> ppSigForall f <+> argList + where + types = map (ppConvertType . argType) (funcArgs f) ++ [ppFuncReturnType f] + argList = hcat $ punctuate " -> " types + +ppFuncDef :: Decl -> Doc +ppFuncDef f@Function { methodName = name, methodRetType = retType } = + text name <+> args <+> "=" <+> + "runFn" <> int (length $ funcArgs f) <+> + implName f <+> args <+> + safetyFn retType + where + args = ppFuncArgs f + +ppFuncArgs :: Decl -> Doc +ppFuncArgs = hcat . punctuate " " . map argNames . funcArgs + where + argNames = text . filterReserved . argName + +ppFuncReturnType :: Decl -> Doc +ppFuncReturnType fn = effMonad <+> ppConvertMaybeType (methodRetType fn) + +ppConvertMaybeType :: Type -> Doc +ppConvertMaybeType t = wrapMaybe $ ppConvertType t + where + wrapMaybe name = if typeIsMaybe t then parens ("Maybe" <+> name) else name + +-- purecript enum pretty-printers + +ppConstant :: Decl -> Doc +ppConstant Enum { enumName = n, enumValue = v } = + constName <+> ":: GLenum" $$ + constName <+> "=" <+> (integer v) $$ + blank + where + constName = toCamelCase n + +-- purescript typedef pretty-printers + +ppTypeDecl :: Type -> Doc +ppTypeDecl Concrete{ typeName = name } = + "foreign import data" <+> text name <+> ":: *" +ppTypeDecl _ = empty + +-- helpers + +blank :: Doc +blank = "" + +effMonad :: Doc +effMonad = "Eff (canvas :: Canvas | eff)" + +genericType :: Doc +genericType = char 'a' + +implName :: Decl -> Doc +implName f@Function{} = text (methodName f) <> "Impl" + +prefixWebgl :: Doc +prefixWebgl = text (argName webglContext) <> "." + +prePunct :: Doc -> [Doc] -> [Doc] +prePunct p (x:x':xs) = x : go x' xs + where + go y [] = [p <> y] + go y (z:zs) = (p <> y) : go z zs +prePunct _ xs = xs + +toCamelCase :: String -> Doc +toCamelCase = text . foldr go "" + where + go '_' (l:ls) = toUpper l : ls + go l ls = toLower l : ls + +safetyFn :: Type -> Doc +safetyFn t@Concrete{} + | typeIsMaybe t = ">>= toMaybe >>> return" + | typeIsArray t = ">>= nullAsEmpty >>> return" + | otherwise = empty +safetyFn t@Generic = ">>= toMaybe >>> return" + +filterReserved :: String -> String +filterReserved s = case s of + "data" -> "data'" + "where" -> "where'" + "type" -> "type'" + ok -> ok diff --git a/generator/Main.hs b/generator/Main.hs new file mode 100644 index 0000000..1a39da7 --- /dev/null +++ b/generator/Main.hs @@ -0,0 +1,38 @@ +module Main (main) where + +import IDL.Parser (parseDecls) +import IDL.Cleaner (declsToIdl) +import IDL.Printer (typesFFI, enumsFFI, exportsFFI, importsFFI) +import System.Environment (getArgs) +import System.Exit (exitSuccess) +import System.IO (writeFile) +import Debug.Trace (trace) +import Text.PrettyPrint (render) + +import qualified Text.Parsec as PP (runParser) +import qualified Text.Parsec.Error as PP + +import IDL.AST + +noIdlError :: String +noIdlError = "WebGL generator requires input IDL file" + +main :: IO () +main = getArgs >>= getFilepath >>= readFile >>= runParser + +getFilepath :: [String] -> IO String +getFilepath (fp:_) = return fp +getFilepath _ = putStrLn noIdlError >> exitSuccess + +runParser :: String -> IO () +runParser body = + case PP.runParser parseDecls () "" body of + Left err -> mapM_ (putStrLn . PP.messageString) (PP.errorMessages err) + Right decls -> printFiles $ declsToIdl decls + +printFiles :: IDL -> IO () +printFiles idl = do + writeFile "src/Graphics/WebGL/Raw/Types.purs" . render $ typesFFI idl + writeFile "src/Graphics/WebGL/Raw/Enums.purs" . render $ enumsFFI idl + writeFile "src/Graphics/WebGL/Raw.js" . render $ exportsFFI idl + writeFile "src/Graphics/WebGL/Raw.purs" . render $ importsFFI idl diff --git a/purescript-webgl-generator.cabal b/purescript-webgl-generator.cabal deleted file mode 100644 index 05ca294..0000000 --- a/purescript-webgl-generator.cabal +++ /dev/null @@ -1,21 +0,0 @@ -name: purescript-webgl-generator -version: 0.1.0.0 -cabal-version: >=1.10 -build-type: Simple -license: GPL-2 -license-file: LICENSE -maintainer: jnf@arcor.de -category: Development -author: Jürgen (Jutaro) Nicklisch-Franken -data-dir: "" - -executable purescript-webgl-generator - build-depends: transformers >=0.4.2.0 && <0.5, - parsec >=3.1.7 && <3.2, base >=4.7 && <4.8, pretty >=1.1.1 - main-is: Main.hs - buildable: True - default-language: Haskell2010 - hs-source-dirs: src - other-modules: IDL.AST IDL.Parser IDL.Printer - - \ No newline at end of file diff --git a/purescript-webgl-raw.cabal b/purescript-webgl-raw.cabal new file mode 100644 index 0000000..772478e --- /dev/null +++ b/purescript-webgl-raw.cabal @@ -0,0 +1,23 @@ +name: purescript-webgl-raw +version: 0.3.0 +cabal-version: >= 1.10 +build-type: Simple +license: GPL-2 +license-file: LICENSE +maintainer: jon@childr.es (originally jnf@arcor.de) +category: Development +author: Jon Childress (branched from Jürgen (Jutaro) Nicklisch-Franken) +synopsis: generates PureScript by parsing the Khronos WebGL specification + +executable purescript-webgl-raw + main-is: Main.hs + buildable: True + default-language: Haskell2010 + hs-source-dirs: generator + other-modules: IDL.AST IDL.Parser IDL.Printer + + build-depends: base == 4.*, + containers == 0.5.*, + parsec == 3.1.*, + pretty == 1.1.*, + transformers == 0.4.* diff --git a/src/Graphics/WebGL/Raw.js b/src/Graphics/WebGL/Raw.js new file mode 100644 index 0000000..f5a6fcf --- /dev/null +++ b/src/Graphics/WebGL/Raw.js @@ -0,0 +1,928 @@ +"use strict"; + +// module Graphics.WebGL.Raw + +exports.activeTextureImpl = function (webgl, texture) { + return function () { + return webgl.activeTexture(texture); + }; +} + +exports.attachShaderImpl = function (webgl, program, shader) { + return function () { + return webgl.attachShader(program, shader); + }; +} + +exports.bindAttribLocationImpl = function (webgl, program, index, name) { + return function () { + return webgl.bindAttribLocation(program, index, name); + }; +} + +exports.bindBufferImpl = function (webgl, target, buffer) { + return function () { + return webgl.bindBuffer(target, buffer); + }; +} + +exports.bindFramebufferImpl = function (webgl, target, framebuffer) { + return function () { + return webgl.bindFramebuffer(target, framebuffer); + }; +} + +exports.bindRenderbufferImpl = function (webgl, target, renderbuffer) { + return function () { + return webgl.bindRenderbuffer(target, renderbuffer); + }; +} + +exports.bindTextureImpl = function (webgl, target, texture) { + return function () { + return webgl.bindTexture(target, texture); + }; +} + +exports.blendColorImpl = function (webgl, red, green, blue, alpha) { + return function () { + return webgl.blendColor(red, green, blue, alpha); + }; +} + +exports.blendEquationImpl = function (webgl, mode) { + return function () { + return webgl.blendEquation(mode); + }; +} + +exports.blendEquationSeparateImpl = function (webgl, modeRGB, modeAlpha) { + return function () { + return webgl.blendEquationSeparate(modeRGB, modeAlpha); + }; +} + +exports.blendFuncImpl = function (webgl, sfactor, dfactor) { + return function () { + return webgl.blendFunc(sfactor, dfactor); + }; +} + +exports.blendFuncSeparateImpl = function (webgl, srcRGB, dstRGB, srcAlpha, dstAlpha) { + return function () { + return webgl.blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); + }; +} + +exports.bufferDataImpl = function (webgl, target, data, usage) { + return function () { + return webgl.bufferData(target, data, usage); + }; +} + +exports.bufferData_Impl = function (webgl, target, size, usage) { + return function () { + return webgl.bufferData(target, size, usage); + }; +} + +exports.bufferSubDataImpl = function (webgl, target, offset, data) { + return function () { + return webgl.bufferSubData(target, offset, data); + }; +} + +exports.checkFramebufferStatusImpl = function (webgl, target) { + return function () { + return webgl.checkFramebufferStatus(target); + }; +} + +exports.clearImpl = function (webgl, mask) { + return function () { + return webgl.clear(mask); + }; +} + +exports.clearColorImpl = function (webgl, red, green, blue, alpha) { + return function () { + return webgl.clearColor(red, green, blue, alpha); + }; +} + +exports.clearDepthImpl = function (webgl, depth) { + return function () { + return webgl.clearDepth(depth); + }; +} + +exports.clearStencilImpl = function (webgl, s) { + return function () { + return webgl.clearStencil(s); + }; +} + +exports.colorMaskImpl = function (webgl, red, green, blue, alpha) { + return function () { + return webgl.colorMask(red, green, blue, alpha); + }; +} + +exports.compileShaderImpl = function (webgl, shader) { + return function () { + return webgl.compileShader(shader); + }; +} + +exports.compressedTexImage2DImpl = function (webgl, target, level, internalformat, width, height, border, data) { + return function () { + return webgl.compressedTexImage2D(target, level, internalformat, width, height, border, data); + }; +} + +exports.compressedTexSubImage2DImpl = function (webgl, target, level, xoffset, yoffset, width, height, format, data) { + return function () { + return webgl.compressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data); + }; +} + +exports.copyTexImage2DImpl = function (webgl, target, level, internalformat, x, y, width, height, border) { + return function () { + return webgl.copyTexImage2D(target, level, internalformat, x, y, width, height, border); + }; +} + +exports.copyTexSubImage2DImpl = function (webgl, target, level, xoffset, yoffset, x, y, width, height) { + return function () { + return webgl.copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); + }; +} + +exports.createBufferImpl = function (webgl) { + return function () { + return webgl.createBuffer(); + }; +} + +exports.createFramebufferImpl = function (webgl) { + return function () { + return webgl.createFramebuffer(); + }; +} + +exports.createProgramImpl = function (webgl) { + return function () { + return webgl.createProgram(); + }; +} + +exports.createRenderbufferImpl = function (webgl) { + return function () { + return webgl.createRenderbuffer(); + }; +} + +exports.createShaderImpl = function (webgl, type) { + return function () { + return webgl.createShader(type); + }; +} + +exports.createTextureImpl = function (webgl) { + return function () { + return webgl.createTexture(); + }; +} + +exports.cullFaceImpl = function (webgl, mode) { + return function () { + return webgl.cullFace(mode); + }; +} + +exports.deleteBufferImpl = function (webgl, buffer) { + return function () { + return webgl.deleteBuffer(buffer); + }; +} + +exports.deleteFramebufferImpl = function (webgl, framebuffer) { + return function () { + return webgl.deleteFramebuffer(framebuffer); + }; +} + +exports.deleteProgramImpl = function (webgl, program) { + return function () { + return webgl.deleteProgram(program); + }; +} + +exports.deleteRenderbufferImpl = function (webgl, renderbuffer) { + return function () { + return webgl.deleteRenderbuffer(renderbuffer); + }; +} + +exports.deleteShaderImpl = function (webgl, shader) { + return function () { + return webgl.deleteShader(shader); + }; +} + +exports.deleteTextureImpl = function (webgl, texture) { + return function () { + return webgl.deleteTexture(texture); + }; +} + +exports.depthFuncImpl = function (webgl, func) { + return function () { + return webgl.depthFunc(func); + }; +} + +exports.depthMaskImpl = function (webgl, flag) { + return function () { + return webgl.depthMask(flag); + }; +} + +exports.depthRangeImpl = function (webgl, zNear, zFar) { + return function () { + return webgl.depthRange(zNear, zFar); + }; +} + +exports.detachShaderImpl = function (webgl, program, shader) { + return function () { + return webgl.detachShader(program, shader); + }; +} + +exports.disableImpl = function (webgl, cap) { + return function () { + return webgl.disable(cap); + }; +} + +exports.disableVertexAttribArrayImpl = function (webgl, index) { + return function () { + return webgl.disableVertexAttribArray(index); + }; +} + +exports.drawArraysImpl = function (webgl, mode, first, count) { + return function () { + return webgl.drawArrays(mode, first, count); + }; +} + +exports.drawElementsImpl = function (webgl, mode, count, type, offset) { + return function () { + return webgl.drawElements(mode, count, type, offset); + }; +} + +exports.enableImpl = function (webgl, cap) { + return function () { + return webgl.enable(cap); + }; +} + +exports.enableVertexAttribArrayImpl = function (webgl, index) { + return function () { + return webgl.enableVertexAttribArray(index); + }; +} + +exports.finishImpl = function (webgl) { + return function () { + return webgl.finish(); + }; +} + +exports.flushImpl = function (webgl) { + return function () { + return webgl.flush(); + }; +} + +exports.framebufferRenderbufferImpl = function (webgl, target, attachment, renderbuffertarget, renderbuffer) { + return function () { + return webgl.framebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); + }; +} + +exports.framebufferTexture2DImpl = function (webgl, target, attachment, textarget, texture, level) { + return function () { + return webgl.framebufferTexture2D(target, attachment, textarget, texture, level); + }; +} + +exports.frontFaceImpl = function (webgl, mode) { + return function () { + return webgl.frontFace(mode); + }; +} + +exports.generateMipmapImpl = function (webgl, target) { + return function () { + return webgl.generateMipmap(target); + }; +} + +exports.getActiveAttribImpl = function (webgl, program, index) { + return function () { + return webgl.getActiveAttrib(program, index); + }; +} + +exports.getActiveUniformImpl = function (webgl, program, index) { + return function () { + return webgl.getActiveUniform(program, index); + }; +} + +exports.getAttachedShadersImpl = function (webgl, program) { + return function () { + return webgl.getAttachedShaders(program); + }; +} + +exports.getAttribLocationImpl = function (webgl, program, name) { + return function () { + return webgl.getAttribLocation(program, name); + }; +} + +exports.getBufferParameterImpl = function (webgl, target, pname) { + return function () { + return webgl.getBufferParameter(target, pname); + }; +} + +exports.getContextAttributesImpl = function (webgl) { + return function () { + return webgl.getContextAttributes(); + }; +} + +exports.getErrorImpl = function (webgl) { + return function () { + return webgl.getError(); + }; +} + +exports.getExtensionImpl = function (webgl, name) { + return function () { + return webgl.getExtension(name); + }; +} + +exports.getFramebufferAttachmentParameterImpl = function (webgl, target, attachment, pname) { + return function () { + return webgl.getFramebufferAttachmentParameter(target, attachment, pname); + }; +} + +exports.getParameterImpl = function (webgl, pname) { + return function () { + return webgl.getParameter(pname); + }; +} + +exports.getProgramInfoLogImpl = function (webgl, program) { + return function () { + return webgl.getProgramInfoLog(program); + }; +} + +exports.getProgramParameterImpl = function (webgl, program, pname) { + return function () { + return webgl.getProgramParameter(program, pname); + }; +} + +exports.getRenderbufferParameterImpl = function (webgl, target, pname) { + return function () { + return webgl.getRenderbufferParameter(target, pname); + }; +} + +exports.getShaderInfoLogImpl = function (webgl, shader) { + return function () { + return webgl.getShaderInfoLog(shader); + }; +} + +exports.getShaderParameterImpl = function (webgl, shader, pname) { + return function () { + return webgl.getShaderParameter(shader, pname); + }; +} + +exports.getShaderPrecisionFormatImpl = function (webgl, shadertype, precisiontype) { + return function () { + return webgl.getShaderPrecisionFormat(shadertype, precisiontype); + }; +} + +exports.getShaderSourceImpl = function (webgl, shader) { + return function () { + return webgl.getShaderSource(shader); + }; +} + +exports.getSupportedExtensionsImpl = function (webgl) { + return function () { + return webgl.getSupportedExtensions(); + }; +} + +exports.getTexParameterImpl = function (webgl, target, pname) { + return function () { + return webgl.getTexParameter(target, pname); + }; +} + +exports.getUniformImpl = function (webgl, program, location) { + return function () { + return webgl.getUniform(program, location); + }; +} + +exports.getUniformLocationImpl = function (webgl, program, name) { + return function () { + return webgl.getUniformLocation(program, name); + }; +} + +exports.getVertexAttribImpl = function (webgl, index, pname) { + return function () { + return webgl.getVertexAttrib(index, pname); + }; +} + +exports.getVertexAttribOffsetImpl = function (webgl, index, pname) { + return function () { + return webgl.getVertexAttribOffset(index, pname); + }; +} + +exports.hintImpl = function (webgl, target, mode) { + return function () { + return webgl.hint(target, mode); + }; +} + +exports.isBufferImpl = function (webgl, buffer) { + return function () { + return webgl.isBuffer(buffer); + }; +} + +exports.isContextLostImpl = function (webgl) { + return function () { + return webgl.isContextLost(); + }; +} + +exports.isEnabledImpl = function (webgl, cap) { + return function () { + return webgl.isEnabled(cap); + }; +} + +exports.isFramebufferImpl = function (webgl, framebuffer) { + return function () { + return webgl.isFramebuffer(framebuffer); + }; +} + +exports.isProgramImpl = function (webgl, program) { + return function () { + return webgl.isProgram(program); + }; +} + +exports.isRenderbufferImpl = function (webgl, renderbuffer) { + return function () { + return webgl.isRenderbuffer(renderbuffer); + }; +} + +exports.isShaderImpl = function (webgl, shader) { + return function () { + return webgl.isShader(shader); + }; +} + +exports.isTextureImpl = function (webgl, texture) { + return function () { + return webgl.isTexture(texture); + }; +} + +exports.lineWidthImpl = function (webgl, width) { + return function () { + return webgl.lineWidth(width); + }; +} + +exports.linkProgramImpl = function (webgl, program) { + return function () { + return webgl.linkProgram(program); + }; +} + +exports.pixelStoreiImpl = function (webgl, pname, param) { + return function () { + return webgl.pixelStorei(pname, param); + }; +} + +exports.polygonOffsetImpl = function (webgl, factor, units) { + return function () { + return webgl.polygonOffset(factor, units); + }; +} + +exports.readPixelsImpl = function (webgl, x, y, width, height, format, type, pixels) { + return function () { + return webgl.readPixels(x, y, width, height, format, type, pixels); + }; +} + +exports.renderbufferStorageImpl = function (webgl, target, internalformat, width, height) { + return function () { + return webgl.renderbufferStorage(target, internalformat, width, height); + }; +} + +exports.sampleCoverageImpl = function (webgl, value, invert) { + return function () { + return webgl.sampleCoverage(value, invert); + }; +} + +exports.scissorImpl = function (webgl, x, y, width, height) { + return function () { + return webgl.scissor(x, y, width, height); + }; +} + +exports.shaderSourceImpl = function (webgl, shader, source) { + return function () { + return webgl.shaderSource(shader, source); + }; +} + +exports.stencilFuncImpl = function (webgl, func, ref, mask) { + return function () { + return webgl.stencilFunc(func, ref, mask); + }; +} + +exports.stencilFuncSeparateImpl = function (webgl, face, func, ref, mask) { + return function () { + return webgl.stencilFuncSeparate(face, func, ref, mask); + }; +} + +exports.stencilMaskImpl = function (webgl, mask) { + return function () { + return webgl.stencilMask(mask); + }; +} + +exports.stencilMaskSeparateImpl = function (webgl, face, mask) { + return function () { + return webgl.stencilMaskSeparate(face, mask); + }; +} + +exports.stencilOpImpl = function (webgl, fail, zfail, zpass) { + return function () { + return webgl.stencilOp(fail, zfail, zpass); + }; +} + +exports.stencilOpSeparateImpl = function (webgl, face, fail, zfail, zpass) { + return function () { + return webgl.stencilOpSeparate(face, fail, zfail, zpass); + }; +} + +exports.texImage2DImpl = function (webgl, target, level, internalformat, format, type, source) { + return function () { + return webgl.texImage2D(target, level, internalformat, format, type, source); + }; +} + +exports.texImage2D_Impl = function (webgl, target, level, internalformat, width, height, border, format, type, pixels) { + return function () { + return webgl.texImage2D(target, level, internalformat, width, height, border, format, type, pixels); + }; +} + +exports.texParameterfImpl = function (webgl, target, pname, param) { + return function () { + return webgl.texParameterf(target, pname, param); + }; +} + +exports.texParameteriImpl = function (webgl, target, pname, param) { + return function () { + return webgl.texParameteri(target, pname, param); + }; +} + +exports.texSubImage2DImpl = function (webgl, target, level, xoffset, yoffset, format, type, source) { + return function () { + return webgl.texSubImage2D(target, level, xoffset, yoffset, format, type, source); + }; +} + +exports.texSubImage2D_Impl = function (webgl, target, level, xoffset, yoffset, width, height, format, type, pixels) { + return function () { + return webgl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + }; +} + +exports.uniform1fImpl = function (webgl, location, x) { + return function () { + return webgl.uniform1f(location, x); + }; +} + +exports.uniform1fvImpl = function (webgl, location, v) { + return function () { + return webgl.uniform1fv(location, v); + }; +} + +exports.uniform1fv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform1fv(location, v); + }; +} + +exports.uniform1iImpl = function (webgl, location, x) { + return function () { + return webgl.uniform1i(location, x); + }; +} + +exports.uniform1ivImpl = function (webgl, location, v) { + return function () { + return webgl.uniform1iv(location, v); + }; +} + +exports.uniform1iv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform1iv(location, v); + }; +} + +exports.uniform2fImpl = function (webgl, location, x, y) { + return function () { + return webgl.uniform2f(location, x, y); + }; +} + +exports.uniform2fvImpl = function (webgl, location, v) { + return function () { + return webgl.uniform2fv(location, v); + }; +} + +exports.uniform2fv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform2fv(location, v); + }; +} + +exports.uniform2iImpl = function (webgl, location, x, y) { + return function () { + return webgl.uniform2i(location, x, y); + }; +} + +exports.uniform2ivImpl = function (webgl, location, v) { + return function () { + return webgl.uniform2iv(location, v); + }; +} + +exports.uniform2iv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform2iv(location, v); + }; +} + +exports.uniform3fImpl = function (webgl, location, x, y, z) { + return function () { + return webgl.uniform3f(location, x, y, z); + }; +} + +exports.uniform3fvImpl = function (webgl, location, v) { + return function () { + return webgl.uniform3fv(location, v); + }; +} + +exports.uniform3fv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform3fv(location, v); + }; +} + +exports.uniform3iImpl = function (webgl, location, x, y, z) { + return function () { + return webgl.uniform3i(location, x, y, z); + }; +} + +exports.uniform3ivImpl = function (webgl, location, v) { + return function () { + return webgl.uniform3iv(location, v); + }; +} + +exports.uniform3iv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform3iv(location, v); + }; +} + +exports.uniform4fImpl = function (webgl, location, x, y, z, w) { + return function () { + return webgl.uniform4f(location, x, y, z, w); + }; +} + +exports.uniform4fvImpl = function (webgl, location, v) { + return function () { + return webgl.uniform4fv(location, v); + }; +} + +exports.uniform4fv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform4fv(location, v); + }; +} + +exports.uniform4iImpl = function (webgl, location, x, y, z, w) { + return function () { + return webgl.uniform4i(location, x, y, z, w); + }; +} + +exports.uniform4ivImpl = function (webgl, location, v) { + return function () { + return webgl.uniform4iv(location, v); + }; +} + +exports.uniform4iv_Impl = function (webgl, location, v) { + return function () { + return webgl.uniform4iv(location, v); + }; +} + +exports.uniformMatrix2fvImpl = function (webgl, location, transpose, value) { + return function () { + return webgl.uniformMatrix2fv(location, transpose, value); + }; +} + +exports.uniformMatrix2fv_Impl = function (webgl, location, transpose, value) { + return function () { + return webgl.uniformMatrix2fv(location, transpose, value); + }; +} + +exports.uniformMatrix3fvImpl = function (webgl, location, transpose, value) { + return function () { + return webgl.uniformMatrix3fv(location, transpose, value); + }; +} + +exports.uniformMatrix3fv_Impl = function (webgl, location, transpose, value) { + return function () { + return webgl.uniformMatrix3fv(location, transpose, value); + }; +} + +exports.uniformMatrix4fvImpl = function (webgl, location, transpose, value) { + return function () { + return webgl.uniformMatrix4fv(location, transpose, value); + }; +} + +exports.uniformMatrix4fv_Impl = function (webgl, location, transpose, value) { + return function () { + return webgl.uniformMatrix4fv(location, transpose, value); + }; +} + +exports.useProgramImpl = function (webgl, program) { + return function () { + return webgl.useProgram(program); + }; +} + +exports.validateProgramImpl = function (webgl, program) { + return function () { + return webgl.validateProgram(program); + }; +} + +exports.vertexAttrib1fImpl = function (webgl, indx, x) { + return function () { + return webgl.vertexAttrib1f(indx, x); + }; +} + +exports.vertexAttrib1fvImpl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib1fv(indx, values); + }; +} + +exports.vertexAttrib1fv_Impl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib1fv(indx, values); + }; +} + +exports.vertexAttrib2fImpl = function (webgl, indx, x, y) { + return function () { + return webgl.vertexAttrib2f(indx, x, y); + }; +} + +exports.vertexAttrib2fvImpl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib2fv(indx, values); + }; +} + +exports.vertexAttrib2fv_Impl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib2fv(indx, values); + }; +} + +exports.vertexAttrib3fImpl = function (webgl, indx, x, y, z) { + return function () { + return webgl.vertexAttrib3f(indx, x, y, z); + }; +} + +exports.vertexAttrib3fvImpl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib3fv(indx, values); + }; +} + +exports.vertexAttrib3fv_Impl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib3fv(indx, values); + }; +} + +exports.vertexAttrib4fImpl = function (webgl, indx, x, y, z, w) { + return function () { + return webgl.vertexAttrib4f(indx, x, y, z, w); + }; +} + +exports.vertexAttrib4fvImpl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib4fv(indx, values); + }; +} + +exports.vertexAttrib4fv_Impl = function (webgl, indx, values) { + return function () { + return webgl.vertexAttrib4fv(indx, values); + }; +} + +exports.vertexAttribPointerImpl = function (webgl, indx, size, type, normalized, stride, offset) { + return function () { + return webgl.vertexAttribPointer(indx, size, type, normalized, stride, offset); + }; +} + +exports.viewportImpl = function (webgl, x, y, width, height) { + return function () { + return webgl.viewport(x, y, width, height); + }; +} + diff --git a/src/Graphics/WebGL/Raw.purs b/src/Graphics/WebGL/Raw.purs new file mode 100644 index 0000000..52e15e8 --- /dev/null +++ b/src/Graphics/WebGL/Raw.purs @@ -0,0 +1,936 @@ +module Graphics.WebGL.Raw +( activeTexture +, attachShader +, bindAttribLocation +, bindBuffer +, bindFramebuffer +, bindRenderbuffer +, bindTexture +, blendColor +, blendEquation +, blendEquationSeparate +, blendFunc +, blendFuncSeparate +, bufferData +, bufferData_ +, bufferSubData +, checkFramebufferStatus +, clear +, clearColor +, clearDepth +, clearStencil +, colorMask +, compileShader +, compressedTexImage2D +, compressedTexSubImage2D +, copyTexImage2D +, copyTexSubImage2D +, createBuffer +, createFramebuffer +, createProgram +, createRenderbuffer +, createShader +, createTexture +, cullFace +, deleteBuffer +, deleteFramebuffer +, deleteProgram +, deleteRenderbuffer +, deleteShader +, deleteTexture +, depthFunc +, depthMask +, depthRange +, detachShader +, disable +, disableVertexAttribArray +, drawArrays +, drawElements +, enable +, enableVertexAttribArray +, finish +, flush +, framebufferRenderbuffer +, framebufferTexture2D +, frontFace +, generateMipmap +, getActiveAttrib +, getActiveUniform +, getAttachedShaders +, getAttribLocation +, getBufferParameter +, getContextAttributes +, getError +, getExtension +, getFramebufferAttachmentParameter +, getParameter +, getProgramInfoLog +, getProgramParameter +, getRenderbufferParameter +, getShaderInfoLog +, getShaderParameter +, getShaderPrecisionFormat +, getShaderSource +, getSupportedExtensions +, getTexParameter +, getUniform +, getUniformLocation +, getVertexAttrib +, getVertexAttribOffset +, hint +, isBuffer +, isContextLost +, isEnabled +, isFramebuffer +, isProgram +, isRenderbuffer +, isShader +, isTexture +, lineWidth +, linkProgram +, pixelStorei +, polygonOffset +, readPixels +, renderbufferStorage +, sampleCoverage +, scissor +, shaderSource +, stencilFunc +, stencilFuncSeparate +, stencilMask +, stencilMaskSeparate +, stencilOp +, stencilOpSeparate +, texImage2D +, texImage2D_ +, texParameterf +, texParameteri +, texSubImage2D +, texSubImage2D_ +, uniform1f +, uniform1fv +, uniform1fv_ +, uniform1i +, uniform1iv +, uniform1iv_ +, uniform2f +, uniform2fv +, uniform2fv_ +, uniform2i +, uniform2iv +, uniform2iv_ +, uniform3f +, uniform3fv +, uniform3fv_ +, uniform3i +, uniform3iv +, uniform3iv_ +, uniform4f +, uniform4fv +, uniform4fv_ +, uniform4i +, uniform4iv +, uniform4iv_ +, uniformMatrix2fv +, uniformMatrix2fv_ +, uniformMatrix3fv +, uniformMatrix3fv_ +, uniformMatrix4fv +, uniformMatrix4fv_ +, useProgram +, validateProgram +, vertexAttrib1f +, vertexAttrib1fv +, vertexAttrib1fv_ +, vertexAttrib2f +, vertexAttrib2fv +, vertexAttrib2fv_ +, vertexAttrib3f +, vertexAttrib3fv +, vertexAttrib3fv_ +, vertexAttrib4f +, vertexAttrib4fv +, vertexAttrib4fv_ +, vertexAttribPointer +, viewport +) where + +import Control.Monad.Eff +import Data.ArrayBuffer.Types +import Data.Function +import Data.Maybe +import Graphics.Canvas +import Graphics.WebGL.Raw.Types +import Graphics.WebGL.Raw.Util +import Prelude + +foreign import activeTextureImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +activeTexture :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +activeTexture webgl texture = runFn2 activeTextureImpl webgl texture + +foreign import attachShaderImpl :: forall eff. Fn3 WebGLContext WebGLProgram WebGLShader (Eff (canvas :: Canvas | eff) Unit) + +attachShader :: forall eff. WebGLContext -> WebGLProgram -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +attachShader webgl program shader = runFn3 attachShaderImpl webgl program shader + +foreign import bindAttribLocationImpl :: forall eff. Fn4 WebGLContext WebGLProgram GLuint DOMString (Eff (canvas :: Canvas | eff) Unit) + +bindAttribLocation :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> DOMString -> Eff (canvas :: Canvas | eff) Unit +bindAttribLocation webgl program index name = runFn4 bindAttribLocationImpl webgl program index name + +foreign import bindBufferImpl :: forall eff. Fn3 WebGLContext GLenum WebGLBuffer (Eff (canvas :: Canvas | eff) Unit) + +bindBuffer :: forall eff. WebGLContext -> GLenum -> WebGLBuffer -> Eff (canvas :: Canvas | eff) Unit +bindBuffer webgl target buffer = runFn3 bindBufferImpl webgl target buffer + +foreign import bindFramebufferImpl :: forall eff. Fn3 WebGLContext GLenum WebGLFramebuffer (Eff (canvas :: Canvas | eff) Unit) + +bindFramebuffer :: forall eff. WebGLContext -> GLenum -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) Unit +bindFramebuffer webgl target framebuffer = runFn3 bindFramebufferImpl webgl target framebuffer + +foreign import bindRenderbufferImpl :: forall eff. Fn3 WebGLContext GLenum WebGLRenderbuffer (Eff (canvas :: Canvas | eff) Unit) + +bindRenderbuffer :: forall eff. WebGLContext -> GLenum -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +bindRenderbuffer webgl target renderbuffer = runFn3 bindRenderbufferImpl webgl target renderbuffer + +foreign import bindTextureImpl :: forall eff. Fn3 WebGLContext GLenum WebGLTexture (Eff (canvas :: Canvas | eff) Unit) + +bindTexture :: forall eff. WebGLContext -> GLenum -> WebGLTexture -> Eff (canvas :: Canvas | eff) Unit +bindTexture webgl target texture = runFn3 bindTextureImpl webgl target texture + +foreign import blendColorImpl :: forall eff. Fn5 WebGLContext GLclampf GLclampf GLclampf GLclampf (Eff (canvas :: Canvas | eff) Unit) + +blendColor :: forall eff. WebGLContext -> GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +blendColor webgl red green blue alpha = runFn5 blendColorImpl webgl red green blue alpha + +foreign import blendEquationImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +blendEquation :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +blendEquation webgl mode = runFn2 blendEquationImpl webgl mode + +foreign import blendEquationSeparateImpl :: forall eff. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) Unit) + +blendEquationSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +blendEquationSeparate webgl modeRGB modeAlpha = runFn3 blendEquationSeparateImpl webgl modeRGB modeAlpha + +foreign import blendFuncImpl :: forall eff. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) Unit) + +blendFunc :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +blendFunc webgl sfactor dfactor = runFn3 blendFuncImpl webgl sfactor dfactor + +foreign import blendFuncSeparateImpl :: forall eff. Fn5 WebGLContext GLenum GLenum GLenum GLenum (Eff (canvas :: Canvas | eff) Unit) + +blendFuncSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +blendFuncSeparate webgl srcRGB dstRGB srcAlpha dstAlpha = runFn5 blendFuncSeparateImpl webgl srcRGB dstRGB srcAlpha dstAlpha + +foreign import bufferDataImpl :: forall eff. Fn4 WebGLContext GLenum BufferDataSource GLenum (Eff (canvas :: Canvas | eff) Unit) + +bufferData :: forall eff. WebGLContext -> GLenum -> BufferDataSource -> GLenum -> Eff (canvas :: Canvas | eff) Unit +bufferData webgl target data' usage = runFn4 bufferDataImpl webgl target data' usage + +foreign import bufferData_Impl :: forall eff. Fn4 WebGLContext GLenum GLsizeiptr GLenum (Eff (canvas :: Canvas | eff) Unit) + +bufferData_ :: forall eff. WebGLContext -> GLenum -> GLsizeiptr -> GLenum -> Eff (canvas :: Canvas | eff) Unit +bufferData_ webgl target size usage = runFn4 bufferData_Impl webgl target size usage + +foreign import bufferSubDataImpl :: forall eff. Fn4 WebGLContext GLenum GLintptr BufferDataSource (Eff (canvas :: Canvas | eff) Unit) + +bufferSubData :: forall eff. WebGLContext -> GLenum -> GLintptr -> BufferDataSource -> Eff (canvas :: Canvas | eff) Unit +bufferSubData webgl target offset data' = runFn4 bufferSubDataImpl webgl target offset data' + +foreign import checkFramebufferStatusImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) GLenum) + +checkFramebufferStatus :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) GLenum +checkFramebufferStatus webgl target = runFn2 checkFramebufferStatusImpl webgl target + +foreign import clearImpl :: forall eff. Fn2 WebGLContext GLbitfield (Eff (canvas :: Canvas | eff) Unit) + +clear :: forall eff. WebGLContext -> GLbitfield -> Eff (canvas :: Canvas | eff) Unit +clear webgl mask = runFn2 clearImpl webgl mask + +foreign import clearColorImpl :: forall eff. Fn5 WebGLContext GLclampf GLclampf GLclampf GLclampf (Eff (canvas :: Canvas | eff) Unit) + +clearColor :: forall eff. WebGLContext -> GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +clearColor webgl red green blue alpha = runFn5 clearColorImpl webgl red green blue alpha + +foreign import clearDepthImpl :: forall eff. Fn2 WebGLContext GLclampf (Eff (canvas :: Canvas | eff) Unit) + +clearDepth :: forall eff. WebGLContext -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +clearDepth webgl depth = runFn2 clearDepthImpl webgl depth + +foreign import clearStencilImpl :: forall eff. Fn2 WebGLContext GLint (Eff (canvas :: Canvas | eff) Unit) + +clearStencil :: forall eff. WebGLContext -> GLint -> Eff (canvas :: Canvas | eff) Unit +clearStencil webgl s = runFn2 clearStencilImpl webgl s + +foreign import colorMaskImpl :: forall eff. Fn5 WebGLContext GLboolean GLboolean GLboolean GLboolean (Eff (canvas :: Canvas | eff) Unit) + +colorMask :: forall eff. WebGLContext -> GLboolean -> GLboolean -> GLboolean -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +colorMask webgl red green blue alpha = runFn5 colorMaskImpl webgl red green blue alpha + +foreign import compileShaderImpl :: forall eff. Fn2 WebGLContext WebGLShader (Eff (canvas :: Canvas | eff) Unit) + +compileShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +compileShader webgl shader = runFn2 compileShaderImpl webgl shader + +foreign import compressedTexImage2DImpl :: forall eff. Fn8 WebGLContext GLenum GLint GLenum GLsizei GLsizei GLint ArrayBufferView (Eff (canvas :: Canvas | eff) Unit) + +compressedTexImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLsizei -> GLsizei -> GLint -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +compressedTexImage2D webgl target level internalformat width height border data' = runFn8 compressedTexImage2DImpl webgl target level internalformat width height border data' + +foreign import compressedTexSubImage2DImpl :: forall eff. Fn9 WebGLContext GLenum GLint GLint GLint GLsizei GLsizei GLenum ArrayBufferView (Eff (canvas :: Canvas | eff) Unit) + +compressedTexSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +compressedTexSubImage2D webgl target level xoffset yoffset width height format data' = runFn9 compressedTexSubImage2DImpl webgl target level xoffset yoffset width height format data' + +foreign import copyTexImage2DImpl :: forall eff. Fn9 WebGLContext GLenum GLint GLenum GLint GLint GLsizei GLsizei GLint (Eff (canvas :: Canvas | eff) Unit) + +copyTexImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLint -> GLint -> GLsizei -> GLsizei -> GLint -> Eff (canvas :: Canvas | eff) Unit +copyTexImage2D webgl target level internalformat x y width height border = runFn9 copyTexImage2DImpl webgl target level internalformat x y width height border + +foreign import copyTexSubImage2DImpl :: forall eff. Fn9 WebGLContext GLenum GLint GLint GLint GLint GLint GLsizei GLsizei (Eff (canvas :: Canvas | eff) Unit) + +copyTexSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +copyTexSubImage2D webgl target level xoffset yoffset x y width height = runFn9 copyTexSubImage2DImpl webgl target level xoffset yoffset x y width height + +foreign import createBufferImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) WebGLBuffer) + +createBuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLBuffer) +createBuffer webgl = runFn1 createBufferImpl webgl >>= toMaybe >>> return + +foreign import createFramebufferImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) WebGLFramebuffer) + +createFramebuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLFramebuffer) +createFramebuffer webgl = runFn1 createFramebufferImpl webgl >>= toMaybe >>> return + +foreign import createProgramImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) WebGLProgram) + +createProgram :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLProgram) +createProgram webgl = runFn1 createProgramImpl webgl >>= toMaybe >>> return + +foreign import createRenderbufferImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) WebGLRenderbuffer) + +createRenderbuffer :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLRenderbuffer) +createRenderbuffer webgl = runFn1 createRenderbufferImpl webgl >>= toMaybe >>> return + +foreign import createShaderImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) WebGLShader) + +createShader :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe WebGLShader) +createShader webgl type' = runFn2 createShaderImpl webgl type' >>= toMaybe >>> return + +foreign import createTextureImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) WebGLTexture) + +createTexture :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLTexture) +createTexture webgl = runFn1 createTextureImpl webgl >>= toMaybe >>> return + +foreign import cullFaceImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +cullFace :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +cullFace webgl mode = runFn2 cullFaceImpl webgl mode + +foreign import deleteBufferImpl :: forall eff. Fn2 WebGLContext WebGLBuffer (Eff (canvas :: Canvas | eff) Unit) + +deleteBuffer :: forall eff. WebGLContext -> WebGLBuffer -> Eff (canvas :: Canvas | eff) Unit +deleteBuffer webgl buffer = runFn2 deleteBufferImpl webgl buffer + +foreign import deleteFramebufferImpl :: forall eff. Fn2 WebGLContext WebGLFramebuffer (Eff (canvas :: Canvas | eff) Unit) + +deleteFramebuffer :: forall eff. WebGLContext -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) Unit +deleteFramebuffer webgl framebuffer = runFn2 deleteFramebufferImpl webgl framebuffer + +foreign import deleteProgramImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) Unit) + +deleteProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +deleteProgram webgl program = runFn2 deleteProgramImpl webgl program + +foreign import deleteRenderbufferImpl :: forall eff. Fn2 WebGLContext WebGLRenderbuffer (Eff (canvas :: Canvas | eff) Unit) + +deleteRenderbuffer :: forall eff. WebGLContext -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +deleteRenderbuffer webgl renderbuffer = runFn2 deleteRenderbufferImpl webgl renderbuffer + +foreign import deleteShaderImpl :: forall eff. Fn2 WebGLContext WebGLShader (Eff (canvas :: Canvas | eff) Unit) + +deleteShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +deleteShader webgl shader = runFn2 deleteShaderImpl webgl shader + +foreign import deleteTextureImpl :: forall eff. Fn2 WebGLContext WebGLTexture (Eff (canvas :: Canvas | eff) Unit) + +deleteTexture :: forall eff. WebGLContext -> WebGLTexture -> Eff (canvas :: Canvas | eff) Unit +deleteTexture webgl texture = runFn2 deleteTextureImpl webgl texture + +foreign import depthFuncImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +depthFunc :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +depthFunc webgl func = runFn2 depthFuncImpl webgl func + +foreign import depthMaskImpl :: forall eff. Fn2 WebGLContext GLboolean (Eff (canvas :: Canvas | eff) Unit) + +depthMask :: forall eff. WebGLContext -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +depthMask webgl flag = runFn2 depthMaskImpl webgl flag + +foreign import depthRangeImpl :: forall eff. Fn3 WebGLContext GLclampf GLclampf (Eff (canvas :: Canvas | eff) Unit) + +depthRange :: forall eff. WebGLContext -> GLclampf -> GLclampf -> Eff (canvas :: Canvas | eff) Unit +depthRange webgl zNear zFar = runFn3 depthRangeImpl webgl zNear zFar + +foreign import detachShaderImpl :: forall eff. Fn3 WebGLContext WebGLProgram WebGLShader (Eff (canvas :: Canvas | eff) Unit) + +detachShader :: forall eff. WebGLContext -> WebGLProgram -> WebGLShader -> Eff (canvas :: Canvas | eff) Unit +detachShader webgl program shader = runFn3 detachShaderImpl webgl program shader + +foreign import disableImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +disable :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +disable webgl cap = runFn2 disableImpl webgl cap + +foreign import disableVertexAttribArrayImpl :: forall eff. Fn2 WebGLContext GLuint (Eff (canvas :: Canvas | eff) Unit) + +disableVertexAttribArray :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +disableVertexAttribArray webgl index = runFn2 disableVertexAttribArrayImpl webgl index + +foreign import drawArraysImpl :: forall eff. Fn4 WebGLContext GLenum GLint GLsizei (Eff (canvas :: Canvas | eff) Unit) + +drawArrays :: forall eff. WebGLContext -> GLenum -> GLint -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +drawArrays webgl mode first count = runFn4 drawArraysImpl webgl mode first count + +foreign import drawElementsImpl :: forall eff. Fn5 WebGLContext GLenum GLsizei GLenum GLintptr (Eff (canvas :: Canvas | eff) Unit) + +drawElements :: forall eff. WebGLContext -> GLenum -> GLsizei -> GLenum -> GLintptr -> Eff (canvas :: Canvas | eff) Unit +drawElements webgl mode count type' offset = runFn5 drawElementsImpl webgl mode count type' offset + +foreign import enableImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +enable :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +enable webgl cap = runFn2 enableImpl webgl cap + +foreign import enableVertexAttribArrayImpl :: forall eff. Fn2 WebGLContext GLuint (Eff (canvas :: Canvas | eff) Unit) + +enableVertexAttribArray :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +enableVertexAttribArray webgl index = runFn2 enableVertexAttribArrayImpl webgl index + +foreign import finishImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) Unit) + +finish :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Unit +finish webgl = runFn1 finishImpl webgl + +foreign import flushImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) Unit) + +flush :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Unit +flush webgl = runFn1 flushImpl webgl + +foreign import framebufferRenderbufferImpl :: forall eff. Fn5 WebGLContext GLenum GLenum GLenum WebGLRenderbuffer (Eff (canvas :: Canvas | eff) Unit) + +framebufferRenderbuffer :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) Unit +framebufferRenderbuffer webgl target attachment renderbuffertarget renderbuffer = runFn5 framebufferRenderbufferImpl webgl target attachment renderbuffertarget renderbuffer + +foreign import framebufferTexture2DImpl :: forall eff. Fn6 WebGLContext GLenum GLenum GLenum WebGLTexture GLint (Eff (canvas :: Canvas | eff) Unit) + +framebufferTexture2D :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> WebGLTexture -> GLint -> Eff (canvas :: Canvas | eff) Unit +framebufferTexture2D webgl target attachment textarget texture level = runFn6 framebufferTexture2DImpl webgl target attachment textarget texture level + +foreign import frontFaceImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +frontFace :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +frontFace webgl mode = runFn2 frontFaceImpl webgl mode + +foreign import generateMipmapImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) Unit) + +generateMipmap :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) Unit +generateMipmap webgl target = runFn2 generateMipmapImpl webgl target + +foreign import getActiveAttribImpl :: forall eff. Fn3 WebGLContext WebGLProgram GLuint (Eff (canvas :: Canvas | eff) WebGLActiveInfo) + +getActiveAttrib :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> Eff (canvas :: Canvas | eff) (Maybe WebGLActiveInfo) +getActiveAttrib webgl program index = runFn3 getActiveAttribImpl webgl program index >>= toMaybe >>> return + +foreign import getActiveUniformImpl :: forall eff. Fn3 WebGLContext WebGLProgram GLuint (Eff (canvas :: Canvas | eff) WebGLActiveInfo) + +getActiveUniform :: forall eff. WebGLContext -> WebGLProgram -> GLuint -> Eff (canvas :: Canvas | eff) (Maybe WebGLActiveInfo) +getActiveUniform webgl program index = runFn3 getActiveUniformImpl webgl program index >>= toMaybe >>> return + +foreign import getAttachedShadersImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) (Array WebGLShader)) + +getAttachedShaders :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) (Array WebGLShader) +getAttachedShaders webgl program = runFn2 getAttachedShadersImpl webgl program >>= nullAsEmpty >>> return + +foreign import getAttribLocationImpl :: forall eff. Fn3 WebGLContext WebGLProgram DOMString (Eff (canvas :: Canvas | eff) GLint) + +getAttribLocation :: forall eff. WebGLContext -> WebGLProgram -> DOMString -> Eff (canvas :: Canvas | eff) GLint +getAttribLocation webgl program name = runFn3 getAttribLocationImpl webgl program name + +foreign import getBufferParameterImpl :: forall eff a. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) a) + +getBufferParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getBufferParameter webgl target pname = runFn3 getBufferParameterImpl webgl target pname >>= toMaybe >>> return + +foreign import getContextAttributesImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) WebGLContextAttributes) + +getContextAttributes :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Maybe WebGLContextAttributes) +getContextAttributes webgl = runFn1 getContextAttributesImpl webgl >>= toMaybe >>> return + +foreign import getErrorImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) GLenum) + +getError :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) GLenum +getError webgl = runFn1 getErrorImpl webgl + +foreign import getExtensionImpl :: forall eff a. Fn2 WebGLContext DOMString (Eff (canvas :: Canvas | eff) a) + +getExtension :: forall eff a. WebGLContext -> DOMString -> Eff (canvas :: Canvas | eff) (Maybe a) +getExtension webgl name = runFn2 getExtensionImpl webgl name >>= toMaybe >>> return + +foreign import getFramebufferAttachmentParameterImpl :: forall eff a. Fn4 WebGLContext GLenum GLenum GLenum (Eff (canvas :: Canvas | eff) a) + +getFramebufferAttachmentParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getFramebufferAttachmentParameter webgl target attachment pname = runFn4 getFramebufferAttachmentParameterImpl webgl target attachment pname >>= toMaybe >>> return + +foreign import getParameterImpl :: forall eff a. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) a) + +getParameter :: forall eff a. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getParameter webgl pname = runFn2 getParameterImpl webgl pname >>= toMaybe >>> return + +foreign import getProgramInfoLogImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) DOMString) + +getProgramInfoLog :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +getProgramInfoLog webgl program = runFn2 getProgramInfoLogImpl webgl program >>= toMaybe >>> return + +foreign import getProgramParameterImpl :: forall eff a. Fn3 WebGLContext WebGLProgram GLenum (Eff (canvas :: Canvas | eff) a) + +getProgramParameter :: forall eff a. WebGLContext -> WebGLProgram -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getProgramParameter webgl program pname = runFn3 getProgramParameterImpl webgl program pname >>= toMaybe >>> return + +foreign import getRenderbufferParameterImpl :: forall eff a. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) a) + +getRenderbufferParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getRenderbufferParameter webgl target pname = runFn3 getRenderbufferParameterImpl webgl target pname >>= toMaybe >>> return + +foreign import getShaderInfoLogImpl :: forall eff. Fn2 WebGLContext WebGLShader (Eff (canvas :: Canvas | eff) DOMString) + +getShaderInfoLog :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +getShaderInfoLog webgl shader = runFn2 getShaderInfoLogImpl webgl shader >>= toMaybe >>> return + +foreign import getShaderParameterImpl :: forall eff a. Fn3 WebGLContext WebGLShader GLenum (Eff (canvas :: Canvas | eff) a) + +getShaderParameter :: forall eff a. WebGLContext -> WebGLShader -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getShaderParameter webgl shader pname = runFn3 getShaderParameterImpl webgl shader pname >>= toMaybe >>> return + +foreign import getShaderPrecisionFormatImpl :: forall eff. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) WebGLShaderPrecisionFormat) + +getShaderPrecisionFormat :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe WebGLShaderPrecisionFormat) +getShaderPrecisionFormat webgl shadertype precisiontype = runFn3 getShaderPrecisionFormatImpl webgl shadertype precisiontype >>= toMaybe >>> return + +foreign import getShaderSourceImpl :: forall eff. Fn2 WebGLContext WebGLShader (Eff (canvas :: Canvas | eff) DOMString) + +getShaderSource :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) (Maybe DOMString) +getShaderSource webgl shader = runFn2 getShaderSourceImpl webgl shader >>= toMaybe >>> return + +foreign import getSupportedExtensionsImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) (Array DOMString)) + +getSupportedExtensions :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) (Array DOMString) +getSupportedExtensions webgl = runFn1 getSupportedExtensionsImpl webgl >>= nullAsEmpty >>> return + +foreign import getTexParameterImpl :: forall eff a. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) a) + +getTexParameter :: forall eff a. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getTexParameter webgl target pname = runFn3 getTexParameterImpl webgl target pname >>= toMaybe >>> return + +foreign import getUniformImpl :: forall eff a. Fn3 WebGLContext WebGLProgram WebGLUniformLocation (Eff (canvas :: Canvas | eff) a) + +getUniform :: forall eff a. WebGLContext -> WebGLProgram -> WebGLUniformLocation -> Eff (canvas :: Canvas | eff) (Maybe a) +getUniform webgl program location = runFn3 getUniformImpl webgl program location >>= toMaybe >>> return + +foreign import getUniformLocationImpl :: forall eff. Fn3 WebGLContext WebGLProgram DOMString (Eff (canvas :: Canvas | eff) WebGLUniformLocation) + +getUniformLocation :: forall eff. WebGLContext -> WebGLProgram -> DOMString -> Eff (canvas :: Canvas | eff) (Maybe WebGLUniformLocation) +getUniformLocation webgl program name = runFn3 getUniformLocationImpl webgl program name >>= toMaybe >>> return + +foreign import getVertexAttribImpl :: forall eff a. Fn3 WebGLContext GLuint GLenum (Eff (canvas :: Canvas | eff) a) + +getVertexAttrib :: forall eff a. WebGLContext -> GLuint -> GLenum -> Eff (canvas :: Canvas | eff) (Maybe a) +getVertexAttrib webgl index pname = runFn3 getVertexAttribImpl webgl index pname >>= toMaybe >>> return + +foreign import getVertexAttribOffsetImpl :: forall eff. Fn3 WebGLContext GLuint GLenum (Eff (canvas :: Canvas | eff) GLsizeiptr) + +getVertexAttribOffset :: forall eff. WebGLContext -> GLuint -> GLenum -> Eff (canvas :: Canvas | eff) GLsizeiptr +getVertexAttribOffset webgl index pname = runFn3 getVertexAttribOffsetImpl webgl index pname + +foreign import hintImpl :: forall eff. Fn3 WebGLContext GLenum GLenum (Eff (canvas :: Canvas | eff) Unit) + +hint :: forall eff. WebGLContext -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +hint webgl target mode = runFn3 hintImpl webgl target mode + +foreign import isBufferImpl :: forall eff. Fn2 WebGLContext WebGLBuffer (Eff (canvas :: Canvas | eff) GLboolean) + +isBuffer :: forall eff. WebGLContext -> WebGLBuffer -> Eff (canvas :: Canvas | eff) GLboolean +isBuffer webgl buffer = runFn2 isBufferImpl webgl buffer + +foreign import isContextLostImpl :: forall eff. Fn1 WebGLContext (Eff (canvas :: Canvas | eff) Boolean) + +isContextLost :: forall eff. WebGLContext -> Eff (canvas :: Canvas | eff) Boolean +isContextLost webgl = runFn1 isContextLostImpl webgl + +foreign import isEnabledImpl :: forall eff. Fn2 WebGLContext GLenum (Eff (canvas :: Canvas | eff) GLboolean) + +isEnabled :: forall eff. WebGLContext -> GLenum -> Eff (canvas :: Canvas | eff) GLboolean +isEnabled webgl cap = runFn2 isEnabledImpl webgl cap + +foreign import isFramebufferImpl :: forall eff. Fn2 WebGLContext WebGLFramebuffer (Eff (canvas :: Canvas | eff) GLboolean) + +isFramebuffer :: forall eff. WebGLContext -> WebGLFramebuffer -> Eff (canvas :: Canvas | eff) GLboolean +isFramebuffer webgl framebuffer = runFn2 isFramebufferImpl webgl framebuffer + +foreign import isProgramImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) GLboolean) + +isProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) GLboolean +isProgram webgl program = runFn2 isProgramImpl webgl program + +foreign import isRenderbufferImpl :: forall eff. Fn2 WebGLContext WebGLRenderbuffer (Eff (canvas :: Canvas | eff) GLboolean) + +isRenderbuffer :: forall eff. WebGLContext -> WebGLRenderbuffer -> Eff (canvas :: Canvas | eff) GLboolean +isRenderbuffer webgl renderbuffer = runFn2 isRenderbufferImpl webgl renderbuffer + +foreign import isShaderImpl :: forall eff. Fn2 WebGLContext WebGLShader (Eff (canvas :: Canvas | eff) GLboolean) + +isShader :: forall eff. WebGLContext -> WebGLShader -> Eff (canvas :: Canvas | eff) GLboolean +isShader webgl shader = runFn2 isShaderImpl webgl shader + +foreign import isTextureImpl :: forall eff. Fn2 WebGLContext WebGLTexture (Eff (canvas :: Canvas | eff) GLboolean) + +isTexture :: forall eff. WebGLContext -> WebGLTexture -> Eff (canvas :: Canvas | eff) GLboolean +isTexture webgl texture = runFn2 isTextureImpl webgl texture + +foreign import lineWidthImpl :: forall eff. Fn2 WebGLContext GLfloat (Eff (canvas :: Canvas | eff) Unit) + +lineWidth :: forall eff. WebGLContext -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +lineWidth webgl width = runFn2 lineWidthImpl webgl width + +foreign import linkProgramImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) Unit) + +linkProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +linkProgram webgl program = runFn2 linkProgramImpl webgl program + +foreign import pixelStoreiImpl :: forall eff. Fn3 WebGLContext GLenum GLint (Eff (canvas :: Canvas | eff) Unit) + +pixelStorei :: forall eff. WebGLContext -> GLenum -> GLint -> Eff (canvas :: Canvas | eff) Unit +pixelStorei webgl pname param = runFn3 pixelStoreiImpl webgl pname param + +foreign import polygonOffsetImpl :: forall eff. Fn3 WebGLContext GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +polygonOffset :: forall eff. WebGLContext -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +polygonOffset webgl factor units = runFn3 polygonOffsetImpl webgl factor units + +foreign import readPixelsImpl :: forall eff. Fn8 WebGLContext GLint GLint GLsizei GLsizei GLenum GLenum ArrayBufferView (Eff (canvas :: Canvas | eff) Unit) + +readPixels :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +readPixels webgl x y width height format type' pixels = runFn8 readPixelsImpl webgl x y width height format type' pixels + +foreign import renderbufferStorageImpl :: forall eff. Fn5 WebGLContext GLenum GLenum GLsizei GLsizei (Eff (canvas :: Canvas | eff) Unit) + +renderbufferStorage :: forall eff. WebGLContext -> GLenum -> GLenum -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +renderbufferStorage webgl target internalformat width height = runFn5 renderbufferStorageImpl webgl target internalformat width height + +foreign import sampleCoverageImpl :: forall eff. Fn3 WebGLContext GLclampf GLboolean (Eff (canvas :: Canvas | eff) Unit) + +sampleCoverage :: forall eff. WebGLContext -> GLclampf -> GLboolean -> Eff (canvas :: Canvas | eff) Unit +sampleCoverage webgl value invert = runFn3 sampleCoverageImpl webgl value invert + +foreign import scissorImpl :: forall eff. Fn5 WebGLContext GLint GLint GLsizei GLsizei (Eff (canvas :: Canvas | eff) Unit) + +scissor :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +scissor webgl x y width height = runFn5 scissorImpl webgl x y width height + +foreign import shaderSourceImpl :: forall eff. Fn3 WebGLContext WebGLShader DOMString (Eff (canvas :: Canvas | eff) Unit) + +shaderSource :: forall eff. WebGLContext -> WebGLShader -> DOMString -> Eff (canvas :: Canvas | eff) Unit +shaderSource webgl shader source = runFn3 shaderSourceImpl webgl shader source + +foreign import stencilFuncImpl :: forall eff. Fn4 WebGLContext GLenum GLint GLuint (Eff (canvas :: Canvas | eff) Unit) + +stencilFunc :: forall eff. WebGLContext -> GLenum -> GLint -> GLuint -> Eff (canvas :: Canvas | eff) Unit +stencilFunc webgl func ref mask = runFn4 stencilFuncImpl webgl func ref mask + +foreign import stencilFuncSeparateImpl :: forall eff. Fn5 WebGLContext GLenum GLenum GLint GLuint (Eff (canvas :: Canvas | eff) Unit) + +stencilFuncSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLint -> GLuint -> Eff (canvas :: Canvas | eff) Unit +stencilFuncSeparate webgl face func ref mask = runFn5 stencilFuncSeparateImpl webgl face func ref mask + +foreign import stencilMaskImpl :: forall eff. Fn2 WebGLContext GLuint (Eff (canvas :: Canvas | eff) Unit) + +stencilMask :: forall eff. WebGLContext -> GLuint -> Eff (canvas :: Canvas | eff) Unit +stencilMask webgl mask = runFn2 stencilMaskImpl webgl mask + +foreign import stencilMaskSeparateImpl :: forall eff. Fn3 WebGLContext GLenum GLuint (Eff (canvas :: Canvas | eff) Unit) + +stencilMaskSeparate :: forall eff. WebGLContext -> GLenum -> GLuint -> Eff (canvas :: Canvas | eff) Unit +stencilMaskSeparate webgl face mask = runFn3 stencilMaskSeparateImpl webgl face mask + +foreign import stencilOpImpl :: forall eff. Fn4 WebGLContext GLenum GLenum GLenum (Eff (canvas :: Canvas | eff) Unit) + +stencilOp :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +stencilOp webgl fail zfail zpass = runFn4 stencilOpImpl webgl fail zfail zpass + +foreign import stencilOpSeparateImpl :: forall eff. Fn5 WebGLContext GLenum GLenum GLenum GLenum (Eff (canvas :: Canvas | eff) Unit) + +stencilOpSeparate :: forall eff. WebGLContext -> GLenum -> GLenum -> GLenum -> GLenum -> Eff (canvas :: Canvas | eff) Unit +stencilOpSeparate webgl face fail zfail zpass = runFn5 stencilOpSeparateImpl webgl face fail zfail zpass + +foreign import texImage2DImpl :: forall eff. Fn7 WebGLContext GLenum GLint GLenum GLenum GLenum TexImageSource (Eff (canvas :: Canvas | eff) Unit) + +texImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLenum -> GLenum -> TexImageSource -> Eff (canvas :: Canvas | eff) Unit +texImage2D webgl target level internalformat format type' source = runFn7 texImage2DImpl webgl target level internalformat format type' source + +foreign import texImage2D_Impl :: forall eff. Fn10 WebGLContext GLenum GLint GLenum GLsizei GLsizei GLint GLenum GLenum ArrayBufferView (Eff (canvas :: Canvas | eff) Unit) + +texImage2D_ :: forall eff. WebGLContext -> GLenum -> GLint -> GLenum -> GLsizei -> GLsizei -> GLint -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +texImage2D_ webgl target level internalformat width height border format type' pixels = runFn10 texImage2D_Impl webgl target level internalformat width height border format type' pixels + +foreign import texParameterfImpl :: forall eff. Fn4 WebGLContext GLenum GLenum GLfloat (Eff (canvas :: Canvas | eff) Unit) + +texParameterf :: forall eff. WebGLContext -> GLenum -> GLenum -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +texParameterf webgl target pname param = runFn4 texParameterfImpl webgl target pname param + +foreign import texParameteriImpl :: forall eff. Fn4 WebGLContext GLenum GLenum GLint (Eff (canvas :: Canvas | eff) Unit) + +texParameteri :: forall eff. WebGLContext -> GLenum -> GLenum -> GLint -> Eff (canvas :: Canvas | eff) Unit +texParameteri webgl target pname param = runFn4 texParameteriImpl webgl target pname param + +foreign import texSubImage2DImpl :: forall eff. Fn8 WebGLContext GLenum GLint GLint GLint GLenum GLenum TexImageSource (Eff (canvas :: Canvas | eff) Unit) + +texSubImage2D :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLenum -> GLenum -> TexImageSource -> Eff (canvas :: Canvas | eff) Unit +texSubImage2D webgl target level xoffset yoffset format type' source = runFn8 texSubImage2DImpl webgl target level xoffset yoffset format type' source + +foreign import texSubImage2D_Impl :: forall eff. Fn10 WebGLContext GLenum GLint GLint GLint GLsizei GLsizei GLenum GLenum ArrayBufferView (Eff (canvas :: Canvas | eff) Unit) + +texSubImage2D_ :: forall eff. WebGLContext -> GLenum -> GLint -> GLint -> GLint -> GLsizei -> GLsizei -> GLenum -> GLenum -> ArrayBufferView -> Eff (canvas :: Canvas | eff) Unit +texSubImage2D_ webgl target level xoffset yoffset width height format type' pixels = runFn10 texSubImage2D_Impl webgl target level xoffset yoffset width height format type' pixels + +foreign import uniform1fImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation GLfloat (Eff (canvas :: Canvas | eff) Unit) + +uniform1f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +uniform1f webgl location x = runFn3 uniform1fImpl webgl location x + +foreign import uniform1fvImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniform1fv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniform1fv webgl location v = runFn3 uniform1fvImpl webgl location v + +foreign import uniform1fv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform1fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniform1fv_ webgl location v = runFn3 uniform1fv_Impl webgl location v + +foreign import uniform1iImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation GLint (Eff (canvas :: Canvas | eff) Unit) + +uniform1i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> Eff (canvas :: Canvas | eff) Unit +uniform1i webgl location x = runFn3 uniform1iImpl webgl location x + +foreign import uniform1ivImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array Int) (Eff (canvas :: Canvas | eff) Unit) + +uniform1iv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array Int) -> Eff (canvas :: Canvas | eff) Unit +uniform1iv webgl location v = runFn3 uniform1ivImpl webgl location v + +foreign import uniform1iv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Int32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform1iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +uniform1iv_ webgl location v = runFn3 uniform1iv_Impl webgl location v + +foreign import uniform2fImpl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +uniform2f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +uniform2f webgl location x y = runFn4 uniform2fImpl webgl location x y + +foreign import uniform2fvImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniform2fv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniform2fv webgl location v = runFn3 uniform2fvImpl webgl location v + +foreign import uniform2fv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform2fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniform2fv_ webgl location v = runFn3 uniform2fv_Impl webgl location v + +foreign import uniform2iImpl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLint GLint (Eff (canvas :: Canvas | eff) Unit) + +uniform2i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +uniform2i webgl location x y = runFn4 uniform2iImpl webgl location x y + +foreign import uniform2ivImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array Int) (Eff (canvas :: Canvas | eff) Unit) + +uniform2iv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array Int) -> Eff (canvas :: Canvas | eff) Unit +uniform2iv webgl location v = runFn3 uniform2ivImpl webgl location v + +foreign import uniform2iv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Int32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform2iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +uniform2iv_ webgl location v = runFn3 uniform2iv_Impl webgl location v + +foreign import uniform3fImpl :: forall eff. Fn5 WebGLContext WebGLUniformLocation GLfloat GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +uniform3f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +uniform3f webgl location x y z = runFn5 uniform3fImpl webgl location x y z + +foreign import uniform3fvImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniform3fv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniform3fv webgl location v = runFn3 uniform3fvImpl webgl location v + +foreign import uniform3fv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform3fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniform3fv_ webgl location v = runFn3 uniform3fv_Impl webgl location v + +foreign import uniform3iImpl :: forall eff. Fn5 WebGLContext WebGLUniformLocation GLint GLint GLint (Eff (canvas :: Canvas | eff) Unit) + +uniform3i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +uniform3i webgl location x y z = runFn5 uniform3iImpl webgl location x y z + +foreign import uniform3ivImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array Int) (Eff (canvas :: Canvas | eff) Unit) + +uniform3iv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array Int) -> Eff (canvas :: Canvas | eff) Unit +uniform3iv webgl location v = runFn3 uniform3ivImpl webgl location v + +foreign import uniform3iv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Int32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform3iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +uniform3iv_ webgl location v = runFn3 uniform3iv_Impl webgl location v + +foreign import uniform4fImpl :: forall eff. Fn6 WebGLContext WebGLUniformLocation GLfloat GLfloat GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +uniform4f :: forall eff. WebGLContext -> WebGLUniformLocation -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +uniform4f webgl location x y z w = runFn6 uniform4fImpl webgl location x y z w + +foreign import uniform4fvImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniform4fv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniform4fv webgl location v = runFn3 uniform4fvImpl webgl location v + +foreign import uniform4fv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform4fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniform4fv_ webgl location v = runFn3 uniform4fv_Impl webgl location v + +foreign import uniform4iImpl :: forall eff. Fn6 WebGLContext WebGLUniformLocation GLint GLint GLint GLint (Eff (canvas :: Canvas | eff) Unit) + +uniform4i :: forall eff. WebGLContext -> WebGLUniformLocation -> GLint -> GLint -> GLint -> GLint -> Eff (canvas :: Canvas | eff) Unit +uniform4i webgl location x y z w = runFn6 uniform4iImpl webgl location x y z w + +foreign import uniform4ivImpl :: forall eff. Fn3 WebGLContext WebGLUniformLocation (Array Int) (Eff (canvas :: Canvas | eff) Unit) + +uniform4iv :: forall eff. WebGLContext -> WebGLUniformLocation -> (Array Int) -> Eff (canvas :: Canvas | eff) Unit +uniform4iv webgl location v = runFn3 uniform4ivImpl webgl location v + +foreign import uniform4iv_Impl :: forall eff. Fn3 WebGLContext WebGLUniformLocation Int32Array (Eff (canvas :: Canvas | eff) Unit) + +uniform4iv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> Int32Array -> Eff (canvas :: Canvas | eff) Unit +uniform4iv_ webgl location v = runFn3 uniform4iv_Impl webgl location v + +foreign import uniformMatrix2fvImpl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLboolean (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniformMatrix2fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniformMatrix2fv webgl location transpose value = runFn4 uniformMatrix2fvImpl webgl location transpose value + +foreign import uniformMatrix2fv_Impl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLboolean Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniformMatrix2fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniformMatrix2fv_ webgl location transpose value = runFn4 uniformMatrix2fv_Impl webgl location transpose value + +foreign import uniformMatrix3fvImpl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLboolean (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniformMatrix3fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniformMatrix3fv webgl location transpose value = runFn4 uniformMatrix3fvImpl webgl location transpose value + +foreign import uniformMatrix3fv_Impl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLboolean Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniformMatrix3fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniformMatrix3fv_ webgl location transpose value = runFn4 uniformMatrix3fv_Impl webgl location transpose value + +foreign import uniformMatrix4fvImpl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLboolean (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +uniformMatrix4fv :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +uniformMatrix4fv webgl location transpose value = runFn4 uniformMatrix4fvImpl webgl location transpose value + +foreign import uniformMatrix4fv_Impl :: forall eff. Fn4 WebGLContext WebGLUniformLocation GLboolean Float32Array (Eff (canvas :: Canvas | eff) Unit) + +uniformMatrix4fv_ :: forall eff. WebGLContext -> WebGLUniformLocation -> GLboolean -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +uniformMatrix4fv_ webgl location transpose value = runFn4 uniformMatrix4fv_Impl webgl location transpose value + +foreign import useProgramImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) Unit) + +useProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +useProgram webgl program = runFn2 useProgramImpl webgl program + +foreign import validateProgramImpl :: forall eff. Fn2 WebGLContext WebGLProgram (Eff (canvas :: Canvas | eff) Unit) + +validateProgram :: forall eff. WebGLContext -> WebGLProgram -> Eff (canvas :: Canvas | eff) Unit +validateProgram webgl program = runFn2 validateProgramImpl webgl program + +foreign import vertexAttrib1fImpl :: forall eff. Fn3 WebGLContext GLuint GLfloat (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib1f :: forall eff. WebGLContext -> GLuint -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib1f webgl indx x = runFn3 vertexAttrib1fImpl webgl indx x + +foreign import vertexAttrib1fvImpl :: forall eff. Fn3 WebGLContext GLuint (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib1fv :: forall eff. WebGLContext -> GLuint -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib1fv webgl indx values = runFn3 vertexAttrib1fvImpl webgl indx values + +foreign import vertexAttrib1fv_Impl :: forall eff. Fn3 WebGLContext GLuint Float32Array (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib1fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib1fv_ webgl indx values = runFn3 vertexAttrib1fv_Impl webgl indx values + +foreign import vertexAttrib2fImpl :: forall eff. Fn4 WebGLContext GLuint GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib2f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib2f webgl indx x y = runFn4 vertexAttrib2fImpl webgl indx x y + +foreign import vertexAttrib2fvImpl :: forall eff. Fn3 WebGLContext GLuint (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib2fv :: forall eff. WebGLContext -> GLuint -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib2fv webgl indx values = runFn3 vertexAttrib2fvImpl webgl indx values + +foreign import vertexAttrib2fv_Impl :: forall eff. Fn3 WebGLContext GLuint Float32Array (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib2fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib2fv_ webgl indx values = runFn3 vertexAttrib2fv_Impl webgl indx values + +foreign import vertexAttrib3fImpl :: forall eff. Fn5 WebGLContext GLuint GLfloat GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib3f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib3f webgl indx x y z = runFn5 vertexAttrib3fImpl webgl indx x y z + +foreign import vertexAttrib3fvImpl :: forall eff. Fn3 WebGLContext GLuint (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib3fv :: forall eff. WebGLContext -> GLuint -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib3fv webgl indx values = runFn3 vertexAttrib3fvImpl webgl indx values + +foreign import vertexAttrib3fv_Impl :: forall eff. Fn3 WebGLContext GLuint Float32Array (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib3fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib3fv_ webgl indx values = runFn3 vertexAttrib3fv_Impl webgl indx values + +foreign import vertexAttrib4fImpl :: forall eff. Fn6 WebGLContext GLuint GLfloat GLfloat GLfloat GLfloat (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib4f :: forall eff. WebGLContext -> GLuint -> GLfloat -> GLfloat -> GLfloat -> GLfloat -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib4f webgl indx x y z w = runFn6 vertexAttrib4fImpl webgl indx x y z w + +foreign import vertexAttrib4fvImpl :: forall eff. Fn3 WebGLContext GLuint (Array GLfloat) (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib4fv :: forall eff. WebGLContext -> GLuint -> (Array GLfloat) -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib4fv webgl indx values = runFn3 vertexAttrib4fvImpl webgl indx values + +foreign import vertexAttrib4fv_Impl :: forall eff. Fn3 WebGLContext GLuint Float32Array (Eff (canvas :: Canvas | eff) Unit) + +vertexAttrib4fv_ :: forall eff. WebGLContext -> GLuint -> Float32Array -> Eff (canvas :: Canvas | eff) Unit +vertexAttrib4fv_ webgl indx values = runFn3 vertexAttrib4fv_Impl webgl indx values + +foreign import vertexAttribPointerImpl :: forall eff. Fn7 WebGLContext GLuint GLint GLenum GLboolean GLsizei GLintptr (Eff (canvas :: Canvas | eff) Unit) + +vertexAttribPointer :: forall eff. WebGLContext -> GLuint -> GLint -> GLenum -> GLboolean -> GLsizei -> GLintptr -> Eff (canvas :: Canvas | eff) Unit +vertexAttribPointer webgl indx size type' normalized stride offset = runFn7 vertexAttribPointerImpl webgl indx size type' normalized stride offset + +foreign import viewportImpl :: forall eff. Fn5 WebGLContext GLint GLint GLsizei GLsizei (Eff (canvas :: Canvas | eff) Unit) + +viewport :: forall eff. WebGLContext -> GLint -> GLint -> GLsizei -> GLsizei -> Eff (canvas :: Canvas | eff) Unit +viewport webgl x y width height = runFn5 viewportImpl webgl x y width height + diff --git a/src/Graphics/WebGL/Raw/Enums.purs b/src/Graphics/WebGL/Raw/Enums.purs new file mode 100644 index 0000000..525eb5e --- /dev/null +++ b/src/Graphics/WebGL/Raw/Enums.purs @@ -0,0 +1,895 @@ +module Graphics.WebGL.Raw.Enums where + +import Graphics.WebGL.Raw.Types (GLenum ()) + +activeAttributes :: GLenum +activeAttributes = 35721 + +activeTexture :: GLenum +activeTexture = 34016 + +activeUniforms :: GLenum +activeUniforms = 35718 + +aliasedLineWidthRange :: GLenum +aliasedLineWidthRange = 33902 + +aliasedPointSizeRange :: GLenum +aliasedPointSizeRange = 33901 + +alpha :: GLenum +alpha = 6406 + +alphaBits :: GLenum +alphaBits = 3413 + +always :: GLenum +always = 519 + +arrayBuffer :: GLenum +arrayBuffer = 34962 + +arrayBufferBinding :: GLenum +arrayBufferBinding = 34964 + +attachedShaders :: GLenum +attachedShaders = 35717 + +back :: GLenum +back = 1029 + +blend :: GLenum +blend = 3042 + +blendColor :: GLenum +blendColor = 32773 + +blendDstAlpha :: GLenum +blendDstAlpha = 32970 + +blendDstRgb :: GLenum +blendDstRgb = 32968 + +blendEquation :: GLenum +blendEquation = 32777 + +blendEquationAlpha :: GLenum +blendEquationAlpha = 34877 + +blendEquationRgb :: GLenum +blendEquationRgb = 32777 + +blendSrcAlpha :: GLenum +blendSrcAlpha = 32971 + +blendSrcRgb :: GLenum +blendSrcRgb = 32969 + +blueBits :: GLenum +blueBits = 3412 + +bool :: GLenum +bool = 35670 + +boolVec2 :: GLenum +boolVec2 = 35671 + +boolVec3 :: GLenum +boolVec3 = 35672 + +boolVec4 :: GLenum +boolVec4 = 35673 + +browserDefaultWebgl :: GLenum +browserDefaultWebgl = 37444 + +bufferSize :: GLenum +bufferSize = 34660 + +bufferUsage :: GLenum +bufferUsage = 34661 + +byte :: GLenum +byte = 5120 + +ccw :: GLenum +ccw = 2305 + +clampToEdge :: GLenum +clampToEdge = 33071 + +colorAttachment0 :: GLenum +colorAttachment0 = 36064 + +colorBufferBit :: GLenum +colorBufferBit = 16384 + +colorClearValue :: GLenum +colorClearValue = 3106 + +colorWritemask :: GLenum +colorWritemask = 3107 + +compileStatus :: GLenum +compileStatus = 35713 + +compressedTextureFormats :: GLenum +compressedTextureFormats = 34467 + +constantAlpha :: GLenum +constantAlpha = 32771 + +constantColor :: GLenum +constantColor = 32769 + +contextLostWebgl :: GLenum +contextLostWebgl = 37442 + +cullFace :: GLenum +cullFace = 2884 + +cullFaceMode :: GLenum +cullFaceMode = 2885 + +currentProgram :: GLenum +currentProgram = 35725 + +currentVertexAttrib :: GLenum +currentVertexAttrib = 34342 + +cw :: GLenum +cw = 2304 + +decr :: GLenum +decr = 7683 + +decrWrap :: GLenum +decrWrap = 34056 + +deleteStatus :: GLenum +deleteStatus = 35712 + +depthAttachment :: GLenum +depthAttachment = 36096 + +depthBits :: GLenum +depthBits = 3414 + +depthBufferBit :: GLenum +depthBufferBit = 256 + +depthClearValue :: GLenum +depthClearValue = 2931 + +depthComponent :: GLenum +depthComponent = 6402 + +depthComponent16 :: GLenum +depthComponent16 = 33189 + +depthFunc :: GLenum +depthFunc = 2932 + +depthRange :: GLenum +depthRange = 2928 + +depthStencil :: GLenum +depthStencil = 34041 + +depthStencilAttachment :: GLenum +depthStencilAttachment = 33306 + +depthTest :: GLenum +depthTest = 2929 + +depthWritemask :: GLenum +depthWritemask = 2930 + +dither :: GLenum +dither = 3024 + +dontCare :: GLenum +dontCare = 4352 + +dstAlpha :: GLenum +dstAlpha = 772 + +dstColor :: GLenum +dstColor = 774 + +dynamicDraw :: GLenum +dynamicDraw = 35048 + +elementArrayBuffer :: GLenum +elementArrayBuffer = 34963 + +elementArrayBufferBinding :: GLenum +elementArrayBufferBinding = 34965 + +equal :: GLenum +equal = 514 + +fastest :: GLenum +fastest = 4353 + +float :: GLenum +float = 5126 + +floatMat2 :: GLenum +floatMat2 = 35674 + +floatMat3 :: GLenum +floatMat3 = 35675 + +floatMat4 :: GLenum +floatMat4 = 35676 + +floatVec2 :: GLenum +floatVec2 = 35664 + +floatVec3 :: GLenum +floatVec3 = 35665 + +floatVec4 :: GLenum +floatVec4 = 35666 + +fragmentShader :: GLenum +fragmentShader = 35632 + +framebuffer :: GLenum +framebuffer = 36160 + +framebufferAttachmentObjectName :: GLenum +framebufferAttachmentObjectName = 36049 + +framebufferAttachmentObjectType :: GLenum +framebufferAttachmentObjectType = 36048 + +framebufferAttachmentTextureCubeMapFace :: GLenum +framebufferAttachmentTextureCubeMapFace = 36051 + +framebufferAttachmentTextureLevel :: GLenum +framebufferAttachmentTextureLevel = 36050 + +framebufferBinding :: GLenum +framebufferBinding = 36006 + +framebufferComplete :: GLenum +framebufferComplete = 36053 + +framebufferIncompleteAttachment :: GLenum +framebufferIncompleteAttachment = 36054 + +framebufferIncompleteDimensions :: GLenum +framebufferIncompleteDimensions = 36057 + +framebufferIncompleteMissingAttachment :: GLenum +framebufferIncompleteMissingAttachment = 36055 + +framebufferUnsupported :: GLenum +framebufferUnsupported = 36061 + +front :: GLenum +front = 1028 + +frontAndBack :: GLenum +frontAndBack = 1032 + +frontFace :: GLenum +frontFace = 2886 + +funcAdd :: GLenum +funcAdd = 32774 + +funcReverseSubtract :: GLenum +funcReverseSubtract = 32779 + +funcSubtract :: GLenum +funcSubtract = 32778 + +generateMipmapHint :: GLenum +generateMipmapHint = 33170 + +gequal :: GLenum +gequal = 518 + +greater :: GLenum +greater = 516 + +greenBits :: GLenum +greenBits = 3411 + +highFloat :: GLenum +highFloat = 36338 + +highInt :: GLenum +highInt = 36341 + +implementationColorReadFormat :: GLenum +implementationColorReadFormat = 35739 + +implementationColorReadType :: GLenum +implementationColorReadType = 35738 + +incr :: GLenum +incr = 7682 + +incrWrap :: GLenum +incrWrap = 34055 + +int :: GLenum +int = 5124 + +intVec2 :: GLenum +intVec2 = 35667 + +intVec3 :: GLenum +intVec3 = 35668 + +intVec4 :: GLenum +intVec4 = 35669 + +invalidEnum :: GLenum +invalidEnum = 1280 + +invalidFramebufferOperation :: GLenum +invalidFramebufferOperation = 1286 + +invalidOperation :: GLenum +invalidOperation = 1282 + +invalidValue :: GLenum +invalidValue = 1281 + +invert :: GLenum +invert = 5386 + +keep :: GLenum +keep = 7680 + +lequal :: GLenum +lequal = 515 + +less :: GLenum +less = 513 + +linear :: GLenum +linear = 9729 + +linearMipmapLinear :: GLenum +linearMipmapLinear = 9987 + +linearMipmapNearest :: GLenum +linearMipmapNearest = 9985 + +lines :: GLenum +lines = 1 + +lineLoop :: GLenum +lineLoop = 2 + +lineStrip :: GLenum +lineStrip = 3 + +lineWidth :: GLenum +lineWidth = 2849 + +linkStatus :: GLenum +linkStatus = 35714 + +lowFloat :: GLenum +lowFloat = 36336 + +lowInt :: GLenum +lowInt = 36339 + +luminance :: GLenum +luminance = 6409 + +luminanceAlpha :: GLenum +luminanceAlpha = 6410 + +maxCombinedTextureImageUnits :: GLenum +maxCombinedTextureImageUnits = 35661 + +maxCubeMapTextureSize :: GLenum +maxCubeMapTextureSize = 34076 + +maxFragmentUniformVectors :: GLenum +maxFragmentUniformVectors = 36349 + +maxRenderbufferSize :: GLenum +maxRenderbufferSize = 34024 + +maxTextureImageUnits :: GLenum +maxTextureImageUnits = 34930 + +maxTextureSize :: GLenum +maxTextureSize = 3379 + +maxVaryingVectors :: GLenum +maxVaryingVectors = 36348 + +maxVertexAttribs :: GLenum +maxVertexAttribs = 34921 + +maxVertexTextureImageUnits :: GLenum +maxVertexTextureImageUnits = 35660 + +maxVertexUniformVectors :: GLenum +maxVertexUniformVectors = 36347 + +maxViewportDims :: GLenum +maxViewportDims = 3386 + +mediumFloat :: GLenum +mediumFloat = 36337 + +mediumInt :: GLenum +mediumInt = 36340 + +mirroredRepeat :: GLenum +mirroredRepeat = 33648 + +nearest :: GLenum +nearest = 9728 + +nearestMipmapLinear :: GLenum +nearestMipmapLinear = 9986 + +nearestMipmapNearest :: GLenum +nearestMipmapNearest = 9984 + +never :: GLenum +never = 512 + +nicest :: GLenum +nicest = 4354 + +none :: GLenum +none = 0 + +notequal :: GLenum +notequal = 517 + +noError :: GLenum +noError = 0 + +one :: GLenum +one = 1 + +oneMinusConstantAlpha :: GLenum +oneMinusConstantAlpha = 32772 + +oneMinusConstantColor :: GLenum +oneMinusConstantColor = 32770 + +oneMinusDstAlpha :: GLenum +oneMinusDstAlpha = 773 + +oneMinusDstColor :: GLenum +oneMinusDstColor = 775 + +oneMinusSrcAlpha :: GLenum +oneMinusSrcAlpha = 771 + +oneMinusSrcColor :: GLenum +oneMinusSrcColor = 769 + +outOfMemory :: GLenum +outOfMemory = 1285 + +packAlignment :: GLenum +packAlignment = 3333 + +points :: GLenum +points = 0 + +polygonOffsetFactor :: GLenum +polygonOffsetFactor = 32824 + +polygonOffsetFill :: GLenum +polygonOffsetFill = 32823 + +polygonOffsetUnits :: GLenum +polygonOffsetUnits = 10752 + +redBits :: GLenum +redBits = 3410 + +renderbuffer :: GLenum +renderbuffer = 36161 + +renderbufferAlphaSize :: GLenum +renderbufferAlphaSize = 36179 + +renderbufferBinding :: GLenum +renderbufferBinding = 36007 + +renderbufferBlueSize :: GLenum +renderbufferBlueSize = 36178 + +renderbufferDepthSize :: GLenum +renderbufferDepthSize = 36180 + +renderbufferGreenSize :: GLenum +renderbufferGreenSize = 36177 + +renderbufferHeight :: GLenum +renderbufferHeight = 36163 + +renderbufferInternalFormat :: GLenum +renderbufferInternalFormat = 36164 + +renderbufferRedSize :: GLenum +renderbufferRedSize = 36176 + +renderbufferStencilSize :: GLenum +renderbufferStencilSize = 36181 + +renderbufferWidth :: GLenum +renderbufferWidth = 36162 + +renderer :: GLenum +renderer = 7937 + +repeat :: GLenum +repeat = 10497 + +replace :: GLenum +replace = 7681 + +rgb :: GLenum +rgb = 6407 + +rgb565 :: GLenum +rgb565 = 36194 + +rgb5A1 :: GLenum +rgb5A1 = 32855 + +rgba :: GLenum +rgba = 6408 + +rgba4 :: GLenum +rgba4 = 32854 + +sampler2d :: GLenum +sampler2d = 35678 + +samplerCube :: GLenum +samplerCube = 35680 + +samples :: GLenum +samples = 32937 + +sampleAlphaToCoverage :: GLenum +sampleAlphaToCoverage = 32926 + +sampleBuffers :: GLenum +sampleBuffers = 32936 + +sampleCoverage :: GLenum +sampleCoverage = 32928 + +sampleCoverageInvert :: GLenum +sampleCoverageInvert = 32939 + +sampleCoverageValue :: GLenum +sampleCoverageValue = 32938 + +scissorBox :: GLenum +scissorBox = 3088 + +scissorTest :: GLenum +scissorTest = 3089 + +shaderType :: GLenum +shaderType = 35663 + +shadingLanguageVersion :: GLenum +shadingLanguageVersion = 35724 + +short :: GLenum +short = 5122 + +srcAlpha :: GLenum +srcAlpha = 770 + +srcAlphaSaturate :: GLenum +srcAlphaSaturate = 776 + +srcColor :: GLenum +srcColor = 768 + +staticDraw :: GLenum +staticDraw = 35044 + +stencilAttachment :: GLenum +stencilAttachment = 36128 + +stencilBackFail :: GLenum +stencilBackFail = 34817 + +stencilBackFunc :: GLenum +stencilBackFunc = 34816 + +stencilBackPassDepthFail :: GLenum +stencilBackPassDepthFail = 34818 + +stencilBackPassDepthPass :: GLenum +stencilBackPassDepthPass = 34819 + +stencilBackRef :: GLenum +stencilBackRef = 36003 + +stencilBackValueMask :: GLenum +stencilBackValueMask = 36004 + +stencilBackWritemask :: GLenum +stencilBackWritemask = 36005 + +stencilBits :: GLenum +stencilBits = 3415 + +stencilBufferBit :: GLenum +stencilBufferBit = 1024 + +stencilClearValue :: GLenum +stencilClearValue = 2961 + +stencilFail :: GLenum +stencilFail = 2964 + +stencilFunc :: GLenum +stencilFunc = 2962 + +stencilIndex :: GLenum +stencilIndex = 6401 + +stencilIndex8 :: GLenum +stencilIndex8 = 36168 + +stencilPassDepthFail :: GLenum +stencilPassDepthFail = 2965 + +stencilPassDepthPass :: GLenum +stencilPassDepthPass = 2966 + +stencilRef :: GLenum +stencilRef = 2967 + +stencilTest :: GLenum +stencilTest = 2960 + +stencilValueMask :: GLenum +stencilValueMask = 2963 + +stencilWritemask :: GLenum +stencilWritemask = 2968 + +streamDraw :: GLenum +streamDraw = 35040 + +subpixelBits :: GLenum +subpixelBits = 3408 + +texture :: GLenum +texture = 5890 + +texture0 :: GLenum +texture0 = 33984 + +texture1 :: GLenum +texture1 = 33985 + +texture10 :: GLenum +texture10 = 33994 + +texture11 :: GLenum +texture11 = 33995 + +texture12 :: GLenum +texture12 = 33996 + +texture13 :: GLenum +texture13 = 33997 + +texture14 :: GLenum +texture14 = 33998 + +texture15 :: GLenum +texture15 = 33999 + +texture16 :: GLenum +texture16 = 34000 + +texture17 :: GLenum +texture17 = 34001 + +texture18 :: GLenum +texture18 = 34002 + +texture19 :: GLenum +texture19 = 34003 + +texture2 :: GLenum +texture2 = 33986 + +texture20 :: GLenum +texture20 = 34004 + +texture21 :: GLenum +texture21 = 34005 + +texture22 :: GLenum +texture22 = 34006 + +texture23 :: GLenum +texture23 = 34007 + +texture24 :: GLenum +texture24 = 34008 + +texture25 :: GLenum +texture25 = 34009 + +texture26 :: GLenum +texture26 = 34010 + +texture27 :: GLenum +texture27 = 34011 + +texture28 :: GLenum +texture28 = 34012 + +texture29 :: GLenum +texture29 = 34013 + +texture3 :: GLenum +texture3 = 33987 + +texture30 :: GLenum +texture30 = 34014 + +texture31 :: GLenum +texture31 = 34015 + +texture4 :: GLenum +texture4 = 33988 + +texture5 :: GLenum +texture5 = 33989 + +texture6 :: GLenum +texture6 = 33990 + +texture7 :: GLenum +texture7 = 33991 + +texture8 :: GLenum +texture8 = 33992 + +texture9 :: GLenum +texture9 = 33993 + +texture2d :: GLenum +texture2d = 3553 + +textureBinding2d :: GLenum +textureBinding2d = 32873 + +textureBindingCubeMap :: GLenum +textureBindingCubeMap = 34068 + +textureCubeMap :: GLenum +textureCubeMap = 34067 + +textureCubeMapNegativeX :: GLenum +textureCubeMapNegativeX = 34070 + +textureCubeMapNegativeY :: GLenum +textureCubeMapNegativeY = 34072 + +textureCubeMapNegativeZ :: GLenum +textureCubeMapNegativeZ = 34074 + +textureCubeMapPositiveX :: GLenum +textureCubeMapPositiveX = 34069 + +textureCubeMapPositiveY :: GLenum +textureCubeMapPositiveY = 34071 + +textureCubeMapPositiveZ :: GLenum +textureCubeMapPositiveZ = 34073 + +textureMagFilter :: GLenum +textureMagFilter = 10240 + +textureMinFilter :: GLenum +textureMinFilter = 10241 + +textureWrapS :: GLenum +textureWrapS = 10242 + +textureWrapT :: GLenum +textureWrapT = 10243 + +triangles :: GLenum +triangles = 4 + +triangleFan :: GLenum +triangleFan = 6 + +triangleStrip :: GLenum +triangleStrip = 5 + +unpackAlignment :: GLenum +unpackAlignment = 3317 + +unpackColorspaceConversionWebgl :: GLenum +unpackColorspaceConversionWebgl = 37443 + +unpackFlipYWebgl :: GLenum +unpackFlipYWebgl = 37440 + +unpackPremultiplyAlphaWebgl :: GLenum +unpackPremultiplyAlphaWebgl = 37441 + +unsignedByte :: GLenum +unsignedByte = 5121 + +unsignedInt :: GLenum +unsignedInt = 5125 + +unsignedShort :: GLenum +unsignedShort = 5123 + +unsignedShort4444 :: GLenum +unsignedShort4444 = 32819 + +unsignedShort5551 :: GLenum +unsignedShort5551 = 32820 + +unsignedShort565 :: GLenum +unsignedShort565 = 33635 + +validateStatus :: GLenum +validateStatus = 35715 + +vendor :: GLenum +vendor = 7936 + +version :: GLenum +version = 7938 + +vertexAttribArrayBufferBinding :: GLenum +vertexAttribArrayBufferBinding = 34975 + +vertexAttribArrayEnabled :: GLenum +vertexAttribArrayEnabled = 34338 + +vertexAttribArrayNormalized :: GLenum +vertexAttribArrayNormalized = 34922 + +vertexAttribArrayPointer :: GLenum +vertexAttribArrayPointer = 34373 + +vertexAttribArraySize :: GLenum +vertexAttribArraySize = 34339 + +vertexAttribArrayStride :: GLenum +vertexAttribArrayStride = 34340 + +vertexAttribArrayType :: GLenum +vertexAttribArrayType = 34341 + +vertexShader :: GLenum +vertexShader = 35633 + +viewport :: GLenum +viewport = 2978 + +zero :: GLenum +zero = 0 + diff --git a/src/Graphics/WebGL/Raw/Types.purs b/src/Graphics/WebGL/Raw/Types.purs new file mode 100644 index 0000000..2cc4c42 --- /dev/null +++ b/src/Graphics/WebGL/Raw/Types.purs @@ -0,0 +1,45 @@ +module Graphics.WebGL.Raw.Types where + +import Data.ArrayBuffer.Types + +type DOMString = String +type BufferDataSource = Float32Array +type FloatArray = Float32Array +type GLbitfield = Int +type GLboolean = Boolean +type GLbyte = Int +type GLclampf = Number +type GLenum = Int +type GLfloat = Number +type GLint = Int +type GLintptr = Int +type GLshort = Int +type GLsizei = Int +type GLsizeiptr = Int +type GLubyte = Int +type GLuint = Int +type GLushort = Int + +foreign import data ArrayBufferView :: * +foreign import data TexImageSource :: * +foreign import data WebGLActiveInfo :: * +foreign import data WebGLBuffer :: * +foreign import data WebGLContext :: * +foreign import data WebGLFramebuffer :: * +foreign import data WebGLProgram :: * +foreign import data WebGLRenderbuffer :: * +foreign import data WebGLShader :: * +foreign import data WebGLShaderPrecisionFormat :: * +foreign import data WebGLTexture :: * +foreign import data WebGLUniformLocation :: * + +type WebGLContextAttributes = + { alpha :: Boolean + , depth :: Boolean + , stencil :: Boolean + , antialias :: Boolean + , premultipliedAlpha :: Boolean + , preserveDrawingBuffer :: Boolean + , preferLowPowerToHighPerformance :: Boolean + , failIfMajorPerformanceCaveat :: Boolean + } diff --git a/src/Graphics/WebGL/Raw/Util.js b/src/Graphics/WebGL/Raw/Util.js new file mode 100644 index 0000000..a3e63fe --- /dev/null +++ b/src/Graphics/WebGL/Raw/Util.js @@ -0,0 +1,19 @@ +"use strict"; + +// module Graphics.WebGL.Raw.Util + +exports.toMaybeImpl = function (Nothing, Just, x) { + if (x === undefined || x === null) { + return Nothing; + } else { + return Just(x); + } +} + +exports.nullAsEmpty = function (x) { + if (x === undefined || x === null) { + return []; + } else { + return x; + } +} diff --git a/src/Graphics/WebGL/Raw/Util.purs b/src/Graphics/WebGL/Raw/Util.purs new file mode 100644 index 0000000..da642e2 --- /dev/null +++ b/src/Graphics/WebGL/Raw/Util.purs @@ -0,0 +1,14 @@ +module Graphics.WebGL.Raw.Util +( toMaybe +, nullAsEmpty +) where + +import Data.Function (Fn3 (..), runFn3) +import Data.Maybe (Maybe (..)) + +foreign import toMaybeImpl :: forall a. Fn3 (Maybe a) (a -> Maybe a) a (Maybe a) + +toMaybe :: forall a. a -> Maybe a +toMaybe x = runFn3 toMaybeImpl Nothing Just x + +foreign import nullAsEmpty :: forall a. Array a -> Array a diff --git a/src/IDL/AST.hs b/src/IDL/AST.hs deleted file mode 100644 index aa79e04..0000000 --- a/src/IDL/AST.hs +++ /dev/null @@ -1,60 +0,0 @@ ------------------------------------------------------------------------------ --- --- Module : IDL.AST --- Copyright : --- License : GPL-2 --- --- Maintainer : jnf@arcor.de --- Stability : --- Portability : --- --- | --- ------------------------------------------------------------------------------ - -module IDL.AST where - -type Idl = [Decl] - -isEnum :: Decl -> Bool -isEnum Enum{} = True -isEnum _ = False - -isFunction :: Decl -> Bool -isFunction Function{} = True -isFunction _ = False - -data Decl = - Enum - { enumName :: String - , enumValue :: Integer - } - | - Comment - { comment :: String - } - | Function - { methodName :: String - , methodRetType :: Type - , methodArgs :: [Arg] - , methodRaises :: Maybe String - } - | Attribute - { attIsReadonly :: Bool - , attType :: Type - , attName :: String - } - deriving (Eq,Show) - -data Type = - Type { typeName :: String - , typeIsArray :: Bool - , typeCondPara :: Maybe String} - deriving (Eq,Show) - -data Arg = - Arg {argType :: Type, - argName :: String} - deriving (Eq,Show) - - diff --git a/src/IDL/Parser.hs b/src/IDL/Parser.hs deleted file mode 100644 index a6136c1..0000000 --- a/src/IDL/Parser.hs +++ /dev/null @@ -1,119 +0,0 @@ ------------------------------------------------------------------------------ --- --- Module : IDL.Parser --- Copyright : --- License : GPL-2 --- --- Maintainer : jnf@arcor.de --- Stability : --- Portability : --- --- | --- ------------------------------------------------------------------------------ - -module IDL.Parser ( - idlParser -) where - -import IDL.AST - -import qualified Text.Parsec.Token as PP -import qualified Text.Parsec as PP -import qualified Text.Parsec.Error as PP -import Data.Functor.Identity (Identity(..)) -import qualified Text.ParserCombinators.Parsec.Language as PP -import qualified Text.ParserCombinators.Parsec as PP (Parser) -import Control.Monad (liftM) -trace _ b = b - -type Parse a = PP.Parsec String () a - -idlParser :: Parse Idl -idlParser = PP.manyTill - (do whiteSpace' - d <- declParser - trace ("decl: " ++ show d) $ return d) - PP.eof - PP. "expecting idl" - -lexer :: PP.GenTokenParser String u Identity -lexer = PP.makeTokenParser PP.emptyDef - -symbol' = PP.symbol lexer -whiteSpace' = PP.whiteSpace lexer -identifier' = PP.identifier lexer -integer' = PP.integer lexer -semi' = PP.semi lexer -parens' = PP.parens lexer -brackets' = PP.brackets lexer -angles' = PP.angles lexer - -declParser :: Parse Decl -declParser = PP.try (do - symbol' "const" - symbol' "GLenum" - name <- identifier' - symbol' "=" - value <- integer' - semi' - return Enum { - enumName = name, - enumValue = value}) - PP.<|> PP.try (do - symbol' "/*" - comment <- PP.manyTill PP.anyChar (symbol' "*/") - return (Comment {comment = comment})) - PP.<|> PP.try (do - returnType <- parseType - methodName <- identifier' - args <- parens' (PP.sepBy parseArg (symbol' ",")) - condRaises <- PP.option Nothing parseRaises - semi' - return (Function - { methodName = methodName, - methodRetType = returnType, - methodArgs = args, - methodRaises = condRaises})) - PP.<|> PP.try (do - isReadonly <- PP.option False (do - symbol' "readonly" - return True) - symbol' "attribute" - typ <- parseType - name <- identifier' - semi' - return (Attribute - { attIsReadonly = isReadonly, - attType = typ, - attName = name})) - PP. "expecting decl" - -parseType :: Parse Type -parseType = do - id <- identifier' - isArray <- PP.option False (do - brackets' whiteSpace' - return True) - condPara <- if id == "sequence" - then (do - id <- angles' identifier' - return (Just id)) - else return Nothing - return (Type {typeName = id, - typeIsArray = isArray, - typeCondPara = condPara}) - PP. "expecting type" - -parseArg :: Parse Arg -parseArg = do - typ <- parseType - id <- identifier' - return (Arg {argType = typ, - argName = id}) - -parseRaises :: Parse (Maybe String) -parseRaises = do - symbol' "raises" - liftM Just (parens' identifier') - diff --git a/src/IDL/Printer.hs b/src/IDL/Printer.hs deleted file mode 100644 index f3e0f02..0000000 --- a/src/IDL/Printer.hs +++ /dev/null @@ -1,142 +0,0 @@ ------------------------------------------------------------------------------ --- --- Module : IDL.Printer --- Copyright : --- License : GPL-2 --- --- Maintainer : jnf@arcor.de --- Stability : --- Portability : --- --- | --- ------------------------------------------------------------------------------ - -module IDL.Printer ( - ppPureScriptFFI -) where - -import IDL.AST - -import Text.PrettyPrint - (sep, ($$), hcat, punctuate, semi, braces, empty, parens, nest, - (<>), integer, (<+>), text, vcat, ($+$), Doc) -import Data.List (nubBy, nub) -import Data.Maybe (isNothing) - -ppPureScriptFFI :: Idl -> Doc -ppPureScriptFFI idl = - header - $+$ text "-- *TypeDecls" $+$ typeDecls $+$ text "" - $+$ text "-- *Constants" $+$ constants $+$ text "" - $+$ text "-- *Methods" $+$ methods - - where - header = vcat (map text - (["-- Auto generated: don't change manually, use purescript-webgl-generator to modify!!", - "module Graphics.WebGLRaw where", - "", - "import Control.Monad.Eff", - "import Control.Monad.Eff.WebGL", - "import Data.ArrayBuffer.Types", - "import Data.TypedArray", - "", - ""] ++ typedefs)) - - typeDecls = vcat $ map printTypeDecl $ nubBy (\t1 t2-> typeName t1 == typeName t2) - [t | d <- idl, t <- extractTypes d, not ((typeName t) `elem` standardTypes)] - printTypeDecl d = text "foreign import data" <+> text (typeName d) <+> text ":: *" - - constants = vcat [printConstant c | c <- idl , isEnum c] - printConstant Enum{enumName = n,enumValue = v} = - (text (makeConstantName n) <+> text "::" <+> text "Number") - $+$ (text (makeConstantName n) <+> text "=" <+> integer v) - $+$ text "" - - methods = vcat $ map printMethod $ nubBy (\t1 t2-> methodName t1 == methodName t2) - [c | c <- idl , isUsableFunction c] - printMethod f = - text "foreign import" <+> text (methodName f) <> text "_" $$ - nest 2 (javascriptQuotes (printJavascript f (methodArgs f)) $$ - nest 2 (printPurescriptTypes f)) - $$ text "" - printJavascript f args = - nest 2 (text "function" <+> text (methodName f) <> text "_" <> - (parens (if null (methodArgs f) - then empty - else text (argName (head (methodArgs f)))))) - $$ braces (nest 2 (printJavascriptRest f (methodArgs f))) <> semi - printJavascriptRest f (hd:tl) = - text "return" <+> text "function" - <> parens (if null tl - then empty - else text (argName (head tl))) - $$ braces (nest 2 (printJavascriptRest f tl)) <> semi - printJavascriptRest f [] | typeName (methodRetType f) == "void" = - text "gl." <> text (methodName f) <> parens - (hcat (punctuate (text ",") (map (text . argName) (methodArgs f)))) <> semi - | otherwise = - text "var res = gl." <> text (methodName f) <> parens - (hcat (punctuate (text ",") (map (text . argName) (methodArgs f)))) <> semi - $$ text "if (res === undefined){" - $$ text " throw \"Undefined in " <+> text (methodName f) <> text "\"}" <> semi - $$ text "return res" <> semi - printPurescriptTypes f | typeName (methodRetType f) == "any" || - typeName (methodRetType f) == "object" = - text ":: forall eff ret." <+> - sep ((punctuate (text "->") (map (pureScriptType . argType) (methodArgs f))) - ++ [(if null (methodArgs f) - then empty - else text "->") <+> parens ( - text "Eff (webgl :: WebGl | eff) ret")]) - printPurescriptTypes f = text ":: forall eff." <+> - sep ((punctuate (text "->") (map (pureScriptType . argType) (methodArgs f))) - ++ [(if null (methodArgs f) - then empty - else text "->") <+> parens ( - text "Eff (webgl :: WebGl | eff)" <+> - pureScriptType (methodRetType f))]) - pureScriptType Type{typeName = t} | t == "void" = text "Unit" - pureScriptType Type{typeName = t} | t == "boolean" = text "Boolean" - pureScriptType Type{typeName = t} | t == "DOMString" = text "String" - pureScriptType Type{typeName = t} | t == "ArrayBuffer" = text "Float32Array" - pureScriptType Type{typeName = t} = text t - -makeConstantName n = '_' : n - -javascriptQuotes :: Doc -> Doc -javascriptQuotes p = text "\"\"\"" <> p <> text "\"\"\"" - -extractTypes :: Decl -> [Type] -extractTypes Function{methodRetType = t1, methodArgs = args} = t1 : map extractArgType args -extractTypes Attribute{attType = t1} = [t1] -extractTypes _ = [] - -extractArgType :: Arg -> Type -extractArgType Arg{argType = t} = t - -isUsableFunction i = - isFunction i && and (map (isNothing . typeCondPara . argType) (methodArgs i)) - -standardTypes = ["GLenum", "GLboolean", "GLbitfield", "GLbyte","GLshort","GLint", - "GLsizei","GLintptr","GLsizeiptr","GLubyte","GLushort","GLuint","GLfloat","GLclampf", - "sequence", "void","boolean","any","object","DOMString","HTMLCanvasElement", - "Float32Array","Int32Array","FloatArray","ArrayBuffer"] - -typedefs = [ - "type GLenum = Number", - "type GLboolean = Boolean", - "type GLbitfield = Number", - "type GLbyte = Number", - "type GLshort = Number", - "type GLint = Number", - "type GLsizei = Number", - "type GLintptr = Number", - "type GLsizeiptr = Number", - "type GLubyte = Number", - "type GLushort = Number", - "type GLuint = Number", - "type GLfloat = Number", - "type GLclampf = Number", - "type FloatArray = Float32Array", - ""] diff --git a/src/Main.hs b/src/Main.hs deleted file mode 100644 index 39051a8..0000000 --- a/src/Main.hs +++ /dev/null @@ -1,43 +0,0 @@ ------------------------------------------------------------------------------ --- --- Module : Main --- Copyright : --- License : GPL-2 --- --- Maintainer : jnf@arcor.de --- Stability : --- Portability : --- --- | --- ------------------------------------------------------------------------------ - -module Main where - - -import IDL.AST -import IDL.Parser -import IDL.Printer - -import System.Console.GetOpt (usageInfo) -import System.Environment (getArgs) -import System.Exit (exitSuccess) -import qualified Text.Parsec as PP (runParser) -import qualified Text.Parsec.Error as PP - (errorMessages, messageString) -import Debug.Trace (trace) -import Text.PrettyPrint (render) - -main :: IO () -main = do - args <- getArgs - fp <- case args of - [] -> do - putStrLn $ "Generator requires input idl file" - exitSuccess - (hd:_) -> return (hd) - string <- readFile fp - case PP.runParser idlParser () "" string of - Left error -> mapM_ (putStrLn . PP.messageString) (PP.errorMessages error) - Right idl -> putStr (render (ppPureScriptFFI idl)) -