pas2js Webgl unit committed

classic Classic list List threaded Threaded
50 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph


> On May 2, 2018, at 6:20 PM, Michael Van Canneyt <[hidden email]> wrote:
>
> Yes: You posted the link to 1.0.

I think it’s actually an extension to the original so nothing was lost. The original didn’t have vertex array objects so it’s best to have both.

https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl

That’s what my parser dumps out in current state (some bugs I know). I think TJSWebGL2RenderingContextBase is supposed to be a subclass of the first context base class to make it work.

unit webgl2;

{$mode objfpc}
{$modeswitch externalclass}

interface
uses
  JS, Web;

  type GLint64 = nativeint;
  type GLuint64 = unsigned long long;
  class TJSWebGLQuery = external name 'WebGLQuery' (TJSWebGLObject);
  class TJSWebGLSampler = external name 'WebGLSampler' (TJSWebGLObject);
  class TJSWebGLSync = external name 'WebGLSync' (TJSWebGLObject);
  class TJSWebGLTransformFeedback = external name 'WebGLTransformFeedback' (TJSWebGLObject);
  class TJSWebGLVertexArrayObject = external name 'WebGLVertexArrayObject' (TJSWebGLObject);
  class TJSWebGL2RenderingContextBase = external name 'WebGL2RenderingContextBase' (TJSObject)
  public
    const READ_BUFFER: nativeint;
    const UNPACK_ROW_LENGTH: nativeint;
    const UNPACK_SKIP_ROWS: nativeint;
    const UNPACK_SKIP_PIXELS: nativeint;
    const PACK_ROW_LENGTH: nativeint;
    const PACK_SKIP_ROWS: nativeint;
    const PACK_SKIP_PIXELS: nativeint;
    const COLOR: nativeint;
    const DEPTH: nativeint;
    const STENCIL: nativeint;
    const RED: nativeint;
    const RGB8: nativeint;
    const RGBA8: nativeint;
    const RGB10_A2: nativeint;
    const TEXTURE_BINDING_3D: nativeint;
    const UNPACK_SKIP_IMAGES: nativeint;
    const UNPACK_IMAGE_HEIGHT: nativeint;
    const TEXTURE_3D: nativeint;
    const TEXTURE_WRAP_R: nativeint;
    const MAX_3D_TEXTURE_SIZE: nativeint;
    const UNSIGNED_INT_2_10_10_10_REV: nativeint;
    const MAX_ELEMENTS_VERTICES: nativeint;
    const MAX_ELEMENTS_INDICES: nativeint;
    const TEXTURE_MIN_LOD: nativeint;
    const TEXTURE_MAX_LOD: nativeint;
    const TEXTURE_BASE_LEVEL: nativeint;
    const TEXTURE_MAX_LEVEL: nativeint;
    const MIN: nativeint;
    const MAX: nativeint;
    const DEPTH_COMPONENT24: nativeint;
    const MAX_TEXTURE_LOD_BIAS: nativeint;
    const TEXTURE_COMPARE_MODE: nativeint;
    const TEXTURE_COMPARE_FUNC: nativeint;
    const CURRENT_QUERY: nativeint;
    const QUERY_RESULT: nativeint;
    const QUERY_RESULT_AVAILABLE: nativeint;
    const STREAM_READ: nativeint;
    const STREAM_COPY: nativeint;
    const STATIC_READ: nativeint;
    const STATIC_COPY: nativeint;
    const DYNAMIC_READ: nativeint;
    const DYNAMIC_COPY: nativeint;
    const MAX_DRAW_BUFFERS: nativeint;
    const DRAW_BUFFER0: nativeint;
    const DRAW_BUFFER1: nativeint;
    const DRAW_BUFFER2: nativeint;
    const DRAW_BUFFER3: nativeint;
    const DRAW_BUFFER4: nativeint;
    const DRAW_BUFFER5: nativeint;
    const DRAW_BUFFER6: nativeint;
    const DRAW_BUFFER7: nativeint;
    const DRAW_BUFFER8: nativeint;
    const DRAW_BUFFER9: nativeint;
    const DRAW_BUFFER10: nativeint;
    const DRAW_BUFFER11: nativeint;
    const DRAW_BUFFER12: nativeint;
    const DRAW_BUFFER13: nativeint;
    const DRAW_BUFFER14: nativeint;
    const DRAW_BUFFER15: nativeint;
    const MAX_FRAGMENT_UNIFORM_COMPONENTS: nativeint;
    const MAX_VERTEX_UNIFORM_COMPONENTS: nativeint;
    const SAMPLER_3D: nativeint;
    const SAMPLER_2D_SHADOW: nativeint;
    const FRAGMENT_SHADER_DERIVATIVE_HINT: nativeint;
    const PIXEL_PACK_BUFFER: nativeint;
    const PIXEL_UNPACK_BUFFER: nativeint;
    const PIXEL_PACK_BUFFER_BINDING: nativeint;
    const PIXEL_UNPACK_BUFFER_BINDING: nativeint;
    const FLOAT_MAT2x3: nativeint;
    const FLOAT_MAT2x4: nativeint;
    const FLOAT_MAT3x2: nativeint;
    const FLOAT_MAT3x4: nativeint;
    const FLOAT_MAT4x2: nativeint;
    const FLOAT_MAT4x3: nativeint;
    const SRGB: nativeint;
    const SRGB8: nativeint;
    const SRGB8_ALPHA8: nativeint;
    const COMPARE_REF_TO_TEXTURE: nativeint;
    const RGBA32F: nativeint;
    const RGB32F: nativeint;
    const RGBA16F: nativeint;
    const RGB16F: nativeint;
    const VERTEX_ATTRIB_ARRAY_INTEGER: nativeint;
    const MAX_ARRAY_TEXTURE_LAYERS: nativeint;
    const MIN_PROGRAM_TEXEL_OFFSET: nativeint;
    const MAX_PROGRAM_TEXEL_OFFSET: nativeint;
    const MAX_VARYING_COMPONENTS: nativeint;
    const TEXTURE_2D_ARRAY: nativeint;
    const TEXTURE_BINDING_2D_ARRAY: nativeint;
    const R11F_G11F_B10F: nativeint;
    const UNSIGNED_INT_10F_11F_11F_REV: nativeint;
    const RGB9_E5: nativeint;
    const UNSIGNED_INT_5_9_9_9_REV: nativeint;
    const TRANSFORM_FEEDBACK_BUFFER_MODE: nativeint;
    const MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: nativeint;
    const TRANSFORM_FEEDBACK_VARYINGS: nativeint;
    const TRANSFORM_FEEDBACK_BUFFER_START: nativeint;
    const TRANSFORM_FEEDBACK_BUFFER_SIZE: nativeint;
    const TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: nativeint;
    const RASTERIZER_DISCARD: nativeint;
    const MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: nativeint;
    const MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: nativeint;
    const INTERLEAVED_ATTRIBS: nativeint;
    const SEPARATE_ATTRIBS: nativeint;
    const TRANSFORM_FEEDBACK_BUFFER: nativeint;
    const TRANSFORM_FEEDBACK_BUFFER_BINDING: nativeint;
    const RGBA32UI: nativeint;
    const RGB32UI: nativeint;
    const RGBA16UI: nativeint;
    const RGB16UI: nativeint;
    const RGBA8UI: nativeint;
    const RGB8UI: nativeint;
    const RGBA32I: nativeint;
    const RGB32I: nativeint;
    const RGBA16I: nativeint;
    const RGB16I: nativeint;
    const RGBA8I: nativeint;
    const RGB8I: nativeint;
    const RED_INTEGER: nativeint;
    const RGB_INTEGER: nativeint;
    const RGBA_INTEGER: nativeint;
    const SAMPLER_2D_ARRAY: nativeint;
    const SAMPLER_2D_ARRAY_SHADOW: nativeint;
    const SAMPLER_CUBE_SHADOW: nativeint;
    const UNSIGNED_INT_VEC2: nativeint;
    const UNSIGNED_INT_VEC3: nativeint;
    const UNSIGNED_INT_VEC4: nativeint;
    const INT_SAMPLER_2D: nativeint;
    const INT_SAMPLER_3D: nativeint;
    const INT_SAMPLER_CUBE: nativeint;
    const INT_SAMPLER_2D_ARRAY: nativeint;
    const UNSIGNED_INT_SAMPLER_2D: nativeint;
    const UNSIGNED_INT_SAMPLER_3D: nativeint;
    const UNSIGNED_INT_SAMPLER_CUBE: nativeint;
    const UNSIGNED_INT_SAMPLER_2D_ARRAY: nativeint;
    const DEPTH_COMPONENT32F: nativeint;
    const DEPTH32F_STENCIL8: nativeint;
    const FLOAT_32_UNSIGNED_INT_24_8_REV: nativeint;
    const FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: nativeint;
    const FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_RED_SIZE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: nativeint;
    const FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: nativeint;
    const FRAMEBUFFER_DEFAULT: nativeint;
    const DEPTH_STENCIL_ATTACHMENT: nativeint;
    const DEPTH_STENCIL: nativeint;
    const UNSIGNED_INT_24_8: nativeint;
    const DEPTH24_STENCIL8: nativeint;
    const UNSIGNED_NORMALIZED: nativeint;
    const DRAW_FRAMEBUFFER_BINDING: nativeint;
    const READ_FRAMEBUFFER: nativeint;
    const DRAW_FRAMEBUFFER: nativeint;
    const READ_FRAMEBUFFER_BINDING: nativeint;
    const RENDERBUFFER_SAMPLES: nativeint;
    const FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: nativeint;
    const MAX_COLOR_ATTACHMENTS: nativeint;
    const COLOR_ATTACHMENT1: nativeint;
    const COLOR_ATTACHMENT2: nativeint;
    const COLOR_ATTACHMENT3: nativeint;
    const COLOR_ATTACHMENT4: nativeint;
    const COLOR_ATTACHMENT5: nativeint;
    const COLOR_ATTACHMENT6: nativeint;
    const COLOR_ATTACHMENT7: nativeint;
    const COLOR_ATTACHMENT8: nativeint;
    const COLOR_ATTACHMENT9: nativeint;
    const COLOR_ATTACHMENT10: nativeint;
    const COLOR_ATTACHMENT11: nativeint;
    const COLOR_ATTACHMENT12: nativeint;
    const COLOR_ATTACHMENT13: nativeint;
    const COLOR_ATTACHMENT14: nativeint;
    const COLOR_ATTACHMENT15: nativeint;
    const FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: nativeint;
    const MAX_SAMPLES: nativeint;
    const HALF_FLOAT: nativeint;
    const RG: nativeint;
    const RG_INTEGER: nativeint;
    const R8: nativeint;
    const RG8: nativeint;
    const R16F: nativeint;
    const R32F: nativeint;
    const RG16F: nativeint;
    const RG32F: nativeint;
    const R8I: nativeint;
    const R8UI: nativeint;
    const R16I: nativeint;
    const R16UI: nativeint;
    const R32I: nativeint;
    const R32UI: nativeint;
    const RG8I: nativeint;
    const RG8UI: nativeint;
    const RG16I: nativeint;
    const RG16UI: nativeint;
    const RG32I: nativeint;
    const RG32UI: nativeint;
    const VERTEX_ARRAY_BINDING: nativeint;
    const R8_SNORM: nativeint;
    const RG8_SNORM: nativeint;
    const RGB8_SNORM: nativeint;
    const RGBA8_SNORM: nativeint;
    const SIGNED_NORMALIZED: nativeint;
    const COPY_READ_BUFFER: nativeint;
    const COPY_WRITE_BUFFER: nativeint;
    const COPY_READ_BUFFER_BINDING: nativeint;
    const COPY_WRITE_BUFFER_BINDING: nativeint;
    const UNIFORM_BUFFER: nativeint;
    const UNIFORM_BUFFER_BINDING: nativeint;
    const UNIFORM_BUFFER_START: nativeint;
    const UNIFORM_BUFFER_SIZE: nativeint;
    const MAX_VERTEX_UNIFORM_BLOCKS: nativeint;
    const MAX_FRAGMENT_UNIFORM_BLOCKS: nativeint;
    const MAX_COMBINED_UNIFORM_BLOCKS: nativeint;
    const MAX_UNIFORM_BUFFER_BINDINGS: nativeint;
    const MAX_UNIFORM_BLOCK_SIZE: nativeint;
    const MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: nativeint;
    const MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: nativeint;
    const UNIFORM_BUFFER_OFFSET_ALIGNMENT: nativeint;
    const ACTIVE_UNIFORM_BLOCKS: nativeint;
    const UNIFORM_TYPE: nativeint;
    const UNIFORM_SIZE: nativeint;
    const UNIFORM_BLOCK_INDEX: nativeint;
    const UNIFORM_OFFSET: nativeint;
    const UNIFORM_ARRAY_STRIDE: nativeint;
    const UNIFORM_MATRIX_STRIDE: nativeint;
    const UNIFORM_IS_ROW_MAJOR: nativeint;
    const UNIFORM_BLOCK_BINDING: nativeint;
    const UNIFORM_BLOCK_DATA_SIZE: nativeint;
    const UNIFORM_BLOCK_ACTIVE_UNIFORMS: nativeint;
    const UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: nativeint;
    const UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: nativeint;
    const UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: nativeint;
    const INVALID_INDEX: nativeint;
    const MAX_VERTEX_OUTPUT_COMPONENTS: nativeint;
    const MAX_FRAGMENT_INPUT_COMPONENTS: nativeint;
    const MAX_SERVER_WAIT_TIMEOUT: nativeint;
    const OBJECT_TYPE: nativeint;
    const SYNC_CONDITION: nativeint;
    const SYNC_STATUS: nativeint;
    const SYNC_FLAGS: nativeint;
    const SYNC_FENCE: nativeint;
    const SYNC_GPU_COMMANDS_COMPLETE: nativeint;
    const UNSIGNALED: nativeint;
    const SIGNALED: nativeint;
    const ALREADY_SIGNALED: nativeint;
    const TIMEOUT_EXPIRED: nativeint;
    const CONDITION_SATISFIED: nativeint;
    const WAIT_FAILED: nativeint;
    const SYNC_FLUSH_COMMANDS_BIT: nativeint;
    const VERTEX_ATTRIB_ARRAY_DIVISOR: nativeint;
    const ANY_SAMPLES_PASSED: nativeint;
    const ANY_SAMPLES_PASSED_CONSERVATIVE: nativeint;
    const SAMPLER_BINDING: nativeint;
    const RGB10_A2UI: nativeint;
    const INT_2_10_10_10_REV: nativeint;
    const TRANSFORM_FEEDBACK: nativeint;
    const TRANSFORM_FEEDBACK_PAUSED: nativeint;
    const TRANSFORM_FEEDBACK_ACTIVE: nativeint;
    const TRANSFORM_FEEDBACK_BINDING: nativeint;
    const TEXTURE_IMMUTABLE_FORMAT: nativeint;
    const MAX_ELEMENT_INDEX: nativeint;
    const TEXTURE_IMMUTABLE_LEVELS: nativeint;
    const MAX_CLIENT_WAIT_TIMEOUT_WEBGL: nativeint;
    procedure bufferData (target: GLenum; size: GLsizeiptr; usage: GLenum);
    procedure bufferData (target: GLenum; srcData: BufferSource; usage: GLenum);
    procedure bufferSubData (target: GLenum; dstByteOffset: GLintptr; srcData: BufferSource);
    procedure bufferData (target: GLenum; srcData: ArrayBufferView; usage: GLenum; srcOffset: GLuint; length: GLuint);
    procedure bufferSubData (target: GLenum; dstByteOffset: GLintptr; srcData: ArrayBufferView; length: GLuint);
    procedure copyBufferSubData (readTarget: GLenum; writeTarget: GLenum; readOffset: GLintptr; size: GLsizeiptr);
    procedure getBufferSubData (target: GLenum; srcByteOffset: GLintptr; dstBuffer: ArrayBufferView; dstOffset: GLuint; length: GLuint);
    procedure blitFramebuffer (srcX0: GLint; srcY0: GLint; srcX1: GLint; srcY1: GLint; dstX0: GLint; dstY0: GLint; dstY1: GLint; mask: GLbitfield; filter: GLenum);
    procedure framebufferTextureLayer (target: GLenum; attachment: GLenum; texture: TJSWebGLTexture; level: GLint);
    procedure invalidateFramebuffer (target: GLenum; attachments: GLenumDynArray);
    procedure invalidateSubFramebuffer (target: GLenum; attachments: GLenumDynArray; y: GLint; width: GLsizei; height: GLsizei);
    procedure readBuffer (src: GLenum);
    function getInternalformatParameter (target: GLenum; internalformat: GLenum; pname: GLenum): JSValue;
    procedure renderbufferStorageMultisample (target: GLenum; samples: GLsizei; internalformat: GLenum; height: GLsizei);
    procedure texStorage2D (target: GLenum; levels: GLsizei; internalformat: GLenum; width: GLsizei);
    procedure texStorage3D (target: GLenum; levels: GLsizei; internalformat: GLenum; width: GLsizei; depth: GLsizei);
    procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; height: GLsizei; border: GLint; format: GLenum; pixels: ArrayBufferView);
    procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; type: GLenum; source: TexImageSource);
    procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; height: GLsizei; type: GLenum; pixels: ArrayBufferView);
    procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; type: GLenum; source: TexImageSource);
    procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum; pboOffset: GLintptr);
    procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum);
    procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum; srcData: ArrayBufferView);
    procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum; pboOffset: GLintptr);
    procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum);
    procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum; srcData: ArrayBufferView);
    procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum; srcData: ArrayBufferView);
    procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; format: GLenum; type: GLenum; pboOffset: GLintptr);
    procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; format: GLenum; type: GLenum);
    procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; format: GLenum; type: GLenum; srcData: ArrayBufferView);
    procedure texSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; height: GLsizei; depth: GLsizei; format: GLenum; type: GLenum);
    procedure texSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; height: GLsizei; depth: GLsizei; format: GLenum; type: GLenum);
    procedure texSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; height: GLsizei; depth: GLsizei; format: GLenum; type: GLenum; srcOffset: GLuint);
    procedure copyTexSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; y: GLint; width: GLsizei; height: GLsizei);
    procedure compressedTexImage2D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; imageSize: GLsizei; offset: GLintptr);
    procedure compressedTexImage2D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; srcData: ArrayBufferView; srcOffset: GLuint; srcLengthOverride: GLuint);
    procedure compressedTexImage3D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; depth: GLsizei; border: GLint; imageSize: GLsizei; offset: GLintptr);
    procedure compressedTexImage3D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; depth: GLsizei; border: GLint; srcData: ArrayBufferView; srcOffset: GLuint; srcLengthOverride: GLuint);
    procedure compressedTexSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; height: GLsizei; format: GLenum; imageSize: GLsizei; offset: GLintptr);
    procedure compressedTexSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; height: GLsizei; format: GLenum; srcOffset: GLuint; srcLengthOverride: GLuint);
    procedure compressedTexSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; imageSize: GLsizei; offset: GLintptr);
    procedure compressedTexSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; srcData: ArrayBufferView; srcOffset: GLuint; srcLengthOverride: GLuint);
    function getFragDataLocation (program: WebGLProgram; name: DOMString): GLint;
    procedure uniform1ui (location: TJSWebGLUniformLocation; v0: GLuint);
    procedure uniform2ui (location: TJSWebGLUniformLocation; v0: GLuint; v1: GLuint);
    procedure uniform3ui (location: TJSWebGLUniformLocation; v0: GLuint; v1: GLuint; v2: GLuint);
    procedure uniform4ui (location: TJSWebGLUniformLocation; v0: GLuint; v1: GLuint; v2: GLuint; v3: GLuint);
    procedure uniform1fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform2fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform3fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform4fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform1iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform2iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform3iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform4iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform1uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform2uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform3uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniform4uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix3x2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix4x2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix2x3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix4x3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix2x4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix3x4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure uniformMatrix4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
    procedure vertexAttribI4i (index: GLuint; x: GLint; y: GLint; z: GLint; w: GLint);
    procedure vertexAttribI4iv (index: GLuint; values: Int32List);
    procedure vertexAttribI4ui (index: GLuint; x: GLuint; y: GLuint; z: GLuint; w: GLuint);
    procedure vertexAttribI4uiv (index: GLuint; values: Uint32List);
    procedure vertexAttribIPointer (index: GLuint; size: GLint; type: GLenum; stride: GLsizei; offset: GLintptr);
    procedure vertexAttribDivisor (index: GLuint; divisor: GLuint);
    procedure drawArraysInstanced (mode: GLenum; first: GLint; count: GLsizei; instanceCount: GLsizei);
    procedure drawElementsInstanced (mode: GLenum; count: GLsizei; type: GLenum; offset: GLintptr; instanceCount: GLsizei);
    procedure drawRangeElements (mode: GLenum; start: GLuint; end: GLuint; count: GLsizei; type: GLenum; offset: GLintptr);
    procedure readPixels (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum);
    procedure readPixels (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum);
    procedure readPixels (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum; dstOffset: GLuint);
    procedure drawBuffers (buffers: GLenumDynArray);
    procedure clearBufferfv (buffer: GLenum; drawbuffer: GLint; values: Float32List; srcOffset: GLuint);
    procedure clearBufferiv (buffer: GLenum; drawbuffer: GLint; values: Int32List; srcOffset: GLuint);
    procedure clearBufferuiv (buffer: GLenum; drawbuffer: GLint; values: Uint32List; srcOffset: GLuint);
    procedure clearBufferfi (buffer: GLenum; drawbuffer: GLint; depth: GLfloat; stencil: GLint);
    function createQuery: TJSWebGLQuery;
    procedure deleteQuery (query: TJSWebGLQuery);
    function isQuery (query: TJSWebGLQuery): GLboolean;
    procedure beginQuery (target: GLenum; query: WebGLQuery);
    procedure endQuery (target: GLenum);
    function getQuery (target: GLenum; pname: GLenum): TJSWebGLQuery;
    function getQueryParameter (query: WebGLQuery; pname: GLenum): JSValue;
    function createSampler: TJSWebGLSampler;
    procedure deleteSampler (sampler: TJSWebGLSampler);
    function isSampler (sampler: TJSWebGLSampler): GLboolean;
    procedure bindSampler (unit: GLuint; sampler: TJSWebGLSampler);
    procedure samplerParameteri (sampler: WebGLSampler; pname: GLenum; param: GLint);
    procedure samplerParameterf (sampler: WebGLSampler; pname: GLenum; param: GLfloat);
    function getSamplerParameter (sampler: WebGLSampler; pname: GLenum): JSValue;
    function fenceSync (condition: GLenum; flags: GLbitfield): TJSWebGLSync;
    function isSync (sync: TJSWebGLSync): GLboolean;
    procedure deleteSync (sync: TJSWebGLSync);
    function clientWaitSync (sync: WebGLSync; flags: GLbitfield; timeout: GLuint64): GLenum;
    procedure waitSync (sync: WebGLSync; flags: GLbitfield; timeout: GLint64);
    function getSyncParameter (sync: WebGLSync; pname: GLenum): JSValue;
    function createTransformFeedback: TJSWebGLTransformFeedback;
    procedure deleteTransformFeedback (tf: TJSWebGLTransformFeedback);
    function isTransformFeedback (tf: TJSWebGLTransformFeedback): GLboolean;
    procedure bindTransformFeedback (target: GLenum; tf: TJSWebGLTransformFeedback);
    procedure beginTransformFeedback (primitiveMode: GLenum);
    procedure endTransformFeedback;
    procedure transformFeedbackVaryings (program: WebGLProgram; varyings: DOMStringDynArray; bufferMode: GLenum);
    function getTransformFeedbackVarying (program: WebGLProgram; index: GLuint): TJSWebGLActiveInfo;
    procedure pauseTransformFeedback;
    procedure resumeTransformFeedback;
    procedure bindBufferBase (target: GLenum; index: GLuint; buffer: TJSWebGLBuffer);
    procedure bindBufferRange (target: GLenum; index: GLuint; buffer: TJSWebGLBuffer; offset: GLintptr; size: GLsizeiptr);
    function getIndexedParameter (target: GLenum; index: GLuint): JSValue;
    function getUniformIndices (program: WebGLProgram; uniformNames: DOMStringDynArray): GLuintDynArray;
    function getActiveUniforms (program: WebGLProgram; uniformIndices: GLuintDynArray; pname: GLenum): JSValue;
    function getUniformBlockIndex (program: WebGLProgram; uniformBlockName: DOMString): GLuint;
    function getActiveUniformBlockParameter (program: WebGLProgram; uniformBlockIndex: GLuint; pname: GLenum): JSValue;
    function getActiveUniformBlockName (program: WebGLProgram; uniformBlockIndex: GLuint): TJSDOMString;
    procedure uniformBlockBinding (program: WebGLProgram; uniformBlockIndex: GLuint; uniformBlockBinding: GLuint);
    function createVertexArray: TJSWebGLVertexArrayObject;
    procedure deleteVertexArray (vertexArray: TJSWebGLVertexArrayObject);
    function isVertexArray (vertexArray: TJSWebGLVertexArrayObject): GLboolean;
    procedure bindVertexArray (array: TJSWebGLVertexArrayObject);
  end;

  class TJSWebGL2RenderingContext = external name 'WebGL2RenderingContext' (TJSWebGL2RenderingContextBase);

