From 2cd04ea4a34925b7de324bda0e136565c9898c2a Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 12 Jul 2018 18:13:08 -0700 Subject: [PATCH] Documentation improvements --- .../native/NativeOpenGLRenderContext.hx | 1 + src/lime/graphics/ImageBuffer.hx | 58 +++++++++++++++++++ src/lime/graphics/OpenGLES2RenderContext.hx | 32 +++++++++- src/lime/graphics/OpenGLES3RenderContext.hx | 33 ++++++++++- src/lime/graphics/OpenGLRenderContext.hx | 31 +++++++++- src/lime/graphics/WebGL2RenderContext.hx | 26 ++++++++- src/lime/graphics/WebGLRenderContext.hx | 28 ++++++++- src/lime/graphics/opengl/GL.hx | 8 +-- src/lime/ui/Window.hx | 8 +-- 9 files changed, 208 insertions(+), 17 deletions(-) diff --git a/src/lime/_internal/backend/native/NativeOpenGLRenderContext.hx b/src/lime/_internal/backend/native/NativeOpenGLRenderContext.hx index be5f5f58e..d06dc0142 100644 --- a/src/lime/_internal/backend/native/NativeOpenGLRenderContext.hx +++ b/src/lime/_internal/backend/native/NativeOpenGLRenderContext.hx @@ -32,6 +32,7 @@ import lime.utils.UInt32Array; @:noDebug #end +@:dox(hide) @:allow(lime.ui.Window) @:access(lime._internal.backend.native.NativeCFFI) @:access(lime.graphics.opengl) diff --git a/src/lime/graphics/ImageBuffer.hx b/src/lime/graphics/ImageBuffer.hx index 3d130b886..5b7aeaea4 100644 --- a/src/lime/graphics/ImageBuffer.hx +++ b/src/lime/graphics/ImageBuffer.hx @@ -17,6 +17,13 @@ import js.Browser; import flash.display.BitmapData; #end + +/** + `ImageBuffer` is a simple object for storing image data. + + For higher-level operations, use the `Image` class. +**/ + #if !lime_debug @:fileXml('tags="haxe,release"') @:noDebug @@ -32,16 +39,52 @@ import flash.display.BitmapData; class ImageBuffer { + /** + The number of bits per pixel in this image data + **/ public var bitsPerPixel:Int; + + /** + The data for this image, represented as a `UInt8Array` + **/ public var data:UInt8Array; + + /** + The `PixelFormat` for this image data + **/ public var format:PixelFormat; + + /** + The height of this image data + **/ public var height:Int; + + /** + Whether the image data has premultiplied alpha + **/ public var premultiplied:Bool; + + /** + The data for this image, represented as a `js.html.CanvasElement`, `js.html.Image` or `flash.display.BitmapData` + **/ public var src (get, set):Dynamic; + + /** + The stride, or number of data values per row in the image data + **/ public var stride (get, never):Int; + + /** + Whether this image data is transparent + **/ public var transparent:Bool; + + /** + The width of this image data + **/ public var width:Int; + @:noCompletion private var __srcBitmapData:#if flash BitmapData #else Dynamic #end; @:noCompletion private var __srcCanvas:#if (js && html5) CanvasElement #else Dynamic #end; @:noCompletion private var __srcContext:#if (js && html5) CanvasRenderingContext2D #else Dynamic #end; @@ -63,6 +106,14 @@ class ImageBuffer { #end + /** + Creates a new `ImageBuffer` instance + @param data (Optional) Initial `UInt8Array` data + @param width (Optional) An initial `width` value + @param height (Optional) An initial `height` value + @param bitsPerPixel (Optional) The `bitsPerPixel` of the data (default is 32) + @param format (Optional) The `PixelFormat` of this image buffer + **/ public function new (data:UInt8Array = null, width:Int = 0, height:Int = 0, bitsPerPixel:Int = 32, format:PixelFormat = null) { this.data = data; @@ -76,6 +127,13 @@ class ImageBuffer { } + /** + Creates a duplicate of this `ImageBuffer` + + If the current `ImageBuffer` has `data` or `src` information, this will be + cloned as well. + @return A new `ImageBuffer` with duplicate values + **/ public function clone ():ImageBuffer { var buffer = new ImageBuffer (data, width, height, bitsPerPixel); diff --git a/src/lime/graphics/OpenGLES2RenderContext.hx b/src/lime/graphics/OpenGLES2RenderContext.hx index 555d95f9c..d5a7d999d 100644 --- a/src/lime/graphics/OpenGLES2RenderContext.hx +++ b/src/lime/graphics/OpenGLES2RenderContext.hx @@ -1,9 +1,35 @@ -package lime.graphics; #if (!lime_doc_gen || lime_opengl || lime_opengles) #if (sys && lime_cffi && lime_opengl && !doc_gen) +package lime.graphics; #if (!lime_doc_gen || lime_opengl || lime_opengles) #if (lime_doc_gen || (sys && lime_cffi)) import lime.graphics.opengl.*; +/** + The `OpenGLES2RenderContext` allows access to OpenGL ES 2.0 features when OpenGL or + OpenGL ES is the render context type of the `Window`. + + Using an OpenGL ES context on a desktop platform enables support for cross-platform + code that should run on the majority of desktop and mobile platforms (when using + hardware acceleration). + + Platforms supporting an OpenGL ES context are compatible with the Lime + `WebGLRenderContext` if you would prefer to write WebGL-style code, or support web + browsers with the same code. + + You can convert from `lime.graphics.RenderContext`, `lime.graphics.OpenGLRenderContext`, + `lime.graphics.OpenGLES3RenderContext`, `lime.graphics.opengl.GL`, and can convert to + `lime.graphics.WebGLRenderContext` directly if desired: + + ``` + var gles2:OpenGLES2RenderContext = window.context; + var gles2:OpenGLES2RenderContext = gl; + var gles2:OpenGLES2RenderContext = gles3; + var gles2:OpenGLES2RenderContext = GL; + + var webgl:WebGLRenderContext = gles2; + ``` +**/ + @:forward(ACTIVE_ATTRIBUTES, ACTIVE_TEXTURE, ACTIVE_UNIFORMS, ALIASED_LINE_WIDTH_RANGE, ALIASED_POINT_SIZE_RANGE, ALPHA, ALPHA_BITS, ALWAYS, ARRAY_BUFFER, ARRAY_BUFFER_BINDING, ATTACHED_SHADERS, BACK, BLEND, BLEND_COLOR, BLEND_DST_ALPHA, BLEND_DST_RGB, BLEND_EQUATION, @@ -91,7 +117,7 @@ vertexAttrib3fv, vertexAttrib4f, vertexAttrib4fv, vertexAttribPointer, viewport, EXTENSIONS, type, version) -abstract OpenGLES2RenderContext(OpenGLES3RenderContext) from OpenGLES3RenderContext #if (!lime_doc_gen && lime_opengl) from OpenGLRenderContext #end { +abstract OpenGLES2RenderContext(OpenGLES3RenderContext) from OpenGLES3RenderContext #if (!doc_gen && lime_opengl) from OpenGLRenderContext #end { @:from private static function fromGL (gl:Class):OpenGLES2RenderContext { @@ -136,7 +162,7 @@ abstract OpenGLES2RenderContext(Dynamic) from Dynamic to Dynamic { } - #if (!lime_doc_gen && lime_opengl) + #if (!doc_gen && lime_opengl) @:from private static function fromOpenGLRenderContext (gl:OpenGLRenderContext):OpenGLES2RenderContext { return null; diff --git a/src/lime/graphics/OpenGLES3RenderContext.hx b/src/lime/graphics/OpenGLES3RenderContext.hx index 743649337..2f8152419 100644 --- a/src/lime/graphics/OpenGLES3RenderContext.hx +++ b/src/lime/graphics/OpenGLES3RenderContext.hx @@ -1,4 +1,4 @@ -package lime.graphics; #if (!lime_doc_gen || lime_opengl || lime_opengles) #if (sys && lime_cffi && lime_opengl && !doc_gen) +package lime.graphics; #if (!lime_doc_gen || lime_opengl || lime_opengles) #if (lime_doc_gen || (sys && lime_cffi)) import haxe.Int64; @@ -9,6 +9,37 @@ import lime.utils.DataPointer; import lime.utils.Float32Array; import lime.utils.Int32Array; + +/** + The `OpenGLES3RenderContext` allows access to OpenGL ES 3.0 features when OpenGL or + OpenGL ES is the render context type of the `Window`, and the current context supports + GLES3 features. + + Using an OpenGL ES context on a desktop platform enables support for cross-platform + code that should run on both desktop and mobile platforms (when using + hardware acceleration), though support for OpenGL ES 3.0 features are more limited than + GLES2. + + Platforms supporting an OpenGL ES 3.0 context are compatible with the Lime + `WebGLRenderContext` as well as the `WebGL2RenderContext` if you would prefer to write + WebGL-style code, or support web browsers with the same code. Be aware that not all + browsers support WebGL 2, so only plain WebGL might be available. + + You can convert from `lime.graphics.RenderContext`, `lime.graphics.OpenGLRenderContext`, + `lime.graphics.opengl.GL`, and can convert to `lime.graphics.OpenGLES2RenderContext`, + `lime.graphics.WebGL2RenderContext` or `lime.graphics.WebGLRenderContext` directly + if desired: + + ``` + var gles3:OpenGLES3RenderContext = window.context; + var gles3:OpenGLES3RenderContext = gl; + var gles3:OpenGLES3RenderContext = GL; + + var gles2:OpenGLES2RenderContext = gles3; + var webgl2:WebGL2RenderContext = gles3; + var webgl:WebGLRenderContext = gles3; +**/ + @:forward diff --git a/src/lime/graphics/OpenGLRenderContext.hx b/src/lime/graphics/OpenGLRenderContext.hx index 97d57d52c..122b906c7 100644 --- a/src/lime/graphics/OpenGLRenderContext.hx +++ b/src/lime/graphics/OpenGLRenderContext.hx @@ -1,8 +1,37 @@ -package lime.graphics; #if (!lime_doc_gen || lime_opengl) #if (sys && lime_cffi && lime_opengl && !doc_gen) +package lime.graphics; #if (!lime_doc_gen || lime_opengl) #if (lime_doc_gen || (sys && lime_cffi)) import lime._internal.backend.native.NativeOpenGLRenderContext; + +/** + The `OpenGLRenderContext` allows access to OpenGL features when OpenGL is the render + context type of the `Window`. Historically, Lime was designed for WebGL render support + on all platforms, and support has expanded to provide additional OpenGL ES native APIs. + + Support for desktop OpenGL-specific features is currently sparse, but the + `OpenGLRenderContext` provides the platform for us to add additional desktop specific + features. + + The `OpenGLRenderContext` is not compatible with mobile or web targets, but it can be + converted to an OpenGL ES or a WebGL-style context for cross-platform development. + + You can convert from `lime.graphics.RenderContext` or `lime.graphics.opengl.GL`, and + can convert to `lime.graphics.OpenGLES3RenderContext`, + `lime.graphics.OpenGLES2RenderContext`, `lime.graphics.WebGL2RenderContext`, or + `lime.graphics.WebGLRenderContext` directly if desired: + + ``` + var gl:OpenGLRenderContext = window.context; + var gl:OpenGLRenderContext = GL; + + var gles3:OpenGLES3RenderContext = gl; + var gles2:OpenGLES2RenderContext = gl; + var webgl2:WebGL2RenderContext = gl; + var webgl:WebGLRenderContext = gl; + ``` +**/ + @:access(lime.graphics.RenderContext) @:forward() diff --git a/src/lime/graphics/WebGL2RenderContext.hx b/src/lime/graphics/WebGL2RenderContext.hx index fa7024220..0059ae95a 100644 --- a/src/lime/graphics/WebGL2RenderContext.hx +++ b/src/lime/graphics/WebGL2RenderContext.hx @@ -343,6 +343,30 @@ import lime.utils.Float32Array; import lime.utils.Int32Array; import lime.utils.UInt32Array; + +/** + The `WebGL2RenderContext` allows access to WebGL 2 features when OpenGL, OpenGL ES + or WebGL is the render context type of the `Window`, and the current context supports + WebGL 2 features. + + Using a WebGL context on a desktop platform enables support for cross-platform + code that should run on all platforms (when using hardware acceleration), though support + for WebGL 2 features are more limited than WebGL, and require an OpenGL ES 3.0 compatible + desktop or mobile context. + + You can convert from `lime.graphics.RenderContext`, `lime.graphics.OpenGLRenderContext`, + `lime.graphics.OpenGLES3RenderContext` or `lime.graphics.opengl.GL`, and can convert to + `lime.graphics.WebGLRenderContext` directly if desired: + + ``` + var webgl2:WebGL2RenderContext = window.context; + var webgl2:WebGL2RenderContext = gl; + var webgl2:WebGL2RenderContext = gles3; + var webgl2:WebGL2RenderContext = GL; + + var webgl:WebGLRenderContext = webgl2; +**/ + @:access(lime.graphics.RenderContext) @@ -3200,7 +3224,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic { } - #if (!lime_doc_gen && (lime_opengl || lime_opengles)) + #if (!doc_gen && (lime_opengl || lime_opengles)) @:from private static function fromOpenGLES3RenderContext (gl:OpenGLES3RenderContext):WebGL2RenderContext { return cast gl; diff --git a/src/lime/graphics/WebGLRenderContext.hx b/src/lime/graphics/WebGLRenderContext.hx index d0e5a9006..d1e702c04 100644 --- a/src/lime/graphics/WebGLRenderContext.hx +++ b/src/lime/graphics/WebGLRenderContext.hx @@ -5,6 +5,28 @@ import lime.graphics.opengl.*; import lime.utils.ArrayBufferView; import lime.utils.Float32Array; + +/** + The `WebGLRenderContext` allows access to WebGL features when OpenGL, OpenGL ES or + WebGL is the render context type of the `Window`. + + Using a WebGL context on a desktop or mobile platform enables support for cross-platform + code that should run all platforms (when hardware acceleration is supported). + + You can convert from `lime.graphics.RenderContext`, `lime.graphics.OpenGLRenderContext`, + `lime.graphics.OpenGLES3RenderContext`, `lime.graphics.OpenGLES2RenderContext`, + `lime.graphics.WebGL2RenderContext` or `lime.graphics.opengl.GL` directly if desired: + + ``` + var webgl:WebGLRenderContext = window.context; + var webgl:WebGLRenderContext = gl; + var webgl:WebGLRenderContext = gles3; + var webgl:WebGLRenderContext = gles2; + var webgl:WebGLRenderContext = webgl2; + var webgl:WebGLRenderContext = GL; + ``` +**/ + @:forward(DEPTH_BUFFER_BIT, STENCIL_BUFFER_BIT, COLOR_BUFFER_BIT, POINTS, LINES, LINE_LOOP, LINE_STRIP, TRIANGLES, TRIANGLE_STRIP, TRIANGLE_FAN, ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA_SATURATE, FUNC_ADD, BLEND_EQUATION, BLEND_EQUATION_RGB, BLEND_EQUATION_ALPHA, FUNC_SUBTRACT, FUNC_REVERSE_SUBTRACT, BLEND_DST_RGB, BLEND_SRC_RGB, BLEND_DST_ALPHA, BLEND_SRC_ALPHA, CONSTANT_COLOR, ONE_MINUS_CONSTANT_COLOR, CONSTANT_ALPHA, ONE_MINUS_CONSTANT_ALPHA, BLEND_COLOR, ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, ARRAY_BUFFER_BINDING, ELEMENT_ARRAY_BUFFER_BINDING, STREAM_DRAW, STATIC_DRAW, DYNAMIC_DRAW, BUFFER_SIZE, BUFFER_USAGE, CURRENT_VERTEX_ATTRIB, FRONT, BACK, FRONT_AND_BACK, CULL_FACE, BLEND, DITHER, STENCIL_TEST, DEPTH_TEST, SCISSOR_TEST, POLYGON_OFFSET_FILL, SAMPLE_ALPHA_TO_COVERAGE, SAMPLE_COVERAGE, NO_ERROR, INVALID_ENUM, INVALID_VALUE, INVALID_OPERATION, OUT_OF_MEMORY, CW , CCW, LINE_WIDTH, ALIASED_POINT_SIZE_RANGE, ALIASED_LINE_WIDTH_RANGE, CULL_FACE_MODE, FRONT_FACE, DEPTH_RANGE, DEPTH_WRITEMASK, DEPTH_CLEAR_VALUE, DEPTH_FUNC, STENCIL_CLEAR_VALUE, STENCIL_FUNC, STENCIL_FAIL, STENCIL_PASS_DEPTH_FAIL, STENCIL_PASS_DEPTH_PASS, STENCIL_REF, STENCIL_VALUE_MASK, STENCIL_WRITEMASK, STENCIL_BACK_FUNC, STENCIL_BACK_FAIL, STENCIL_BACK_PASS_DEPTH_FAIL, STENCIL_BACK_PASS_DEPTH_PASS, STENCIL_BACK_REF, STENCIL_BACK_VALUE_MASK, STENCIL_BACK_WRITEMASK, VIEWPORT, SCISSOR_BOX, COLOR_CLEAR_VALUE, COLOR_WRITEMASK, UNPACK_ALIGNMENT, PACK_ALIGNMENT, MAX_TEXTURE_SIZE, MAX_VIEWPORT_DIMS, SUBPIXEL_BITS, RED_BITS, GREEN_BITS, BLUE_BITS, ALPHA_BITS, DEPTH_BITS, STENCIL_BITS, POLYGON_OFFSET_UNITS, POLYGON_OFFSET_FACTOR, TEXTURE_BINDING_2D, SAMPLE_BUFFERS, SAMPLES, SAMPLE_COVERAGE_VALUE, SAMPLE_COVERAGE_INVERT, COMPRESSED_TEXTURE_FORMATS, DONT_CARE, FASTEST, NICEST, GENERATE_MIPMAP_HINT, BYTE, UNSIGNED_BYTE, SHORT, UNSIGNED_SHORT, INT, UNSIGNED_INT, FLOAT, DEPTH_COMPONENT, ALPHA, RGB, RGBA, LUMINANCE, LUMINANCE_ALPHA, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1, UNSIGNED_SHORT_5_6_5, FRAGMENT_SHADER, VERTEX_SHADER, MAX_VERTEX_ATTRIBS, MAX_VERTEX_UNIFORM_VECTORS, MAX_VARYING_VECTORS, MAX_COMBINED_TEXTURE_IMAGE_UNITS, MAX_VERTEX_TEXTURE_IMAGE_UNITS, MAX_TEXTURE_IMAGE_UNITS, MAX_FRAGMENT_UNIFORM_VECTORS, SHADER_TYPE, DELETE_STATUS, LINK_STATUS, VALIDATE_STATUS, ATTACHED_SHADERS, ACTIVE_UNIFORMS, ACTIVE_ATTRIBUTES, SHADING_LANGUAGE_VERSION, CURRENT_PROGRAM, NEVER, LESS, EQUAL, LEQUAL, GREATER, NOTEQUAL, GEQUAL, ALWAYS, KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, DECR_WRAP, VENDOR, RENDERER, VERSION, NEAREST, LINEAR, NEAREST_MIPMAP_NEAREST, LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR, LINEAR_MIPMAP_LINEAR, TEXTURE_MAG_FILTER, TEXTURE_MIN_FILTER, TEXTURE_WRAP_S, TEXTURE_WRAP_T, TEXTURE_2D, TEXTURE, TEXTURE_CUBE_MAP, TEXTURE_BINDING_CUBE_MAP, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z, MAX_CUBE_MAP_TEXTURE_SIZE, TEXTURE0, TEXTURE1, TEXTURE2, TEXTURE3, TEXTURE4, TEXTURE5, TEXTURE6, TEXTURE7, TEXTURE8, TEXTURE9, TEXTURE10, TEXTURE11, TEXTURE12, TEXTURE13, TEXTURE14, TEXTURE15, TEXTURE16, TEXTURE17, TEXTURE18, TEXTURE19, TEXTURE20, TEXTURE21, TEXTURE22, TEXTURE23, TEXTURE24, TEXTURE25, TEXTURE26, TEXTURE27, TEXTURE28, TEXTURE29, TEXTURE30, TEXTURE31, ACTIVE_TEXTURE, REPEAT, CLAMP_TO_EDGE, MIRRORED_REPEAT, FLOAT_VEC2, FLOAT_VEC3, FLOAT_VEC4, INT_VEC2, INT_VEC3, INT_VEC4, BOOL, BOOL_VEC2, BOOL_VEC3, BOOL_VEC4, FLOAT_MAT2, FLOAT_MAT3, FLOAT_MAT4, SAMPLER_2D, SAMPLER_CUBE, VERTEX_ATTRIB_ARRAY_ENABLED, VERTEX_ATTRIB_ARRAY_SIZE, VERTEX_ATTRIB_ARRAY_STRIDE, VERTEX_ATTRIB_ARRAY_TYPE, VERTEX_ATTRIB_ARRAY_NORMALIZED, VERTEX_ATTRIB_ARRAY_POINTER, VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, COMPILE_STATUS, LOW_FLOAT, MEDIUM_FLOAT, HIGH_FLOAT, LOW_INT, MEDIUM_INT, HIGH_INT, FRAMEBUFFER, RENDERBUFFER, RGBA4, RGB5_A1, RGB565, DEPTH_COMPONENT16, STENCIL_INDEX, STENCIL_INDEX8, DEPTH_STENCIL, RENDERBUFFER_WIDTH, RENDERBUFFER_HEIGHT, RENDERBUFFER_INTERNAL_FORMAT, RENDERBUFFER_RED_SIZE, RENDERBUFFER_GREEN_SIZE, RENDERBUFFER_BLUE_SIZE, RENDERBUFFER_ALPHA_SIZE, RENDERBUFFER_DEPTH_SIZE, RENDERBUFFER_STENCIL_SIZE, FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE, COLOR_ATTACHMENT0, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT, DEPTH_STENCIL_ATTACHMENT, NONE, FRAMEBUFFER_COMPLETE, FRAMEBUFFER_INCOMPLETE_ATTACHMENT, FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT, FRAMEBUFFER_INCOMPLETE_DIMENSIONS, FRAMEBUFFER_UNSUPPORTED, FRAMEBUFFER_BINDING, RENDERBUFFER_BINDING, MAX_RENDERBUFFER_SIZE, INVALID_FRAMEBUFFER_OPERATION, UNPACK_FLIP_Y_WEBGL, UNPACK_PREMULTIPLY_ALPHA_WEBGL, CONTEXT_LOST_WEBGL, UNPACK_COLORSPACE_CONVERSION_WEBGL, BROWSER_DEFAULT_WEBGL, type, version, activeTexture, attachShader, bindAttribLocation, bindBuffer, bindFramebuffer, bindRenderbuffer, bindTexture, blendColor, blendEquation, blendEquationSeparate, blendFunc, blendFuncSeparate, checkFramebufferStatus, clear, clearColor, clearDepth, clearStencil, colorMask, compileShader, copyTexImage2D, copyTexSubImage2D, createBuffer, createFramebuffer, createProgram, createRenderbuffer, createShader, createTexture, cullFace, cullFace, deleteBuffer, deleteFramebuffer, deleteProgram, deleteRenderbuffer, deleteShader, deleteTexture, depthFunc, depthMask, depthRange, detachShader, disable, disableVertexAttribArray, drawArrays, drawElements, enable, enableVertexAttribArray, finish, flush, framebufferRenderbuffer, framebufferTexture2D, frontFace, generateMipmap, getActiveAttrib, getActiveUniform, getAttachedShaders, getAttribLocation, getBufferParameter, getContextAttributes, getError, getExtension, getFramebufferAttachmentParameter, getParameter, getProgramInfoLog, getProgramParameter, getRenderbufferParameter, getShaderInfoLog, getShaderParameter, getShaderPrecisionFormat, getShaderSource, getSupportedExtensions, getTexParameter, getUniform, getUniformLocation, getVertexAttrib, getVertexAttribOffset, hint, isBuffer, isContextLost, isEnabled, isFramebuffer, isProgram, isRenderbuffer, isShader, isTexture, lineWidth, linkProgram, pixelStorei, polygonOffset, renderbufferStorage, sampleCoverage, scissor, shaderSource, stencilFunc, stencilFuncSeparate, stencilMask, stencilMaskSeparate, stencilOp, stencilOpSeparate, texParameterf, texParameteri, uniform1f, uniform1fv, uniform1i, uniform1iv, uniform2f, uniform2fv, uniform2i, uniform2iv, uniform3f, uniform3fv, uniform3i, uniform3iv, uniform4f, uniform4fv, uniform4i, uniform4iv, useProgram, validateProgram, vertexAttrib1f, vertexAttrib1fv, vertexAttrib2f, vertexAttrib2fv, vertexAttrib3f, vertexAttrib3fv, vertexAttrib4f, vertexAttrib4fv, vertexAttribPointer, viewport) @@ -131,7 +153,7 @@ abstract WebGLRenderContext(WebGL2RenderContext) { } - #if (!lime_doc_gen && lime_opengl) + #if (!doc_gen && lime_opengl) @:from private static function fromOpenGLContext (gl:OpenGLRenderContext):WebGLRenderContext { #if (sys && lime_cffi && lime_opengl) @@ -144,7 +166,7 @@ abstract WebGLRenderContext(WebGL2RenderContext) { #end - #if (!lime_doc_gen && (lime_opengl || lime_opengles)) + #if (!doc_gen && (lime_opengl || lime_opengles)) @:from private static function fromOpenGLES2Context (gl:OpenGLES2RenderContext):WebGLRenderContext { #if (sys && lime_cffi && lime_opengl) @@ -157,7 +179,7 @@ abstract WebGLRenderContext(WebGL2RenderContext) { #end - #if (!lime_doc_gen && (lime_opengl || lime_opengles)) + #if (!doc_gen && (lime_opengl || lime_opengles)) @:from private static function fromOpenGLES3Context (gl:OpenGLES3RenderContext):WebGLRenderContext { #if (sys && lime_cffi && lime_opengl) diff --git a/src/lime/graphics/opengl/GL.hx b/src/lime/graphics/opengl/GL.hx index ad70f960f..e025f534f 100644 --- a/src/lime/graphics/opengl/GL.hx +++ b/src/lime/graphics/opengl/GL.hx @@ -650,11 +650,11 @@ class GL { public static inline var TIMEOUT_IGNORED = -1; public static inline var MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247; - #if (sys && lime_cffi && lime_opengl && !doc_gen) + #if lime_opengl public static var context (default, null):OpenGLRenderContext; - #elseif mobile - public static var context (default, null):OpenGLES2RenderContext; - #elseif (js && html5) + #elseif lime_opengles + public static var context (default, null):OpenGLES3RenderContext; + #elseif lime_webgl public static var context (default, null):WebGL2RenderContext; #else public static var context (default, null):Dynamic; diff --git a/src/lime/ui/Window.hx b/src/lime/ui/Window.hx index b914d1b8c..4fc049983 100644 --- a/src/lime/ui/Window.hx +++ b/src/lime/ui/Window.hx @@ -10,6 +10,10 @@ import lime.math.Rectangle; import lime.system.Display; import lime.system.DisplayMode; +#if (js && html5) +import js.html.Element; +#end + #if openfl import openfl.display.Stage; #elseif flash @@ -18,10 +22,6 @@ import flash.display.Stage; typedef Stage = Dynamic; #end -#if (js && html5) -import js.html.Element; -#end - #if hl @:keep #end