[fpc-pascal] pas2js Webgl unit committed

Ryan Joseph ryan at thealchemistguild.com
Wed May 2 11:28:10 CEST 2018



> On May 2, 2018, at 2:08 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> Yes. the fpmkunit needs to be the latest version, for the AddLibrary call. I will see if I can work around it.

So I need to build the entire compiler and I get pas2js in the end? I didn’t realize it was built on the entire FPC compiler but I guess that makes sense.

Just for fun I made a PHP script to parse that .idl file. :) Not sure if it works on other files but it only took a few hours and seems to work ok. Should be easy to hack with.

https://github.com/genericptr/pas2js-IDL-parser

php pas2js_idl_parser.php /Users/ryanjoseph/Downloads/webgl.idl 

========

unit webgl;

{$mode objfpc}
{$modeswitch externalclass}

interface
uses
  JS, Web;

  type GLenum = cardinal;
  type GLboolean = boolean;
  type GLbitfield = cardinal;
  type GLbyte = shortint;
  type GLshort = short;
  type GLint = integer;
  type GLsizei = integer;
  type GLintptr = nativeint;
  type GLsizeiptr = nativeint;
  type GLubyte = byte;
  type GLushort = word;
  type GLuint = cardinal;
  type GLfloat = double;
  type GLclampf = double;
  class TJSWebGLContextAttributes = external name 'WebGLContextAttributes' (TJSObject)
  public
    alpha: GLboolean;
    depth: GLboolean;
    stencil: GLboolean;
    antialias: GLboolean;
    premultipliedAlpha: GLboolean;
    preserveDrawingBuffer: GLboolean;
    powerPreference: WebGLPowerPreference;
    failIfMajorPerformanceCaveat: GLboolean;
  end;

  class TJSWebGLObject = external name 'WebGLObject' (TJSObject);
  class TJSWebGLBuffer = external name 'WebGLBuffer' (TJSWebGLObject);
  class TJSWebGLFramebuffer = external name 'WebGLFramebuffer' (TJSWebGLObject);
  class TJSWebGLProgram = external name 'WebGLProgram' (TJSWebGLObject);
  class TJSWebGLRenderbuffer = external name 'WebGLRenderbuffer' (TJSWebGLObject);
  class TJSWebGLShader = external name 'WebGLShader' (TJSWebGLObject);
  class TJSWebGLTexture = external name 'WebGLTexture' (TJSWebGLObject);
  class TJSWebGLUniformLocation = external name 'WebGLUniformLocation' (TJSObject);
  class TJSWebGLActiveInfo = external name 'WebGLActiveInfo' (TJSObject)
  private
    Fsize: GLint; external name 'size';
    Ftype: GLenum; external name 'type';
    Fname: DOMString; external name 'name';
  public
    property size: GLint read Fsize;
    property type: GLenum read Ftype;
    property name: DOMString read Fname;
  end;

  class TJSWebGLShaderPrecisionFormat = external name 'WebGLShaderPrecisionFormat' (TJSObject)
  private
    FrangeMin: GLint; external name 'rangeMin';
    FrangeMax: GLint; external name 'rangeMax';
    Fprecision: GLint; external name 'precision';
  public
    property rangeMin: GLint read FrangeMin;
    property rangeMax: GLint read FrangeMax;
    property precision: GLint read Fprecision;
  end;

  class TJSWebGLRenderingContextBase = external name 'WebGLRenderingContextBase' (TJSObject)
  private
    Fcanvas: HTMLCanvasElement; external name 'canvas';
    FdrawingBufferWidth: GLsizei; external name 'drawingBufferWidth';
    FdrawingBufferHeight: GLsizei; external name 'drawingBufferHeight';
  public
    const DEPTH_BUFFER_BIT: nativeint;
    const STENCIL_BUFFER_BIT: nativeint;
    const COLOR_BUFFER_BIT: nativeint;
    const POINTS: nativeint;
    const LINES: nativeint;
    const LINE_LOOP: nativeint;
    const LINE_STRIP: nativeint;
    const TRIANGLES: nativeint;
    const TRIANGLE_STRIP: nativeint;
    const TRIANGLE_FAN: nativeint;
    const ZERO: nativeint;
    const ONE: nativeint;
    const SRC_COLOR: nativeint;
    const ONE_MINUS_SRC_COLOR: nativeint;
    const SRC_ALPHA: nativeint;
    const ONE_MINUS_SRC_ALPHA: nativeint;
    const DST_ALPHA: nativeint;
    const ONE_MINUS_DST_ALPHA: nativeint;
    const DST_COLOR: nativeint;
    const ONE_MINUS_DST_COLOR: nativeint;
    const SRC_ALPHA_SATURATE: nativeint;
    const FUNC_ADD: nativeint;
    const BLEND_EQUATION: nativeint;
    const BLEND_EQUATION_RGB: nativeint;
    const BLEND_EQUATION_ALPHA: nativeint;
    const FUNC_SUBTRACT: nativeint;
    const FUNC_REVERSE_SUBTRACT: nativeint;
    const BLEND_DST_RGB: nativeint;
    const BLEND_SRC_RGB: nativeint;
    const BLEND_DST_ALPHA: nativeint;
    const BLEND_SRC_ALPHA: nativeint;
    const CONSTANT_COLOR: nativeint;
    const ONE_MINUS_CONSTANT_COLOR: nativeint;
    const CONSTANT_ALPHA: nativeint;
    const ONE_MINUS_CONSTANT_ALPHA: nativeint;
    const BLEND_COLOR: nativeint;
    const ARRAY_BUFFER: nativeint;
    const ELEMENT_ARRAY_BUFFER: nativeint;
    const ARRAY_BUFFER_BINDING: nativeint;
    const ELEMENT_ARRAY_BUFFER_BINDING: nativeint;
    const STREAM_DRAW: nativeint;
    const STATIC_DRAW: nativeint;
    const DYNAMIC_DRAW: nativeint;
    const BUFFER_SIZE: nativeint;
    const BUFFER_USAGE: nativeint;
    const CURRENT_VERTEX_ATTRIB: nativeint;
    const FRONT: nativeint;
    const BACK: nativeint;
    const FRONT_AND_BACK: nativeint;
    const CULL_FACE: nativeint;
    const BLEND: nativeint;
    const DITHER: nativeint;
    const STENCIL_TEST: nativeint;
    const DEPTH_TEST: nativeint;
    const SCISSOR_TEST: nativeint;
    const POLYGON_OFFSET_FILL: nativeint;
    const SAMPLE_ALPHA_TO_COVERAGE: nativeint;
    const SAMPLE_COVERAGE: nativeint;
    const NO_ERROR: nativeint;
    const INVALID_ENUM: nativeint;
    const INVALID_VALUE: nativeint;
    const INVALID_OPERATION: nativeint;
    const OUT_OF_MEMORY: nativeint;
    const CW: nativeint;
    const CCW: nativeint;
    const LINE_WIDTH: nativeint;
    const ALIASED_POINT_SIZE_RANGE: nativeint;
    const ALIASED_LINE_WIDTH_RANGE: nativeint;
    const CULL_FACE_MODE: nativeint;
    const FRONT_FACE: nativeint;
    const DEPTH_RANGE: nativeint;
    const DEPTH_WRITEMASK: nativeint;
    const DEPTH_CLEAR_VALUE: nativeint;
    const DEPTH_FUNC: nativeint;
    const STENCIL_CLEAR_VALUE: nativeint;
    const STENCIL_FUNC: nativeint;
    const STENCIL_FAIL: nativeint;
    const STENCIL_PASS_DEPTH_FAIL: nativeint;
    const STENCIL_PASS_DEPTH_PASS: nativeint;
    const STENCIL_REF: nativeint;
    const STENCIL_VALUE_MASK: nativeint;
    const STENCIL_WRITEMASK: nativeint;
    const STENCIL_BACK_FUNC: nativeint;
    const STENCIL_BACK_FAIL: nativeint;
    const STENCIL_BACK_PASS_DEPTH_FAIL: nativeint;
    const STENCIL_BACK_PASS_DEPTH_PASS: nativeint;
    const STENCIL_BACK_REF: nativeint;
    const STENCIL_BACK_VALUE_MASK: nativeint;
    const STENCIL_BACK_WRITEMASK: nativeint;
    const VIEWPORT: nativeint;
    const SCISSOR_BOX: nativeint;
    const COLOR_CLEAR_VALUE: nativeint;
    const COLOR_WRITEMASK: nativeint;
    const UNPACK_ALIGNMENT: nativeint;
    const PACK_ALIGNMENT: nativeint;
    const MAX_TEXTURE_SIZE: nativeint;
    const MAX_VIEWPORT_DIMS: nativeint;
    const SUBPIXEL_BITS: nativeint;
    const RED_BITS: nativeint;
    const GREEN_BITS: nativeint;
    const BLUE_BITS: nativeint;
    const ALPHA_BITS: nativeint;
    const DEPTH_BITS: nativeint;
    const STENCIL_BITS: nativeint;
    const POLYGON_OFFSET_UNITS: nativeint;
    const POLYGON_OFFSET_FACTOR: nativeint;
    const TEXTURE_BINDING_2D: nativeint;
    const SAMPLE_BUFFERS: nativeint;
    const SAMPLES: nativeint;
    const SAMPLE_COVERAGE_VALUE: nativeint;
    const SAMPLE_COVERAGE_INVERT: nativeint;
    const COMPRESSED_TEXTURE_FORMATS: nativeint;
    const DONT_CARE: nativeint;
    const FASTEST: nativeint;
    const NICEST: nativeint;
    const GENERATE_MIPMAP_HINT: nativeint;
    const BYTE: nativeint;
    const UNSIGNED_BYTE: nativeint;
    const SHORT: nativeint;
    const UNSIGNED_SHORT: nativeint;
    const INT: nativeint;
    const UNSIGNED_INT: nativeint;
    const FLOAT: nativeint;
    const DEPTH_COMPONENT: nativeint;
    const ALPHA: nativeint;
    const RGB: nativeint;
    const RGBA: nativeint;
    const LUMINANCE: nativeint;
    const LUMINANCE_ALPHA: nativeint;
    const UNSIGNED_SHORT_4_4_4_4: nativeint;
    const UNSIGNED_SHORT_5_5_5_1: nativeint;
    const UNSIGNED_SHORT_5_6_5: nativeint;
    const FRAGMENT_SHADER: nativeint;
    const VERTEX_SHADER: nativeint;
    const MAX_VERTEX_ATTRIBS: nativeint;
    const MAX_VERTEX_UNIFORM_VECTORS: nativeint;
    const MAX_VARYING_VECTORS: nativeint;
    const MAX_COMBINED_TEXTURE_IMAGE_UNITS: nativeint;
    const MAX_VERTEX_TEXTURE_IMAGE_UNITS: nativeint;
    const MAX_TEXTURE_IMAGE_UNITS: nativeint;
    const MAX_FRAGMENT_UNIFORM_VECTORS: nativeint;
    const SHADER_TYPE: nativeint;
    const DELETE_STATUS: nativeint;
    const LINK_STATUS: nativeint;
    const VALIDATE_STATUS: nativeint;
    const ATTACHED_SHADERS: nativeint;
    const ACTIVE_UNIFORMS: nativeint;
    const ACTIVE_ATTRIBUTES: nativeint;
    const SHADING_LANGUAGE_VERSION: nativeint;
    const CURRENT_PROGRAM: nativeint;
    const NEVER: nativeint;
    const LESS: nativeint;
    const EQUAL: nativeint;
    const LEQUAL: nativeint;
    const GREATER: nativeint;
    const NOTEQUAL: nativeint;
    const GEQUAL: nativeint;
    const ALWAYS: nativeint;
    const KEEP: nativeint;
    const REPLACE: nativeint;
    const INCR: nativeint;
    const DECR: nativeint;
    const INVERT: nativeint;
    const INCR_WRAP: nativeint;
    const DECR_WRAP: nativeint;
    const VENDOR: nativeint;
    const RENDERER: nativeint;
    const VERSION: nativeint;
    const NEAREST: nativeint;
    const LINEAR: nativeint;
    const NEAREST_MIPMAP_NEAREST: nativeint;
    const LINEAR_MIPMAP_NEAREST: nativeint;
    const NEAREST_MIPMAP_LINEAR: nativeint;
    const LINEAR_MIPMAP_LINEAR: nativeint;
    const TEXTURE_MAG_FILTER: nativeint;
    const TEXTURE_MIN_FILTER: nativeint;
    const TEXTURE_WRAP_S: nativeint;
    const TEXTURE_WRAP_T: nativeint;
    const TEXTURE_2D: nativeint;
    const TEXTURE: nativeint;
    const TEXTURE_CUBE_MAP: nativeint;
    const TEXTURE_BINDING_CUBE_MAP: nativeint;
    const TEXTURE_CUBE_MAP_POSITIVE_X: nativeint;
    const TEXTURE_CUBE_MAP_NEGATIVE_X: nativeint;
    const TEXTURE_CUBE_MAP_POSITIVE_Y: nativeint;
    const TEXTURE_CUBE_MAP_NEGATIVE_Y: nativeint;
    const TEXTURE_CUBE_MAP_POSITIVE_Z: nativeint;
    const TEXTURE_CUBE_MAP_NEGATIVE_Z: nativeint;
    const MAX_CUBE_MAP_TEXTURE_SIZE: nativeint;
    const TEXTURE0: nativeint;
    const TEXTURE1: nativeint;
    const TEXTURE2: nativeint;
    const TEXTURE3: nativeint;
    const TEXTURE4: nativeint;
    const TEXTURE5: nativeint;
    const TEXTURE6: nativeint;
    const TEXTURE7: nativeint;
    const TEXTURE8: nativeint;
    const TEXTURE9: nativeint;
    const TEXTURE10: nativeint;
    const TEXTURE11: nativeint;
    const TEXTURE12: nativeint;
    const TEXTURE13: nativeint;
    const TEXTURE14: nativeint;
    const TEXTURE15: nativeint;
    const TEXTURE16: nativeint;
    const TEXTURE17: nativeint;
    const TEXTURE18: nativeint;
    const TEXTURE19: nativeint;
    const TEXTURE20: nativeint;
    const TEXTURE21: nativeint;
    const TEXTURE22: nativeint;
    const TEXTURE23: nativeint;
    const TEXTURE24: nativeint;
    const TEXTURE25: nativeint;
    const TEXTURE26: nativeint;
    const TEXTURE27: nativeint;
    const TEXTURE28: nativeint;
    const TEXTURE29: nativeint;
    const TEXTURE30: nativeint;
    const TEXTURE31: nativeint;
    const ACTIVE_TEXTURE: nativeint;
    const REPEAT: nativeint;
    const CLAMP_TO_EDGE: nativeint;
    const MIRRORED_REPEAT: nativeint;
    const FLOAT_VEC2: nativeint;
    const FLOAT_VEC3: nativeint;
    const FLOAT_VEC4: nativeint;
    const INT_VEC2: nativeint;
    const INT_VEC3: nativeint;
    const INT_VEC4: nativeint;
    const BOOL: nativeint;
    const BOOL_VEC2: nativeint;
    const BOOL_VEC3: nativeint;
    const BOOL_VEC4: nativeint;
    const FLOAT_MAT2: nativeint;
    const FLOAT_MAT3: nativeint;
    const FLOAT_MAT4: nativeint;
    const SAMPLER_2D: nativeint;
    const SAMPLER_CUBE: nativeint;
    const VERTEX_ATTRIB_ARRAY_ENABLED: nativeint;
    const VERTEX_ATTRIB_ARRAY_SIZE: nativeint;
    const VERTEX_ATTRIB_ARRAY_STRIDE: nativeint;
    const VERTEX_ATTRIB_ARRAY_TYPE: nativeint;
    const VERTEX_ATTRIB_ARRAY_NORMALIZED: nativeint;
    const VERTEX_ATTRIB_ARRAY_POINTER: nativeint;
    const VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: nativeint;
    const IMPLEMENTATION_COLOR_READ_TYPE: nativeint;
    const IMPLEMENTATION_COLOR_READ_FORMAT: nativeint;
    const COMPILE_STATUS: nativeint;
    const LOW_FLOAT: nativeint;
    const MEDIUM_FLOAT: nativeint;
    const HIGH_FLOAT: nativeint;
    const LOW_INT: nativeint;
    const MEDIUM_INT: nativeint;
    const HIGH_INT: nativeint;
    const FRAMEBUFFER: nativeint;
    const RENDERBUFFER: nativeint;
    const RGBA4: nativeint;
    const RGB5_A1: nativeint;
    const RGB565: nativeint;
    const DEPTH_COMPONENT16: nativeint;
    const STENCIL_INDEX8: nativeint;
    const DEPTH_STENCIL: nativeint;
    const RENDERBUFFER_WIDTH: nativeint;
    const RENDERBUFFER_HEIGHT: nativeint;
    const RENDERBUFFER_INTERNAL_FORMAT: nativeint;
    const RENDERBUFFER_RED_SIZE: nativeint;
    const RENDERBUFFER_GREEN_SIZE: nativeint;
    const RENDERBUFFER_BLUE_SIZE: nativeint;
    const RENDERBUFFER_ALPHA_SIZE: nativeint;
    const RENDERBUFFER_DEPTH_SIZE: nativeint;
    const RENDERBUFFER_STENCIL_SIZE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: nativeint;
    const FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: nativeint;
    const FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: nativeint;
    const COLOR_ATTACHMENT0: nativeint;
    const DEPTH_ATTACHMENT: nativeint;
    const STENCIL_ATTACHMENT: nativeint;
    const DEPTH_STENCIL_ATTACHMENT: nativeint;
    const NONE: nativeint;
    const FRAMEBUFFER_COMPLETE: nativeint;
    const FRAMEBUFFER_INCOMPLETE_ATTACHMENT: nativeint;
    const FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: nativeint;
    const FRAMEBUFFER_INCOMPLETE_DIMENSIONS: nativeint;
    const FRAMEBUFFER_UNSUPPORTED: nativeint;
    const FRAMEBUFFER_BINDING: nativeint;
    const RENDERBUFFER_BINDING: nativeint;
    const MAX_RENDERBUFFER_SIZE: nativeint;
    const INVALID_FRAMEBUFFER_OPERATION: nativeint;
    const UNPACK_FLIP_Y_WEBGL: nativeint;
    const UNPACK_PREMULTIPLY_ALPHA_WEBGL: nativeint;
    const CONTEXT_LOST_WEBGL: nativeint;
    const UNPACK_COLORSPACE_CONVERSION_WEBGL: nativeint;
    const BROWSER_DEFAULT_WEBGL: nativeint;
    property canvas: HTMLCanvasElement read Fcanvas;
    property drawingBufferWidth: GLsizei read FdrawingBufferWidth;
    property drawingBufferHeight: GLsizei read FdrawingBufferHeight;
    function getContextAttributes: TJSWebGLContextAttributes;
    function isContextLost: boolean;
    function getSupportedExtensions: DOMStringDynArray;
    function getExtension (name: DOMString): TJSobject;
    procedure activeTexture (texture: GLenum);
    procedure attachShader (program: WebGLProgram; shader: WebGLShader);
    procedure bindAttribLocation (program: WebGLProgram; index: GLuint; name: DOMString);
    procedure bindBuffer (target: GLenum; buffer: TJSWebGLBuffer);
    procedure bindFramebuffer (target: GLenum; framebuffer: TJSWebGLFramebuffer);
    procedure bindRenderbuffer (target: GLenum; renderbuffer: TJSWebGLRenderbuffer);
    procedure bindTexture (target: GLenum; texture: TJSWebGLTexture);
    procedure blendColor (red: GLclampf; green: GLclampf; blue: GLclampf; alpha: GLclampf);
    procedure blendEquation (mode: GLenum);
    procedure blendEquationSeparate (modeRGB: GLenum; modeAlpha: GLenum);
    procedure blendFunc (sfactor: GLenum; dfactor: GLenum);
    procedure bufferData (target: GLenum; size: GLsizeiptr; usage: GLenum);
    procedure bufferData (target: GLenum; data: BufferSource; usage: GLenum);
    procedure bufferSubData (target: GLenum; offset: GLintptr; data: BufferSource);
    function checkFramebufferStatus (target: GLenum): GLenum;
    procedure clear (mask: GLbitfield);
    procedure clearColor (red: GLclampf; green: GLclampf; blue: GLclampf; alpha: GLclampf);
    procedure clearDepth (depth: GLclampf);
    procedure clearStencil (s: GLint);
    procedure colorMask (red: GLboolean; green: GLboolean; blue: GLboolean; alpha: GLboolean);
    procedure compileShader (shader: WebGLShader);
    function createBuffer: TJSWebGLBuffer;
    function createFramebuffer: TJSWebGLFramebuffer;
    function createProgram: TJSWebGLProgram;
    function createRenderbuffer: TJSWebGLRenderbuffer;
    function createShader (type: GLenum): TJSWebGLShader;
    function createTexture: TJSWebGLTexture;
    procedure cullFace (mode: GLenum);
    procedure deleteBuffer (buffer: TJSWebGLBuffer);
    procedure deleteFramebuffer (framebuffer: TJSWebGLFramebuffer);
    procedure deleteProgram (program: TJSWebGLProgram);
    procedure deleteRenderbuffer (renderbuffer: TJSWebGLRenderbuffer);
    procedure deleteShader (shader: TJSWebGLShader);
    procedure deleteTexture (texture: TJSWebGLTexture);
    procedure depthFunc (func: GLenum);
    procedure depthMask (flag: GLboolean);
    procedure depthRange (zNear: GLclampf; zFar: GLclampf);
    procedure detachShader (program: WebGLProgram; shader: WebGLShader);
    procedure disable (cap: GLenum);
    procedure disableVertexAttribArray (index: GLuint);
    procedure drawArrays (mode: GLenum; first: GLint; count: GLsizei);
    procedure drawElements (mode: GLenum; count: GLsizei; type: GLenum; offset: GLintptr);
    procedure enable (cap: GLenum);
    procedure enableVertexAttribArray (index: GLuint);
    procedure finish;
    procedure flush;
    procedure frontFace (mode: GLenum);
    procedure generateMipmap (target: GLenum);
    function getActiveAttrib (program: WebGLProgram; index: GLuint): TJSWebGLActiveInfo;
    function getActiveUniform (program: WebGLProgram; index: GLuint): TJSWebGLActiveInfo;
    function getAttachedShaders (program: WebGLProgram): WebGLShaderDynArray;
    function getAttribLocation (program: WebGLProgram; name: DOMString): GLint;
    function getBufferParameter (target: GLenum; pname: GLenum): JSValue;
    function getParameter (pname: GLenum): JSValue;
    function getError: GLenum;
    function getProgramParameter (program: WebGLProgram; pname: GLenum): JSValue;
    function getProgramInfoLog (program: WebGLProgram): TJSDOMString;
    function getRenderbufferParameter (target: GLenum; pname: GLenum): JSValue;
    function getShaderParameter (shader: WebGLShader; pname: GLenum): JSValue;
    function getShaderPrecisionFormat (shadertype: GLenum; precisiontype: GLenum): TJSWebGLShaderPrecisionFormat;
    function getShaderInfoLog (shader: WebGLShader): TJSDOMString;
    function getShaderSource (shader: WebGLShader): TJSDOMString;
    function getTexParameter (target: GLenum; pname: GLenum): JSValue;
    function getUniform (program: WebGLProgram; location: WebGLUniformLocation): JSValue;
    function getUniformLocation (program: WebGLProgram; name: DOMString): TJSWebGLUniformLocation;
    function getVertexAttrib (index: GLuint; pname: GLenum): JSValue;
    function getVertexAttribOffset (index: GLuint; pname: GLenum): GLintptr;
    procedure hint (target: GLenum; mode: GLenum);
    function isBuffer (buffer: TJSWebGLBuffer): GLboolean;
    function isEnabled (cap: GLenum): GLboolean;
    function isFramebuffer (framebuffer: TJSWebGLFramebuffer): GLboolean;
    function isProgram (program: TJSWebGLProgram): GLboolean;
    function isRenderbuffer (renderbuffer: TJSWebGLRenderbuffer): GLboolean;
    function isShader (shader: TJSWebGLShader): GLboolean;
    function isTexture (texture: TJSWebGLTexture): GLboolean;
    procedure lineWidth (width: GLfloat);
    procedure linkProgram (program: WebGLProgram);
    procedure pixelStorei (pname: GLenum; param: GLint);
    procedure polygonOffset (factor: GLfloat; units: GLfloat);
    procedure sampleCoverage (value: GLclampf; invert: GLboolean);
    procedure scissor (x: GLint; y: GLint; width: GLsizei; height: GLsizei);
    procedure shaderSource (shader: WebGLShader; source: DOMString);
    procedure stencilFunc (func: GLenum; ref: GLint; mask: GLuint);
    procedure stencilFuncSeparate (face: GLenum; func: GLenum; ref: GLint; mask: GLuint);
    procedure stencilMask (mask: GLuint);
    procedure stencilMaskSeparate (face: GLenum; mask: GLuint);
    procedure stencilOp (fail: GLenum; zfail: GLenum; zpass: GLenum);
    procedure stencilOpSeparate (face: GLenum; fail: GLenum; zfail: GLenum; zpass: GLenum);
    procedure texParameterf (target: GLenum; pname: GLenum; param: GLfloat);
    procedure texParameteri (target: GLenum; pname: GLenum; param: GLint);
    procedure uniform1f (location: TJSWebGLUniformLocation; x: GLfloat);
    procedure uniform2f (location: TJSWebGLUniformLocation; x: GLfloat; y: GLfloat);
    procedure uniform3f (location: TJSWebGLUniformLocation; x: GLfloat; y: GLfloat; z: GLfloat);
    procedure uniform4f (location: TJSWebGLUniformLocation; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat);
    procedure uniform1i (location: TJSWebGLUniformLocation; x: GLint);
    procedure uniform2i (location: TJSWebGLUniformLocation; x: GLint; y: GLint);
    procedure uniform3i (location: TJSWebGLUniformLocation; x: GLint; y: GLint; z: GLint);
    procedure uniform4i (location: TJSWebGLUniformLocation; x: GLint; y: GLint; z: GLint; w: GLint);
    procedure uniform1fv (location: TJSWebGLUniformLocation; v: Float32List);
    procedure uniform2fv (location: TJSWebGLUniformLocation; v: Float32List);
    procedure uniform3fv (location: TJSWebGLUniformLocation; v: Float32List);
    procedure uniform4fv (location: TJSWebGLUniformLocation; v: Float32List);
    procedure uniform1iv (location: TJSWebGLUniformLocation; v: Int32List);
    procedure uniform2iv (location: TJSWebGLUniformLocation; v: Int32List);
    procedure uniform3iv (location: TJSWebGLUniformLocation; v: Int32List);
    procedure uniform4iv (location: TJSWebGLUniformLocation; v: Int32List);
    procedure uniformMatrix2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; value: Float32List);
    procedure uniformMatrix3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; value: Float32List);
    procedure uniformMatrix4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; value: Float32List);
    procedure useProgram (program: TJSWebGLProgram);
    procedure validateProgram (program: WebGLProgram);
    procedure vertexAttrib1f (index: GLuint; x: GLfloat);
    procedure vertexAttrib2f (index: GLuint; x: GLfloat; y: GLfloat);
    procedure vertexAttrib3f (index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat);
    procedure vertexAttrib4f (index: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat);
    procedure vertexAttrib1fv (index: GLuint; values: Float32List);
    procedure vertexAttrib2fv (index: GLuint; values: Float32List);
    procedure vertexAttrib3fv (index: GLuint; values: Float32List);
    procedure vertexAttrib4fv (index: GLuint; values: Float32List);
    procedure viewport (x: GLint; y: GLint; width: GLsizei; height: GLsizei);
  end;

  class TJSWebGLRenderingContext = external name 'WebGLRenderingContext' (TJSWebGLRenderingContextBase);
  class TJSWebGLContextEvent = external name 'WebGLContextEvent' (TJSEvent)
  private
    FstatusMessage: DOMString; external name 'statusMessage';
  public
    property statusMessage: DOMString read FstatusMessage;
  end;

  class TJSWebGLContextEventInit = external name 'WebGLContextEventInit' (TJSEventInit)
  public
    statusMessage: DOMString;
  end;


implementation
end;


Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list