implementation
end;

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Free Pascal - General mailing list
Ryan Joseph <[hidden email]> schrieb am Mi., 2. Mai 2018, 15:57:

  class TJSWebGL2RenderingContextBase = external name 'WebGL2RenderingContextBase' (TJSObject)

It's "Typename = class external name 'foobar' (Basetype)", not "class Typename = external name 'foobar' (Basetype)". We're not in C++ after all :P

  public
    const READ_BUFFER: nativeint;
    const UNPACK_ROW_LENGTH: nativeint;

Just in case you aren't aware of it: "const", "type" and "var" start sections, even inside classes/records, so you don't need to repeat the "const". Instead it is common to write "public const" and then write all constant members. 

Regards, 
Sven 
 

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph


> On May 2, 2018, at 11:36 PM, Sven Barth via fpc-pascal <[hidden email]> wrote:
>
> It's "Typename = class external name 'foobar' (Basetype)", not "class Typename = external name 'foobar' (Basetype)". We're not in C++ after all :P
>
>   public
>     const READ_BUFFER: nativeint;
>     const UNPACK_ROW_LENGTH: nativeint;
>
> Just in case you aren't aware of it: "const", "type" and "var" start sections, even inside classes/records, so you don't need to repeat the "const". Instead it is common to write "public const" and then write all constant members.
>

Not paying attention at all yesterday going from PHP to Pascal. It’s fixed now and looks better but the formatting is not standard perhaps.

The .idls still had those lines I wasn’t sure what to do with so I ignored them. I think enums should be string types followed by constants (if that’s allowed by the parser).

enum WebGLPowerPreference should probably be:

type
  TWebGLPowerPreference = string;
const
  TWebGLPowerPreferenceDefault = ‘default’;
  etc…

Who knows about or’d typedefs though. better to do those by hand or dump them as comments.

enum WebGLPowerPreference { "default", "low-power", "high-performance" };

typedef (ImageBitmap or
         ImageData or
         HTMLImageElement or
         HTMLCanvasElement or
         HTMLVideoElement) TexImageSource;

typedef ([AllowShared] Float32Array or sequence<GLfloat>) Float32List;
typedef ([AllowShared] Int32Array or sequence<GLint>) Int32List;

==========

unit webgl2;

{$mode objfpc}
{$modeswitch externalclass}

interface
uses
  JS, Web;

  type
    GLint64 = nativeint;
    GLuint64 = longword;
  type
    TJSWebGLQuery = class external name 'WebGLQuery' (TJSWebGLObject);
    TJSWebGLSampler = class external name 'WebGLSampler' (TJSWebGLObject);
    TJSWebGLSync = class external name 'WebGLSync' (TJSWebGLObject);
    TJSWebGLTransformFeedback = class external name 'WebGLTransformFeedback' (TJSWebGLObject);
    TJSWebGLVertexArrayObject = class external name 'WebGLVertexArrayObject' (TJSWebGLObject);
  type  
    TJSWebGL2RenderingContextBase = class external name 'WebGL2RenderingContextBase' (TJSObject)
    public
    const
      READ_BUFFER: nativeint;
      UNPACK_ROW_LENGTH: nativeint;
      UNPACK_SKIP_ROWS: nativeint;
      UNPACK_SKIP_PIXELS: nativeint;
      PACK_ROW_LENGTH: nativeint;
      PACK_SKIP_ROWS: nativeint;
      PACK_SKIP_PIXELS: nativeint;
      COLOR: nativeint;
      DEPTH: nativeint;
      STENCIL: nativeint;
      RED: nativeint;
      RGB8: nativeint;
      RGBA8: nativeint;
      RGB10_A2: nativeint;
      TEXTURE_BINDING_3D: nativeint;
      UNPACK_SKIP_IMAGES: nativeint;
      UNPACK_IMAGE_HEIGHT: nativeint;
      TEXTURE_3D: nativeint;
      TEXTURE_WRAP_R: nativeint;
      MAX_3D_TEXTURE_SIZE: nativeint;
      UNSIGNED_INT_2_10_10_10_REV: nativeint;
      MAX_ELEMENTS_VERTICES: nativeint;
      MAX_ELEMENTS_INDICES: nativeint;
      TEXTURE_MIN_LOD: nativeint;
      TEXTURE_MAX_LOD: nativeint;
      TEXTURE_BASE_LEVEL: nativeint;
      TEXTURE_MAX_LEVEL: nativeint;
      MIN: nativeint;
      MAX: nativeint;
      DEPTH_COMPONENT24: nativeint;
      MAX_TEXTURE_LOD_BIAS: nativeint;
      TEXTURE_COMPARE_MODE: nativeint;
      TEXTURE_COMPARE_FUNC: nativeint;
      CURRENT_QUERY: nativeint;
      QUERY_RESULT: nativeint;
      QUERY_RESULT_AVAILABLE: nativeint;
      STREAM_READ: nativeint;
      STREAM_COPY: nativeint;
      STATIC_READ: nativeint;
      STATIC_COPY: nativeint;
      DYNAMIC_READ: nativeint;
      DYNAMIC_COPY: nativeint;
      MAX_DRAW_BUFFERS: nativeint;
      DRAW_BUFFER0: nativeint;
      DRAW_BUFFER1: nativeint;
      DRAW_BUFFER2: nativeint;
      DRAW_BUFFER3: nativeint;
      DRAW_BUFFER4: nativeint;
      DRAW_BUFFER5: nativeint;
      DRAW_BUFFER6: nativeint;
      DRAW_BUFFER7: nativeint;
      DRAW_BUFFER8: nativeint;
      DRAW_BUFFER9: nativeint;
      DRAW_BUFFER10: nativeint;
      DRAW_BUFFER11: nativeint;
      DRAW_BUFFER12: nativeint;
      DRAW_BUFFER13: nativeint;
      DRAW_BUFFER14: nativeint;
      DRAW_BUFFER15: nativeint;
      MAX_FRAGMENT_UNIFORM_COMPONENTS: nativeint;
      MAX_VERTEX_UNIFORM_COMPONENTS: nativeint;
      SAMPLER_3D: nativeint;
      SAMPLER_2D_SHADOW: nativeint;
      FRAGMENT_SHADER_DERIVATIVE_HINT: nativeint;
      PIXEL_PACK_BUFFER: nativeint;
      PIXEL_UNPACK_BUFFER: nativeint;
      PIXEL_PACK_BUFFER_BINDING: nativeint;
      PIXEL_UNPACK_BUFFER_BINDING: nativeint;
      FLOAT_MAT2x3: nativeint;
      FLOAT_MAT2x4: nativeint;
      FLOAT_MAT3x2: nativeint;
      FLOAT_MAT3x4: nativeint;
      FLOAT_MAT4x2: nativeint;
      FLOAT_MAT4x3: nativeint;
      SRGB: nativeint;
      SRGB8: nativeint;
      SRGB8_ALPHA8: nativeint;
      COMPARE_REF_TO_TEXTURE: nativeint;
      RGBA32F: nativeint;
      RGB32F: nativeint;
      RGBA16F: nativeint;
      RGB16F: nativeint;
      VERTEX_ATTRIB_ARRAY_INTEGER: nativeint;
      MAX_ARRAY_TEXTURE_LAYERS: nativeint;
      MIN_PROGRAM_TEXEL_OFFSET: nativeint;
      MAX_PROGRAM_TEXEL_OFFSET: nativeint;
      MAX_VARYING_COMPONENTS: nativeint;
      TEXTURE_2D_ARRAY: nativeint;
      TEXTURE_BINDING_2D_ARRAY: nativeint;
      R11F_G11F_B10F: nativeint;
      UNSIGNED_INT_10F_11F_11F_REV: nativeint;
      RGB9_E5: nativeint;
      UNSIGNED_INT_5_9_9_9_REV: nativeint;
      TRANSFORM_FEEDBACK_BUFFER_MODE: nativeint;
      MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: nativeint;
      TRANSFORM_FEEDBACK_VARYINGS: nativeint;
      TRANSFORM_FEEDBACK_BUFFER_START: nativeint;
      TRANSFORM_FEEDBACK_BUFFER_SIZE: nativeint;
      TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: nativeint;
      RASTERIZER_DISCARD: nativeint;
      MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: nativeint;
      MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: nativeint;
      INTERLEAVED_ATTRIBS: nativeint;
      SEPARATE_ATTRIBS: nativeint;
      TRANSFORM_FEEDBACK_BUFFER: nativeint;
      TRANSFORM_FEEDBACK_BUFFER_BINDING: nativeint;
      RGBA32UI: nativeint;
      RGB32UI: nativeint;
      RGBA16UI: nativeint;
      RGB16UI: nativeint;
      RGBA8UI: nativeint;
      RGB8UI: nativeint;
      RGBA32I: nativeint;
      RGB32I: nativeint;
      RGBA16I: nativeint;
      RGB16I: nativeint;
      RGBA8I: nativeint;
      RGB8I: nativeint;
      RED_INTEGER: nativeint;
      RGB_INTEGER: nativeint;
      RGBA_INTEGER: nativeint;
      SAMPLER_2D_ARRAY: nativeint;
      SAMPLER_2D_ARRAY_SHADOW: nativeint;
      SAMPLER_CUBE_SHADOW: nativeint;
      UNSIGNED_INT_VEC2: nativeint;
      UNSIGNED_INT_VEC3: nativeint;
      UNSIGNED_INT_VEC4: nativeint;
      INT_SAMPLER_2D: nativeint;
      INT_SAMPLER_3D: nativeint;
      INT_SAMPLER_CUBE: nativeint;
      INT_SAMPLER_2D_ARRAY: nativeint;
      UNSIGNED_INT_SAMPLER_2D: nativeint;
      UNSIGNED_INT_SAMPLER_3D: nativeint;
      UNSIGNED_INT_SAMPLER_CUBE: nativeint;
      UNSIGNED_INT_SAMPLER_2D_ARRAY: nativeint;
      DEPTH_COMPONENT32F: nativeint;
      DEPTH32F_STENCIL8: nativeint;
      FLOAT_32_UNSIGNED_INT_24_8_REV: nativeint;
      FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: nativeint;
      FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: nativeint;
      FRAMEBUFFER_ATTACHMENT_RED_SIZE: nativeint;
      FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: nativeint;
      FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: nativeint;
      FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: nativeint;
      FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: nativeint;
      FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: nativeint;
      FRAMEBUFFER_DEFAULT: nativeint;
      DEPTH_STENCIL_ATTACHMENT: nativeint;
      DEPTH_STENCIL: nativeint;
      UNSIGNED_INT_24_8: nativeint;
      DEPTH24_STENCIL8: nativeint;
      UNSIGNED_NORMALIZED: nativeint;
      DRAW_FRAMEBUFFER_BINDING: nativeint;
      READ_FRAMEBUFFER: nativeint;
      DRAW_FRAMEBUFFER: nativeint;
      READ_FRAMEBUFFER_BINDING: nativeint;
      RENDERBUFFER_SAMPLES: nativeint;
      FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: nativeint;
      MAX_COLOR_ATTACHMENTS: nativeint;
      COLOR_ATTACHMENT1: nativeint;
      COLOR_ATTACHMENT2: nativeint;
      COLOR_ATTACHMENT3: nativeint;
      COLOR_ATTACHMENT4: nativeint;
      COLOR_ATTACHMENT5: nativeint;
      COLOR_ATTACHMENT6: nativeint;
      COLOR_ATTACHMENT7: nativeint;
      COLOR_ATTACHMENT8: nativeint;
      COLOR_ATTACHMENT9: nativeint;
      COLOR_ATTACHMENT10: nativeint;
      COLOR_ATTACHMENT11: nativeint;
      COLOR_ATTACHMENT12: nativeint;
      COLOR_ATTACHMENT13: nativeint;
      COLOR_ATTACHMENT14: nativeint;
      COLOR_ATTACHMENT15: nativeint;
      FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: nativeint;
      MAX_SAMPLES: nativeint;
      HALF_FLOAT: nativeint;
      RG: nativeint;
      RG_INTEGER: nativeint;
      R8: nativeint;
      RG8: nativeint;
      R16F: nativeint;
      R32F: nativeint;
      RG16F: nativeint;
      RG32F: nativeint;
      R8I: nativeint;
      R8UI: nativeint;
      R16I: nativeint;
      R16UI: nativeint;
      R32I: nativeint;
      R32UI: nativeint;
      RG8I: nativeint;
      RG8UI: nativeint;
      RG16I: nativeint;
      RG16UI: nativeint;
      RG32I: nativeint;
      RG32UI: nativeint;
      VERTEX_ARRAY_BINDING: nativeint;
      R8_SNORM: nativeint;
      RG8_SNORM: nativeint;
      RGB8_SNORM: nativeint;
      RGBA8_SNORM: nativeint;
      SIGNED_NORMALIZED: nativeint;
      COPY_READ_BUFFER: nativeint;
      COPY_WRITE_BUFFER: nativeint;
      COPY_READ_BUFFER_BINDING: nativeint;
      COPY_WRITE_BUFFER_BINDING: nativeint;
      UNIFORM_BUFFER: nativeint;
      UNIFORM_BUFFER_BINDING: nativeint;
      UNIFORM_BUFFER_START: nativeint;
      UNIFORM_BUFFER_SIZE: nativeint;
      MAX_VERTEX_UNIFORM_BLOCKS: nativeint;
      MAX_FRAGMENT_UNIFORM_BLOCKS: nativeint;
      MAX_COMBINED_UNIFORM_BLOCKS: nativeint;
      MAX_UNIFORM_BUFFER_BINDINGS: nativeint;
      MAX_UNIFORM_BLOCK_SIZE: nativeint;
      MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: nativeint;
      MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: nativeint;
      UNIFORM_BUFFER_OFFSET_ALIGNMENT: nativeint;
      ACTIVE_UNIFORM_BLOCKS: nativeint;
      UNIFORM_TYPE: nativeint;
      UNIFORM_SIZE: nativeint;
      UNIFORM_BLOCK_INDEX: nativeint;
      UNIFORM_OFFSET: nativeint;
      UNIFORM_ARRAY_STRIDE: nativeint;
      UNIFORM_MATRIX_STRIDE: nativeint;
      UNIFORM_IS_ROW_MAJOR: nativeint;
      UNIFORM_BLOCK_BINDING: nativeint;
      UNIFORM_BLOCK_DATA_SIZE: nativeint;
      UNIFORM_BLOCK_ACTIVE_UNIFORMS: nativeint;
      UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: nativeint;
      UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: nativeint;
      UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: nativeint;
      INVALID_INDEX: nativeint;
      MAX_VERTEX_OUTPUT_COMPONENTS: nativeint;
      MAX_FRAGMENT_INPUT_COMPONENTS: nativeint;
      MAX_SERVER_WAIT_TIMEOUT: nativeint;
      OBJECT_TYPE: nativeint;
      SYNC_CONDITION: nativeint;
      SYNC_STATUS: nativeint;
      SYNC_FLAGS: nativeint;
      SYNC_FENCE: nativeint;
      SYNC_GPU_COMMANDS_COMPLETE: nativeint;
      UNSIGNALED: nativeint;
      SIGNALED: nativeint;
      ALREADY_SIGNALED: nativeint;
      TIMEOUT_EXPIRED: nativeint;
      CONDITION_SATISFIED: nativeint;
      WAIT_FAILED: nativeint;
      SYNC_FLUSH_COMMANDS_BIT: nativeint;
      VERTEX_ATTRIB_ARRAY_DIVISOR: nativeint;
      ANY_SAMPLES_PASSED: nativeint;
      ANY_SAMPLES_PASSED_CONSERVATIVE: nativeint;
      SAMPLER_BINDING: nativeint;
      RGB10_A2UI: nativeint;
      INT_2_10_10_10_REV: nativeint;
      TRANSFORM_FEEDBACK: nativeint;
      TRANSFORM_FEEDBACK_PAUSED: nativeint;
      TRANSFORM_FEEDBACK_ACTIVE: nativeint;
      TRANSFORM_FEEDBACK_BINDING: nativeint;
      TEXTURE_IMMUTABLE_FORMAT: nativeint;
      MAX_ELEMENT_INDEX: nativeint;
      TEXTURE_IMMUTABLE_LEVELS: nativeint;
      MAX_CLIENT_WAIT_TIMEOUT_WEBGL: nativeint;
    public
      procedure bufferData (target: GLenum; size: GLsizeiptr; usage: GLenum);
      procedure bufferData (target: GLenum; srcData: BufferSource; usage: GLenum);
      procedure bufferSubData (target: GLenum; dstByteOffset: GLintptr; srcData: BufferSource);
      procedure bufferData (target: GLenum; srcData: ArrayBufferView; usage: GLenum; srcOffset: GLuint; length: GLuint);
      procedure bufferSubData (target: GLenum; dstByteOffset: GLintptr; srcData: ArrayBufferView; length: GLuint);
      procedure copyBufferSubData (readTarget: GLenum; writeTarget: GLenum; readOffset: GLintptr; size: GLsizeiptr);
      procedure getBufferSubData (target: GLenum; srcByteOffset: GLintptr; dstBuffer: ArrayBufferView; dstOffset: GLuint; length: GLuint);
      procedure blitFramebuffer (srcX0: GLint; srcY0: GLint; srcX1: GLint; srcY1: GLint; dstX0: GLint; dstY0: GLint; dstY1: GLint; mask: GLbitfield; filter: GLenum);
      procedure framebufferTextureLayer (target: GLenum; attachment: GLenum; texture: TJSWebGLTexture; level: GLint);
      procedure invalidateFramebuffer (target: GLenum; attachments: GLenumDynArray);
      procedure invalidateSubFramebuffer (target: GLenum; attachments: GLenumDynArray; y: GLint; width: GLsizei; height: GLsizei);
      procedure readBuffer (src: GLenum);
      function getInternalformatParameter (target: GLenum; internalformat: GLenum; pname: GLenum): JSValue;
      procedure renderbufferStorageMultisample (target: GLenum; samples: GLsizei; internalformat: GLenum; height: GLsizei);
      procedure texStorage2D (target: GLenum; levels: GLsizei; internalformat: GLenum; width: GLsizei);
      procedure texStorage3D (target: GLenum; levels: GLsizei; internalformat: GLenum; width: GLsizei; depth: GLsizei);
      procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; height: GLsizei; border: GLint; format: GLenum; pixels: ArrayBufferView);
      procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; type: GLenum; source: TexImageSource);
      procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; height: GLsizei; type: GLenum; pixels: ArrayBufferView);
      procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; type: GLenum; source: TexImageSource);
      procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum; pboOffset: GLintptr);
      procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum);
      procedure texImage2D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum; srcData: ArrayBufferView);
      procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum; pboOffset: GLintptr);
      procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum);
      procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum; srcData: ArrayBufferView);
      procedure texImage3D (target: GLenum; level: GLint; internalformat: GLint; width: GLsizei; height: GLsizei; border: GLint; format: GLenum; type: GLenum; srcData: ArrayBufferView);
      procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; format: GLenum; type: GLenum; pboOffset: GLintptr);
      procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; format: GLenum; type: GLenum);
      procedure texSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; format: GLenum; type: GLenum; srcData: ArrayBufferView);
      procedure texSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; height: GLsizei; depth: GLsizei; format: GLenum; type: GLenum);
      procedure texSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; height: GLsizei; depth: GLsizei; format: GLenum; type: GLenum);
      procedure texSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; height: GLsizei; depth: GLsizei; format: GLenum; type: GLenum; srcOffset: GLuint);
      procedure copyTexSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; zoffset: GLint; y: GLint; width: GLsizei; height: GLsizei);
      procedure compressedTexImage2D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; imageSize: GLsizei; offset: GLintptr);
      procedure compressedTexImage2D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; border: GLint; srcData: ArrayBufferView; srcOffset: GLuint; srcLengthOverride: GLuint);
      procedure compressedTexImage3D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; depth: GLsizei; border: GLint; imageSize: GLsizei; offset: GLintptr);
      procedure compressedTexImage3D (target: GLenum; level: GLint; internalformat: GLenum; width: GLsizei; depth: GLsizei; border: GLint; srcData: ArrayBufferView; srcOffset: GLuint; srcLengthOverride: GLuint);
      procedure compressedTexSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; height: GLsizei; format: GLenum; imageSize: GLsizei; offset: GLintptr);
      procedure compressedTexSubImage2D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; height: GLsizei; format: GLenum; srcOffset: GLuint; srcLengthOverride: GLuint);
      procedure compressedTexSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; imageSize: GLsizei; offset: GLintptr);
      procedure compressedTexSubImage3D (target: GLenum; level: GLint; xoffset: GLint; yoffset: GLint; width: GLsizei; height: GLsizei; depth: GLsizei; srcData: ArrayBufferView; srcOffset: GLuint; srcLengthOverride: GLuint);
      function getFragDataLocation (program: WebGLProgram; name: DOMString): GLint;
      procedure uniform1ui (location: TJSWebGLUniformLocation; v0: GLuint);
      procedure uniform2ui (location: TJSWebGLUniformLocation; v0: GLuint; v1: GLuint);
      procedure uniform3ui (location: TJSWebGLUniformLocation; v0: GLuint; v1: GLuint; v2: GLuint);
      procedure uniform4ui (location: TJSWebGLUniformLocation; v0: GLuint; v1: GLuint; v2: GLuint; v3: GLuint);
      procedure uniform1fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform2fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform3fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform4fv (location: TJSWebGLUniformLocation; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform1iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform2iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform3iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform4iv (location: TJSWebGLUniformLocation; data: Int32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform1uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform2uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform3uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniform4uiv (location: TJSWebGLUniformLocation; data: Uint32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix3x2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix4x2fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix2x3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix4x3fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix2x4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix3x4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure uniformMatrix4fv (location: TJSWebGLUniformLocation; transpose: GLboolean; data: Float32List; srcOffset: GLuint; srcLength: GLuint);
      procedure vertexAttribI4i (index: GLuint; x: GLint; y: GLint; z: GLint; w: GLint);
      procedure vertexAttribI4iv (index: GLuint; values: Int32List);
      procedure vertexAttribI4ui (index: GLuint; x: GLuint; y: GLuint; z: GLuint; w: GLuint);
      procedure vertexAttribI4uiv (index: GLuint; values: Uint32List);
      procedure vertexAttribIPointer (index: GLuint; size: GLint; type: GLenum; stride: GLsizei; offset: GLintptr);
      procedure vertexAttribDivisor (index: GLuint; divisor: GLuint);
      procedure drawArraysInstanced (mode: GLenum; first: GLint; count: GLsizei; instanceCount: GLsizei);
      procedure drawElementsInstanced (mode: GLenum; count: GLsizei; type: GLenum; offset: GLintptr; instanceCount: GLsizei);
      procedure drawRangeElements (mode: GLenum; start: GLuint; end: GLuint; count: GLsizei; type: GLenum; offset: GLintptr);
      procedure readPixels (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum);
      procedure readPixels (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum);
      procedure readPixels (x: GLint; y: GLint; width: GLsizei; height: GLsizei; format: GLenum; type: GLenum; dstOffset: GLuint);
      procedure drawBuffers (buffers: GLenumDynArray);
      procedure clearBufferfv (buffer: GLenum; drawbuffer: GLint; values: Float32List; srcOffset: GLuint);
      procedure clearBufferiv (buffer: GLenum; drawbuffer: GLint; values: Int32List; srcOffset: GLuint);
      procedure clearBufferuiv (buffer: GLenum; drawbuffer: GLint; values: Uint32List; srcOffset: GLuint);
      procedure clearBufferfi (buffer: GLenum; drawbuffer: GLint; depth: GLfloat; stencil: GLint);
      function createQuery: TJSWebGLQuery;
      procedure deleteQuery (query: TJSWebGLQuery);
      function isQuery (query: TJSWebGLQuery): GLboolean;
      procedure beginQuery (target: GLenum; query: WebGLQuery);
      procedure endQuery (target: GLenum);
      function getQuery (target: GLenum; pname: GLenum): TJSWebGLQuery;
      function getQueryParameter (query: WebGLQuery; pname: GLenum): JSValue;
      function createSampler: TJSWebGLSampler;
      procedure deleteSampler (sampler: TJSWebGLSampler);
      function isSampler (sampler: TJSWebGLSampler): GLboolean;
      procedure bindSampler (unit: GLuint; sampler: TJSWebGLSampler);
      procedure samplerParameteri (sampler: WebGLSampler; pname: GLenum; param: GLint);
      procedure samplerParameterf (sampler: WebGLSampler; pname: GLenum; param: GLfloat);
      function getSamplerParameter (sampler: WebGLSampler; pname: GLenum): JSValue;
      function fenceSync (condition: GLenum; flags: GLbitfield): TJSWebGLSync;
      function isSync (sync: TJSWebGLSync): GLboolean;
      procedure deleteSync (sync: TJSWebGLSync);
      function clientWaitSync (sync: WebGLSync; flags: GLbitfield; timeout: GLuint64): GLenum;
      procedure waitSync (sync: WebGLSync; flags: GLbitfield; timeout: GLint64);
      function getSyncParameter (sync: WebGLSync; pname: GLenum): JSValue;
      function createTransformFeedback: TJSWebGLTransformFeedback;
      procedure deleteTransformFeedback (tf: TJSWebGLTransformFeedback);
      function isTransformFeedback (tf: TJSWebGLTransformFeedback): GLboolean;
      procedure bindTransformFeedback (target: GLenum; tf: TJSWebGLTransformFeedback);
      procedure beginTransformFeedback (primitiveMode: GLenum);
      procedure endTransformFeedback;
      procedure transformFeedbackVaryings (program: WebGLProgram; varyings: DOMStringDynArray; bufferMode: GLenum);
      function getTransformFeedbackVarying (program: WebGLProgram; index: GLuint): TJSWebGLActiveInfo;
      procedure pauseTransformFeedback;
      procedure resumeTransformFeedback;
      procedure bindBufferBase (target: GLenum; index: GLuint; buffer: TJSWebGLBuffer);
      procedure bindBufferRange (target: GLenum; index: GLuint; buffer: TJSWebGLBuffer; offset: GLintptr; size: GLsizeiptr);
      function getIndexedParameter (target: GLenum; index: GLuint): JSValue;
      function getUniformIndices (program: WebGLProgram; uniformNames: DOMStringDynArray): GLuintDynArray;
      function getActiveUniforms (program: WebGLProgram; uniformIndices: GLuintDynArray; pname: GLenum): JSValue;
      function getUniformBlockIndex (program: WebGLProgram; uniformBlockName: DOMString): GLuint;
      function getActiveUniformBlockParameter (program: WebGLProgram; uniformBlockIndex: GLuint; pname: GLenum): JSValue;
      function getActiveUniformBlockName (program: WebGLProgram; uniformBlockIndex: GLuint): TJSDOMString;
      procedure uniformBlockBinding (program: WebGLProgram; uniformBlockIndex: GLuint; uniformBlockBinding: GLuint);
      function createVertexArray: TJSWebGLVertexArrayObject;
      procedure deleteVertexArray (vertexArray: TJSWebGLVertexArrayObject);
      function isVertexArray (vertexArray: TJSWebGLVertexArrayObject): GLboolean;
      procedure bindVertexArray (array: TJSWebGLVertexArrayObject);
  end;

  TJSWebGL2RenderingContext = class external name 'WebGL2RenderingContext' (TJSWebGL2RenderingContextBase);

implementation
end;


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph
Can someone put a simple guide to building on the wiki? I tried to build from my existing FPC sources and got this error. I never got UNIX down well so I don’t know what else I’m supposed to do besides cd to the directory and use the “make” command. Uploading a stable binary would be nice also but I’m on Mac so maybe only Ingemar has built this before.

Ryans-MacBook-Pro:pas2js ryanjoseph$ make
/usr/local/bin/ppc386 fpmake.pp -n -Fu../../rtl/units/i386-darwin -Fu../../packages/paszlib -Fu../../packages/fcl-process -Fu../../packages/hash -Fu../../packages/libtar -Fu../../packages/fpmkunit/units_bs/i386-darwin  
PPU Loading /Developer/ObjectivePascal/fpc/rtl/units/i386-darwin/system.ppu
PPU Invalid Version 196
Fatal: Can't find unit system used by fpmake
Fatal: Compilation aborted
make: *** [fpmake] Error 1

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Free Pascal - General mailing list
Ryan Joseph <[hidden email]> schrieb am Do., 3. Mai 2018, 04:54:
Can someone put a simple guide to building on the wiki? I tried to build from my existing FPC sources and got this error. I never got UNIX down well so I don’t know what else I’m supposed to do besides cd to the directory and use the “make” command. Uploading a stable binary would be nice also but I’m on Mac so maybe only Ingemar has built this before.

Ryans-MacBook-Pro:pas2js ryanjoseph$ make
/usr/local/bin/ppc386 fpmake.pp -n -Fu../../rtl/units/i386-darwin -Fu../../packages/paszlib -Fu../../packages/fcl-process -Fu../../packages/hash -Fu../../packages/libtar -Fu../../packages/fpmkunit/units_bs/i386-darwin 
PPU Loading /Developer/ObjectivePascal/fpc/rtl/units/i386-darwin/system.ppu
PPU Invalid Version 196
Fatal: Can't find unit system used by fpmake
Fatal: Compilation aborted
make: *** [fpmake] Error 1

A "make all" in the top level directory should suffice (yes, that will build all of FPC, but that is at least more or less guaranteed to work). You can then pick the pas2js binary from the utils/pas2js/bin directory. 

Regards, 
Sven 

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph


> On May 3, 2018, at 12:53 PM, Sven Barth via fpc-pascal <[hidden email]> wrote:
>
> A "make all" in the top level directory should suffice (yes, that will build all of FPC, but that is at least more or less guaranteed to work). You can then pick the pas2js binary from the utils/pas2js/bin directory.
>

where will that output the actual compiler to since I’m building everything now? I’d like to not override any existing installations if possible.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Michael Van Canneyt


On Thu, 3 May 2018, Ryan Joseph wrote:

>
>
>> On May 3, 2018, at 12:53 PM, Sven Barth via fpc-pascal <[hidden email]> wrote:
>>
>> A "make all" in the top level directory should suffice (yes, that will build all of FPC, but that is at least more or less guaranteed to work). You can then pick the pas2js binary from the utils/pas2js/bin directory.
>>
>
> where will that output the actual compiler to since I’m building everything now? I’d like to not override any existing installations if possible.

Nothing will be overridden as long as you do not run 'make install'

utils/pas2js/bin will contain the binaries.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph
In reply to this post by Free Pascal - General mailing list


> On May 3, 2018, at 12:53 PM, Sven Barth via fpc-pascal <[hidden email]> wrote:
>
> A "make all" in the top level directory should suffice (yes, that will build all of FPC, but that is at least more or less guaranteed to work). You can then pick the pas2js binary from the utils/pas2js/bin directory.
>

Make all built the compiler but I didn’t get a /bin directory in pas2js for some reason. I tried using “make clean” and tried again but still nothing. Any ideas?

Ryans-MacBook-Pro:pas2js ryanjoseph$ ls /Developer/ObjectivePascal/fpc/utils/pas2js
Makefile docs pas2js.pp
Makefile.fpc fpmake.lpi pas2jslib.lpi
compileserver.lpi fpmake.pp pas2jslib.pp
compileserver.pp httpcompiler.pp samples
dirwatch.pp pas2js.cfg
dist pas2js.lpi


Start compiling package pastojs for target i386-darwin.
       Compiling pastojs/src/fppas2js.pp
       Compiling pastojs/src/fppjssrcmap.pp
       Compiling pastojs/src/pas2jsfilecache.pp
       Compiling pastojs/src/pas2jslogger.pp
       Compiling pastojs/src/pas2jsfileutils.pp
       Compiling pastojs/src/pas2jsfiler.pp
       Compiling pastojs/src/pas2jspparser.pp
       Compiling pastojs/src/pas2jscompiler.pp
       Compiling pastojs/src/pas2jslibcompiler.pp
[ 96%] Compiled package pastojs


Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Joost van der Sluis
In reply to this post by Ryan Joseph
Op 02-05-18 om 11:28 schreef Ryan Joseph:
> 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.

Actually this makes no sense at all. Pas2js is a separate product that
we should be able to distribute separately from the compiler.

I'm working on a solution. I have it even finished, but only for
fpc-trunk. I thought it would be better to let it gain momentum before
porting it to fpc 3.0.4, but now you convinced me that adding it to
3.0.4 also could help gaining momentum.

I hope I can finish it for fpc 3.0.4 in a few days. Then you can simply
install the latest pas2js version, without having to update the whole of
FPC.

Regards,

Joost.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Joost van der Sluis
In reply to this post by Ryan Joseph
Op 03-05-18 om 11:00 schreef Ryan Joseph:
>> A "make all" in the top level directory should suffice (yes, that will build all of FPC, but that is at least more or less guaranteed to work). You can then pick the pas2js binary from the utils/pas2js/bin directory.
>>
> Make all built the compiler but I didn’t get a /bin directory in pas2js for some reason. I tried using “make clean” and tried again but still nothing. Any ideas?

Seems like it that pas2js is not included in a default build.

Change the current directory to utils/pas2js, then do 'make all'.

Regards,

Joost.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph
In reply to this post by Joost van der Sluis


> On May 3, 2018, at 8:23 PM, Joost van der Sluis <[hidden email]> wrote:
>
> Actually this makes no sense at all. Pas2js is a separate product that we should be able to distribute separately from the compiler.

But doesn’t it extend the existing compiler to gain access to the parser?

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph
In reply to this post by Joost van der Sluis


> On May 3, 2018, at 8:26 PM, Joost van der Sluis <[hidden email]> wrote:
>
> Change the current directory to utils/pas2js, then do 'make all'.

That’s what I tried first but was told to do it on the top level directory.

There’s the error I get. Maybe I need to trash entire directory and start fresh?

Ryans-MacBook-Pro:pas2js ryanjoseph$ make all
/usr/local/bin/ppc386 fpmake.pp -n -Fu../../rtl/units/i386-darwin -Fu../../packages/paszlib/units/i386-darwin -Fu../../packages/fcl-process/units/i386-darwin -Fu../../packages/hash/units/i386-darwin -Fu../../packages/libtar/units/i386-darwin -Fu../../packages/fpmkunit/units/i386-darwin  
PPU Loading /Developer/ObjectivePascal/fpc/rtl/units/i386-darwin/system.ppu
PPU Invalid Version 200
Fatal: Can't find unit system used by fpmake
Fatal: Compilation aborted
make: *** [fpmake] Error 1

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Michael Van Canneyt
In reply to this post by Joost van der Sluis


On Thu, 3 May 2018, Joost van der Sluis wrote:

> Op 02-05-18 om 11:28 schreef Ryan Joseph:
>> 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.
>
> Actually this makes no sense at all. Pas2js is a separate product that
> we should be able to distribute separately from the compiler.

We do so, Mattias always posts an announcement with a link to the
latest version.

>
> I'm working on a solution. I have it even finished, but only for
> fpc-trunk. I thought it would be better to let it gain momentum before
> porting it to fpc 3.0.4, but now you convinced me that adding it to
> 3.0.4 also could help gaining momentum.

You can perfectly build it with 3.0.4, just as you can build fpReport with 3.0.4 and
quite some other things.

The problem is just 1 call: a missing addLibrary in 3.0.4, which prevents
fpmake.pp from compiling.

Copying fpmkunit from trunk would also have done the job.

That said, making it even more easy to compile/install it is a welcome improvement.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Michael Van Canneyt
In reply to this post by Ryan Joseph


On Thu, 3 May 2018, Ryan Joseph wrote:

>
>
>> On May 3, 2018, at 8:23 PM, Joost van der Sluis <[hidden email]> wrote:
>>
>> Actually this makes no sense at all. Pas2js is a separate product that we should be able to distribute separately from the compiler.
>
> But doesn’t it extend the existing compiler to gain access to the parser?

No. It uses the parser from the documentation generator.

That is why it includes the fcl-passrc etc. packages from trunk through
svn:external links.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph
In reply to this post by Ryan Joseph
Are there any other ideas I could try to get this working? No idea why the PPU version is wrong after a totally clean build (i.e. trashed the entire directory and recompiled). If another Mac user has a binary they could upload that would be nice also.

> On May 4, 2018, at 8:41 AM, Ryan Joseph <[hidden email]> wrote:
>
> Is this a Mac problem I’m having? I downloaded new sources, did a make all in the top level and make all again in pas2js. The last few lines are the make all for the compiler which ends without error then I cd to /utils/pas2js and make all again. Same error on the invalid PPU.
>
> [100%] Compiled package utils-unicode
> /bin/echo Build > build-stamp.i386-darwin
> /bin/echo Build > base.build-stamp.i386-darwin
> Ryans-MacBook-Pro:fpc ryanjoseph$ cd /Developer/ObjectivePascal/fpc/utils/pas2js
> Ryans-MacBook-Pro:pas2js ryanjoseph$ make all
> /usr/local/bin/ppc386 fpmake.pp -n -Fu../../rtl/units/i386-darwin -Fu../../packages/paszlib/units/i386-darwin -Fu../../packages/fcl-process/units/i386-darwin -Fu../../packages/hash/units/i386-darwin -Fu../../packages/libtar/units/i386-darwin -Fu../../packages/fpmkunit/units/i386-darwin  
> PPU Loading /Developer/ObjectivePascal/fpc/rtl/units/i386-darwin/system.ppu
> PPU Invalid Version 200
> Fatal: Can't find unit system used by fpmake
> Fatal: Compilation aborted
> make: *** [fpmake] Error 1

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Michael Van Canneyt

IMO the simplest solution for you is to use the pas2js repo:

Remove the line in fpMake.pp that adds the library.
Run make all.

You will not have the library version of the compiler, but the rest should
be compiled: command-line compiler and web compiler.

Michael.

On Tue, 8 May 2018, Ryan Joseph wrote:

> Are there any other ideas I could try to get this working? No idea why the PPU version is wrong after a totally clean build (i.e. trashed the entire directory and recompiled). If another Mac user has a binary they could upload that would be nice also.
>
>> On May 4, 2018, at 8:41 AM, Ryan Joseph <[hidden email]> wrote:
>>
>> Is this a Mac problem I’m having? I downloaded new sources, did a make all in the top level and make all again in pas2js. The last few lines are the make all for the compiler which ends without error then I cd to /utils/pas2js and make all again. Same error on the invalid PPU.
>>
>> [100%] Compiled package utils-unicode
>> /bin/echo Build > build-stamp.i386-darwin
>> /bin/echo Build > base.build-stamp.i386-darwin
>> Ryans-MacBook-Pro:fpc ryanjoseph$ cd /Developer/ObjectivePascal/fpc/utils/pas2js
>> Ryans-MacBook-Pro:pas2js ryanjoseph$ make all
>> /usr/local/bin/ppc386 fpmake.pp -n -Fu../../rtl/units/i386-darwin -Fu../../packages/paszlib/units/i386-darwin -Fu../../packages/fcl-process/units/i386-darwin -Fu../../packages/hash/units/i386-darwin -Fu../../packages/libtar/units/i386-darwin -Fu../../packages/fpmkunit/units/i386-darwin
>> PPU Loading /Developer/ObjectivePascal/fpc/rtl/units/i386-darwin/system.ppu
>> PPU Invalid Version 200
>> Fatal: Can't find unit system used by fpmake
>> Fatal: Compilation aborted
>> make: *** [fpmake] Error 1
>
> Regards,
> Ryan Joseph
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph
You mean this line: PT:=P.Targets.AddLibrary('pas2jslib.pp’);?

I removed that line but if I do a “make all” in the /utils/pas2js directory I still get this error. I remember getting this in the past before and doing a clean install seem to fix it but not this time. The file system.ppu is the culprit but that was built from the original make all on the top directory.

/usr/local/bin/ppc386 fpmake.pp -n -Fu../../rtl/units/i386-darwin -Fu../../packages/paszlib/units/i386-darwin -Fu../../packages/fcl-process/units/i386-darwin -Fu../../packages/hash/units/i386-darwin -Fu../../packages/libtar/units/i386-darwin -Fu../../packages/fpmkunit/units/i386-darwin  
PPU Loading /Developer/ObjectivePascal/fpc/rtl/units/i386-darwin/system.ppu
PPU Invalid Version 200
Fatal: Can't find unit system used by fpmake
Fatal: Compilation aborted


> On May 8, 2018, at 12:55 PM, Michael Van Canneyt <[hidden email]> wrote:
>
> IMO the simplest solution for you is to use the pas2js repo:
>
> Remove the line in fpMake.pp that adds the library. Run make all.
>
> You will not have the library version of the compiler, but the rest should
> be compiled: command-line compiler and web compiler.
>
> Michael.

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Michael Van Canneyt


On Tue, 8 May 2018, Ryan Joseph wrote:

> You mean this line: PT:=P.Targets.AddLibrary('pas2jslib.pp’);?

Yes.

>
> I removed that line but if I do a “make all” in the /utils/pas2js directory I still get this error. I remember getting this in the past before and doing a clean install seem to fix it but not this time. The file system.ppu is the culprit but that was built from the original make all on the top directory.
>

Yes, but do not do this in the utils/pas2js directory.

Do a checkout of the pas2js repo, and in the toplevel fpmake.pp, remove the
line with AddLibrary.


Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph


> On May 8, 2018, at 6:47 PM, Michael Van Canneyt <[hidden email]> wrote:
>
> Do a checkout of the pas2js repo, and in the toplevel fpmake.pp, remove the
> line with AddLibrary.

Ok it finally worked. The fpmake.pp file at https://svn.freepascal.org/svn/projects/pas2js/trunk was totally different than the one in the compiler sources.

May I suggest you put these instructions at the top level of the wiki? It’s pretty easy but I wasn’t able to build it for literally days and could have easily given up.

Something like that would have been really helpful:

1) svn co https://svn.freepascal.org/svn/projects/pas2js/trunk
2) cd trunk (or rename to pas2js)
3) modify fpmake.pp as explained
4) make all

What did I lose removing AddLibrary btw?

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: pas2js Webgl unit committed

Ryan Joseph


> On May 9, 2018, at 8:41 AM, Ryan Joseph <[hidden email]> wrote:
>
> Ok it finally worked.

Making progress but the wiki is incomplete I think. I figured out how to add the rtl with -Fu but I’m getting an error. What’s wrong with that name? Can you show an example of a working command line?

./pas2js -Jc -Jirtl.js -Tbrowser -Fu/Developer/pas2js/packages/rtl /Users/ryanjoseph/Downloads/hello.pas
Fatal: Compilation aborted
invalid custom JS file name "rtl.js"

Regards,
        Ryan Joseph

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
123