From c4cd020f66a1239bc6a63d59c5bed9ca3a7cfd93 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Tue, 15 Nov 2016 19:25:37 -0800 Subject: [PATCH] Use GLRenderContext on native, prep for GLES3 API --- lime/_backend/html5/HTML5Renderer.hx | 4 +- lime/_backend/native/NativeApplication.hx | 6 +- lime/_backend/native/NativeGLRenderContext.hx | 1910 +++++++++++++++++ lime/_backend/native/NativeRenderer.hx | 13 +- lime/graphics/GLRenderContext.hx | 1349 +----------- lime/graphics/opengl/GL.hx | 1025 +-------- lime/graphics/opengl/GLES2Context.hx | 1624 ++++++++++++++ lime/graphics/opengl/GLES3Context.hx | 17 + 8 files changed, 3582 insertions(+), 2366 deletions(-) create mode 100644 lime/_backend/native/NativeGLRenderContext.hx create mode 100644 lime/graphics/opengl/GLES2Context.hx create mode 100644 lime/graphics/opengl/GLES3Context.hx diff --git a/lime/_backend/html5/HTML5Renderer.hx b/lime/_backend/html5/HTML5Renderer.hx index b328368f0..fb954e83d 100644 --- a/lime/_backend/html5/HTML5Renderer.hx +++ b/lime/_backend/html5/HTML5Renderer.hx @@ -88,9 +88,9 @@ class HTML5Renderer { webgl = untyped WebGLDebugUtils.makeDebugContext (webgl); #end - GL.context = webgl; + GL.context = cast webgl; #if (js && html5) - parent.context = OPENGL (cast GL.context); + parent.context = OPENGL (GL.context); #else parent.context = OPENGL (new GLRenderContext ()); #end diff --git a/lime/_backend/native/NativeApplication.hx b/lime/_backend/native/NativeApplication.hx index 2bb645e80..1994d81bd 100644 --- a/lime/_backend/native/NativeApplication.hx +++ b/lime/_backend/native/NativeApplication.hx @@ -5,6 +5,7 @@ import haxe.Timer; import lime.app.Application; import lime.app.Config; import lime.audio.AudioManager; +import lime.graphics.opengl.GL; import lime.graphics.ConsoleRenderContext; import lime.graphics.GLRenderContext; import lime.graphics.RenderContext; @@ -28,8 +29,10 @@ import lime.ui.Window; #end @:access(haxe.Timer) +@:access(lime._backend.native.NativeGLRenderContext) @:access(lime._backend.native.NativeRenderer) @:access(lime.app.Application) +@:access(lime.graphics.opengl.GL) @:access(lime.graphics.Renderer) @:access(lime.system.Sensor) @:access(lime.ui.Gamepad) @@ -389,7 +392,8 @@ class NativeApplication { #if lime_console renderer.context = CONSOLE (ConsoleRenderContext.singleton); #else - renderer.context = OPENGL (new GLRenderContext ()); + GL.context = new GLRenderContext (); + renderer.context = OPENGL (GL.context); #end renderer.onContextRestored.dispatch (renderer.context); diff --git a/lime/_backend/native/NativeGLRenderContext.hx b/lime/_backend/native/NativeGLRenderContext.hx new file mode 100644 index 000000000..74d5c8190 --- /dev/null +++ b/lime/_backend/native/NativeGLRenderContext.hx @@ -0,0 +1,1910 @@ +package lime._backend.native; + + +import lime.graphics.opengl.GLActiveInfo; +import lime.graphics.opengl.GLBuffer; +import lime.graphics.opengl.GLContextAttributes; +import lime.graphics.opengl.GLFramebuffer; +import lime.graphics.opengl.GLProgram; +import lime.graphics.opengl.GLRenderbuffer; +import lime.graphics.opengl.GLShader; +import lime.graphics.opengl.GLShaderPrecisionFormat; +import lime.graphics.opengl.GLTexture; +import lime.graphics.opengl.GLUniformLocation; +import lime.utils.ArrayBuffer; +import lime.utils.ArrayBufferView; +import lime.utils.Float32Array; +import lime.utils.Int32Array; +import lime.system.CFFIPointer; +import lime.system.System; + +#if cpp +import cpp.Float32; +#else +typedef Float32 = Float; +#end + +#if !macro +@:build(lime.system.CFFI.build()) +#end + +@:allow(lime.ui.Window) + + +class NativeGLRenderContext { + + + public var DEPTH_BUFFER_BIT = 0x00000100; + public var STENCIL_BUFFER_BIT = 0x00000400; + public var COLOR_BUFFER_BIT = 0x00004000; + + public var POINTS = 0x0000; + public var LINES = 0x0001; + public var LINE_LOOP = 0x0002; + public var LINE_STRIP = 0x0003; + public var TRIANGLES = 0x0004; + public var TRIANGLE_STRIP = 0x0005; + public var TRIANGLE_FAN = 0x0006; + + public var ZERO = 0; + public var ONE = 1; + public var SRC_COLOR = 0x0300; + public var ONE_MINUS_SRC_COLOR = 0x0301; + public var SRC_ALPHA = 0x0302; + public var ONE_MINUS_SRC_ALPHA = 0x0303; + public var DST_ALPHA = 0x0304; + public var ONE_MINUS_DST_ALPHA = 0x0305; + + public var DST_COLOR = 0x0306; + public var ONE_MINUS_DST_COLOR = 0x0307; + public var SRC_ALPHA_SATURATE = 0x0308; + + public var FUNC_ADD = 0x8006; + public var BLEND_EQUATION = 0x8009; + public var BLEND_EQUATION_RGB = 0x8009; + public var BLEND_EQUATION_ALPHA = 0x883D; + + public var FUNC_SUBTRACT = 0x800A; + public var FUNC_REVERSE_SUBTRACT = 0x800B; + + public var BLEND_DST_RGB = 0x80C8; + public var BLEND_SRC_RGB = 0x80C9; + public var BLEND_DST_ALPHA = 0x80CA; + public var BLEND_SRC_ALPHA = 0x80CB; + public var CONSTANT_COLOR = 0x8001; + public var ONE_MINUS_CONSTANT_COLOR = 0x8002; + public var CONSTANT_ALPHA = 0x8003; + public var ONE_MINUS_CONSTANT_ALPHA = 0x8004; + public var BLEND_COLOR = 0x8005; + + public var ARRAY_BUFFER = 0x8892; + public var ELEMENT_ARRAY_BUFFER = 0x8893; + public var ARRAY_BUFFER_BINDING = 0x8894; + public var ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; + + public var STREAM_DRAW = 0x88E0; + public var STATIC_DRAW = 0x88E4; + public var DYNAMIC_DRAW = 0x88E8; + + public var BUFFER_SIZE = 0x8764; + public var BUFFER_USAGE = 0x8765; + + public var CURRENT_VERTEX_ATTRIB = 0x8626; + + public var FRONT = 0x0404; + public var BACK = 0x0405; + public var FRONT_AND_BACK = 0x0408; + + public var CULL_FACE = 0x0B44; + public var BLEND = 0x0BE2; + public var DITHER = 0x0BD0; + public var STENCIL_TEST = 0x0B90; + public var DEPTH_TEST = 0x0B71; + public var SCISSOR_TEST = 0x0C11; + public var POLYGON_OFFSET_FILL = 0x8037; + public var SAMPLE_ALPHA_TO_COVERAGE = 0x809E; + public var SAMPLE_COVERAGE = 0x80A0; + + public var NO_ERROR = 0; + public var INVALID_ENUM = 0x0500; + public var INVALID_VALUE = 0x0501; + public var INVALID_OPERATION = 0x0502; + public var OUT_OF_MEMORY = 0x0505; + + public var CW = 0x0900; + public var CCW = 0x0901; + + public var LINE_WIDTH = 0x0B21; + public var ALIASED_POINT_SIZE_RANGE = 0x846D; + public var ALIASED_LINE_WIDTH_RANGE = 0x846E; + public var CULL_FACE_MODE = 0x0B45; + public var FRONT_FACE = 0x0B46; + public var DEPTH_RANGE = 0x0B70; + public var DEPTH_WRITEMASK = 0x0B72; + public var DEPTH_CLEAR_VALUE = 0x0B73; + public var DEPTH_FUNC = 0x0B74; + public var STENCIL_CLEAR_VALUE = 0x0B91; + public var STENCIL_FUNC = 0x0B92; + public var STENCIL_FAIL = 0x0B94; + public var STENCIL_PASS_DEPTH_FAIL = 0x0B95; + public var STENCIL_PASS_DEPTH_PASS = 0x0B96; + public var STENCIL_REF = 0x0B97; + public var STENCIL_VALUE_MASK = 0x0B93; + public var STENCIL_WRITEMASK = 0x0B98; + public var STENCIL_BACK_FUNC = 0x8800; + public var STENCIL_BACK_FAIL = 0x8801; + public var STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; + public var STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; + public var STENCIL_BACK_REF = 0x8CA3; + public var STENCIL_BACK_VALUE_MASK = 0x8CA4; + public var STENCIL_BACK_WRITEMASK = 0x8CA5; + public var VIEWPORT = 0x0BA2; + public var SCISSOR_BOX = 0x0C10; + + public var COLOR_CLEAR_VALUE = 0x0C22; + public var COLOR_WRITEMASK = 0x0C23; + public var UNPACK_ALIGNMENT = 0x0CF5; + public var PACK_ALIGNMENT = 0x0D05; + public var MAX_TEXTURE_SIZE = 0x0D33; + public var MAX_VIEWPORT_DIMS = 0x0D3A; + public var SUBPIXEL_BITS = 0x0D50; + public var RED_BITS = 0x0D52; + public var GREEN_BITS = 0x0D53; + public var BLUE_BITS = 0x0D54; + public var ALPHA_BITS = 0x0D55; + public var DEPTH_BITS = 0x0D56; + public var STENCIL_BITS = 0x0D57; + public var POLYGON_OFFSET_UNITS = 0x2A00; + + public var POLYGON_OFFSET_FACTOR = 0x8038; + public var TEXTURE_BINDING_2D = 0x8069; + public var SAMPLE_BUFFERS = 0x80A8; + public var SAMPLES = 0x80A9; + public var SAMPLE_COVERAGE_VALUE = 0x80AA; + public var SAMPLE_COVERAGE_INVERT = 0x80AB; + + public var COMPRESSED_TEXTURE_FORMATS = 0x86A3; + + public var DONT_CARE = 0x1100; + public var FASTEST = 0x1101; + public var NICEST = 0x1102; + + public var GENERATE_MIPMAP_HINT = 0x8192; + + public var BYTE = 0x1400; + public var UNSIGNED_BYTE = 0x1401; + public var SHORT = 0x1402; + public var UNSIGNED_SHORT = 0x1403; + public var INT = 0x1404; + public var UNSIGNED_INT = 0x1405; + public var FLOAT = 0x1406; + + public var DEPTH_COMPONENT = 0x1902; + public var ALPHA = 0x1906; + public var RGB = 0x1907; + public var RGBA = 0x1908; + public var BGR_EXT = 0x80E0; + public var BGRA_EXT = 0x80E1; + public var LUMINANCE = 0x1909; + public var LUMINANCE_ALPHA = 0x190A; + + public var UNSIGNED_SHORT_4_4_4_4 = 0x8033; + public var UNSIGNED_SHORT_5_5_5_1 = 0x8034; + public var UNSIGNED_SHORT_5_6_5 = 0x8363; + + public var FRAGMENT_SHADER = 0x8B30; + public var VERTEX_SHADER = 0x8B31; + public var MAX_VERTEX_ATTRIBS = 0x8869; + public var MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; + public var MAX_VARYING_VECTORS = 0x8DFC; + public var MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + public var MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; + public var MAX_TEXTURE_IMAGE_UNITS = 0x8872; + public var MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; + public var SHADER_TYPE = 0x8B4F; + public var DELETE_STATUS = 0x8B80; + public var LINK_STATUS = 0x8B82; + public var VALIDATE_STATUS = 0x8B83; + public var ATTACHED_SHADERS = 0x8B85; + public var ACTIVE_UNIFORMS = 0x8B86; + public var ACTIVE_ATTRIBUTES = 0x8B89; + public var SHADING_LANGUAGE_VERSION = 0x8B8C; + public var CURRENT_PROGRAM = 0x8B8D; + + public var NEVER = 0x0200; + public var LESS = 0x0201; + public var EQUAL = 0x0202; + public var LEQUAL = 0x0203; + public var GREATER = 0x0204; + public var NOTEQUAL = 0x0205; + public var GEQUAL = 0x0206; + public var ALWAYS = 0x0207; + + public var KEEP = 0x1E00; + public var REPLACE = 0x1E01; + public var INCR = 0x1E02; + public var DECR = 0x1E03; + public var INVERT = 0x150A; + public var INCR_WRAP = 0x8507; + public var DECR_WRAP = 0x8508; + + public var VENDOR = 0x1F00; + public var RENDERER = 0x1F01; + public var VERSION = 0x1F02; + + public var NEAREST = 0x2600; + public var LINEAR = 0x2601; + + public var NEAREST_MIPMAP_NEAREST = 0x2700; + public var LINEAR_MIPMAP_NEAREST = 0x2701; + public var NEAREST_MIPMAP_LINEAR = 0x2702; + public var LINEAR_MIPMAP_LINEAR = 0x2703; + + public var TEXTURE_MAG_FILTER = 0x2800; + public var TEXTURE_MIN_FILTER = 0x2801; + public var TEXTURE_WRAP_S = 0x2802; + public var TEXTURE_WRAP_T = 0x2803; + + public var TEXTURE_2D = 0x0DE1; + public var TEXTURE = 0x1702; + + public var TEXTURE_CUBE_MAP = 0x8513; + public var TEXTURE_BINDING_CUBE_MAP = 0x8514; + public var TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; + public var TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; + public var TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; + public var TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; + public var TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; + public var TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + public var MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + + public var TEXTURE0 = 0x84C0; + public var TEXTURE1 = 0x84C1; + public var TEXTURE2 = 0x84C2; + public var TEXTURE3 = 0x84C3; + public var TEXTURE4 = 0x84C4; + public var TEXTURE5 = 0x84C5; + public var TEXTURE6 = 0x84C6; + public var TEXTURE7 = 0x84C7; + public var TEXTURE8 = 0x84C8; + public var TEXTURE9 = 0x84C9; + public var TEXTURE10 = 0x84CA; + public var TEXTURE11 = 0x84CB; + public var TEXTURE12 = 0x84CC; + public var TEXTURE13 = 0x84CD; + public var TEXTURE14 = 0x84CE; + public var TEXTURE15 = 0x84CF; + public var TEXTURE16 = 0x84D0; + public var TEXTURE17 = 0x84D1; + public var TEXTURE18 = 0x84D2; + public var TEXTURE19 = 0x84D3; + public var TEXTURE20 = 0x84D4; + public var TEXTURE21 = 0x84D5; + public var TEXTURE22 = 0x84D6; + public var TEXTURE23 = 0x84D7; + public var TEXTURE24 = 0x84D8; + public var TEXTURE25 = 0x84D9; + public var TEXTURE26 = 0x84DA; + public var TEXTURE27 = 0x84DB; + public var TEXTURE28 = 0x84DC; + public var TEXTURE29 = 0x84DD; + public var TEXTURE30 = 0x84DE; + public var TEXTURE31 = 0x84DF; + public var ACTIVE_TEXTURE = 0x84E0; + + public var REPEAT = 0x2901; + public var CLAMP_TO_EDGE = 0x812F; + public var MIRRORED_REPEAT = 0x8370; + + public var FLOAT_VEC2 = 0x8B50; + public var FLOAT_VEC3 = 0x8B51; + public var FLOAT_VEC4 = 0x8B52; + public var INT_VEC2 = 0x8B53; + public var INT_VEC3 = 0x8B54; + public var INT_VEC4 = 0x8B55; + public var BOOL = 0x8B56; + public var BOOL_VEC2 = 0x8B57; + public var BOOL_VEC3 = 0x8B58; + public var BOOL_VEC4 = 0x8B59; + public var FLOAT_MAT2 = 0x8B5A; + public var FLOAT_MAT3 = 0x8B5B; + public var FLOAT_MAT4 = 0x8B5C; + public var SAMPLER_2D = 0x8B5E; + public var SAMPLER_CUBE = 0x8B60; + + public var VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; + public var VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; + public var VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; + public var VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; + public var VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; + public var VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + public var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + + public var VERTEX_PROGRAM_POINT_SIZE = 0x8642; + public var POINT_SPRITE = 0x8861; + + public var COMPILE_STATUS = 0x8B81; + + public var LOW_FLOAT = 0x8DF0; + public var MEDIUM_FLOAT = 0x8DF1; + public var HIGH_FLOAT = 0x8DF2; + public var LOW_INT = 0x8DF3; + public var MEDIUM_INT = 0x8DF4; + public var HIGH_INT = 0x8DF5; + + public var FRAMEBUFFER = 0x8D40; + public var RENDERBUFFER = 0x8D41; + + public var RGBA4 = 0x8056; + public var RGB5_A1 = 0x8057; + public var RGB565 = 0x8D62; + public var DEPTH_COMPONENT16 = 0x81A5; + public var STENCIL_INDEX = 0x1901; + public var STENCIL_INDEX8 = 0x8D48; + public var DEPTH_STENCIL = 0x84F9; + + public var RENDERBUFFER_WIDTH = 0x8D42; + public var RENDERBUFFER_HEIGHT = 0x8D43; + public var RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; + public var RENDERBUFFER_RED_SIZE = 0x8D50; + public var RENDERBUFFER_GREEN_SIZE = 0x8D51; + public var RENDERBUFFER_BLUE_SIZE = 0x8D52; + public var RENDERBUFFER_ALPHA_SIZE = 0x8D53; + public var RENDERBUFFER_DEPTH_SIZE = 0x8D54; + public var RENDERBUFFER_STENCIL_SIZE = 0x8D55; + + public var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; + public var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; + public var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; + public var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; + + public var COLOR_ATTACHMENT0 = 0x8CE0; + public var DEPTH_ATTACHMENT = 0x8D00; + public var STENCIL_ATTACHMENT = 0x8D20; + public var DEPTH_STENCIL_ATTACHMENT = 0x821A; + + public var NONE = 0; + + public var FRAMEBUFFER_COMPLETE = 0x8CD5; + public var FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; + public var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; + public var FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; + public var FRAMEBUFFER_UNSUPPORTED = 0x8CDD; + + public var FRAMEBUFFER_BINDING = 0x8CA6; + public var RENDERBUFFER_BINDING = 0x8CA7; + public var MAX_RENDERBUFFER_SIZE = 0x84E8; + + public var INVALID_FRAMEBUFFER_OPERATION = 0x0506; + + public var UNPACK_FLIP_Y_WEBGL = 0x9240; + public var UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241; + public var CONTEXT_LOST_WEBGL = 0x9242; + public var UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243; + public var BROWSER_DEFAULT_WEBGL = 0x9244; + + public var version (get, null):Int; + + private var __currentProgram:GLProgram; + + + private function new () { + + + + } + + + public function activeTexture (texture:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_active_texture (texture); + #end + + } + + + public function attachShader (program:GLProgram, shader:GLShader):Void { + + #if (lime_cffi && lime_opengl && !macro) + program.attach (shader); + lime_gl_attach_shader (program.id, shader.id); + #end + + } + + + public function bindAttribLocation (program:GLProgram, index:Int, name:String):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_bind_attrib_location (program.id, index, name); + #end + + } + + + public function bindBuffer (target:Int, buffer:GLBuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_bind_buffer (target, buffer == null ? null : buffer.id); + #end + + } + + + public function bindFramebuffer (target:Int, framebuffer:GLFramebuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_bind_framebuffer (target, framebuffer == null ? null : framebuffer.id); + #end + + } + + + public function bindRenderbuffer (target:Int, renderbuffer:GLRenderbuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_bind_renderbuffer (target, renderbuffer == null ? null : renderbuffer.id); + #end + + } + + + public function bindTexture (target:Int, texture:GLTexture):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_bind_texture (target, texture == null ? null : texture.id); + #end + + } + + + public function blendColor (red:Float, green:Float, blue:Float, alpha:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_blend_color (red, green, blue, alpha); + #end + + } + + + public function blendEquation (mode:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_blend_equation (mode); + #end + + } + + + public function blendEquationSeparate (modeRGB:Int, modeAlpha:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_blend_equation_separate (modeRGB, modeAlpha); + #end + + } + + + public function blendFunc (sfactor:Int, dfactor:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_blend_func (sfactor, dfactor); + #end + + } + + + public function blendFuncSeparate (srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_blend_func_separate (srcRGB, dstRGB, srcAlpha, dstAlpha); + #end + + } + + + public function bufferData (target:Int, data:ArrayBufferView, usage:Int):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_buffer_data (target, data.buffer, data.byteOffset, data.byteLength, usage); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_buffer_data (target, data, data.byteOffset, data.byteLength, usage); + #end + + } + + + public function bufferSubData (target:Int, offset:Int, data:ArrayBufferView):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_buffer_sub_data (target, offset, data.buffer, data.byteOffset, data.byteLength); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_buffer_sub_data (target, offset, data, data.byteOffset, data.byteLength); + #end + + } + + + public function checkFramebufferStatus (target:Int):Int { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_check_framebuffer_status (target); + #else + return 0; + #end + + } + + + public function clear (mask:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_clear (mask); + #end + + } + + + public function clearColor (red:Float, green:Float, blue:Float, alpha:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_clear_color (red, green, blue, alpha); + #end + + } + + + public function clearDepth (depth:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_clear_depth (depth); + #end + + } + + + public function clearStencil (s:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_clear_stencil (s); + #end + + } + + + public function colorMask (red:Bool, green:Bool, blue:Bool, alpha:Bool):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_color_mask (red, green, blue, alpha); + #end + + } + + + public function compileShader (shader:GLShader):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_compile_shader (shader.id); + #end + + } + + + public function compressedTexImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, data:ArrayBufferView):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + var buffer = data == null ? null : data.buffer; + lime_gl_compressed_tex_image_2d (target, level, internalformat, width, height, border, buffer, data == null ? 0 : data.byteOffset); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_compressed_tex_image_2d (target, level, internalformat, width, height, border, data == null ? null : data , data == null ? null : data.byteOffset); + #end + + } + + + public function compressedTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, data:ArrayBufferView):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + var buffer = data == null ? null : data.buffer; + lime_gl_compressed_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, buffer, data == null ? 0 : data.byteOffset); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_compressed_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, data == null ? null : data, data == null ? null : data.byteOffset); + #end + + } + + + public function copyTexImage2D (target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_copy_tex_image_2d (target, level, internalformat, x, y, width, height, border); + #end + + } + + + public function copyTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_copy_tex_sub_image_2d (target, level, xoffset, yoffset, x, y, width, height); + #end + + } + + + public function createBuffer ():GLBuffer { + + #if (lime_cffi && lime_opengl && !macro) + return new GLBuffer (version, lime_gl_create_buffer ()); + #else + return null; + #end + + } + + + public function createFramebuffer ():GLFramebuffer { + + #if (lime_cffi && lime_opengl && !macro) + return new GLFramebuffer (version, lime_gl_create_framebuffer ()); + #else + return null; + #end + + } + + + public function createProgram ():GLProgram { + + #if (lime_cffi && lime_opengl && !macro) + return new GLProgram (version, lime_gl_create_program ()); + #else + return null; + #end + + } + + + public function createRenderbuffer ():GLRenderbuffer { + + #if (lime_cffi && lime_opengl && !macro) + return new GLRenderbuffer (version, lime_gl_create_render_buffer ()); + #else + return null; + #end + + } + + + public function createShader (type:Int):GLShader { + + #if (lime_cffi && lime_opengl && !macro) + return new GLShader (version, lime_gl_create_shader (type)); + #else + return null; + #end + + } + + + public function createTexture ():GLTexture { + + #if (lime_cffi && lime_opengl && !macro) + return new GLTexture (version, lime_gl_create_texture ()); + #else + return null; + #end + + } + + + public function cullFace (mode:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_cull_face (mode); + #end + + } + + + public function deleteBuffer (buffer:GLBuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_delete_buffer (buffer.id); + buffer.invalidate (); + #end + + } + + + public function deleteFramebuffer (framebuffer:GLFramebuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_delete_framebuffer (framebuffer.id); + framebuffer.invalidate (); + #end + + } + + + public function deleteProgram (program:GLProgram):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_delete_program (program.id); + program.invalidate (); + #end + + } + + + public function deleteRenderbuffer (renderbuffer:GLRenderbuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_delete_render_buffer (renderbuffer.id); + renderbuffer.invalidate (); + #end + + } + + + public function deleteShader (shader:GLShader):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_delete_shader (shader.id); + shader.invalidate (); + #end + + } + + + public function deleteTexture (texture:GLTexture):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_delete_texture (texture.id); + texture.invalidate (); + #end + + } + + + public function depthFunc (func:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_depth_func (func); + #end + + } + + + public function depthMask (flag:Bool):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_depth_mask (flag); + #end + + } + + + public function depthRange (zNear:Float, zFar:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_depth_range (zNear, zFar); + #end + + } + + + public function detachShader (program:GLProgram, shader:GLShader):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_detach_shader (program.id, shader.id); + #end + + } + + + public function disable (cap:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_disable (cap); + #end + + } + + + public function disableVertexAttribArray (index:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_disable_vertex_attrib_array (index); + #end + + } + + + public function drawArrays (mode:Int, first:Int, count:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_draw_arrays (mode, first, count); + #end + + } + + + public function drawElements (mode:Int, count:Int, type:Int, offset:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_draw_elements (mode, count, type, offset); + #end + + } + + + public function enable (cap:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_enable (cap); + #end + + } + + + public function enableVertexAttribArray (index:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_enable_vertex_attrib_array (index); + #end + + } + + + public function finish ():Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_finish (); + #end + + } + + + public function flush ():Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_flush (); + #end + + } + + + public function framebufferRenderbuffer (target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:GLRenderbuffer):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_framebuffer_renderbuffer (target, attachment, renderbuffertarget, renderbuffer.id); + #end + + } + + + public function framebufferTexture2D (target:Int, attachment:Int, textarget:Int, texture:GLTexture, level:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_framebuffer_texture2D (target, attachment, textarget, texture.id, level); + #end + + } + + + public function frontFace (mode:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_front_face (mode); + #end + + } + + + public function generateMipmap (target:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_generate_mipmap (target); + #end + + } + + + public function getActiveAttrib (program:GLProgram, index:Int):GLActiveInfo { + + #if (lime_cffi && lime_opengl && !macro) + var result:Dynamic = lime_gl_get_active_attrib (program.id, index); + return result; + #else + return null; + #end + + } + + + public function getActiveUniform (program:GLProgram, index:Int):GLActiveInfo { + + #if (lime_cffi && lime_opengl && !macro) + var result:Dynamic = lime_gl_get_active_uniform (program.id, index); + return result; + #else + return null; + #end + + } + + + public function getAttachedShaders (program:GLProgram):Array { + + #if (lime_cffi && lime_opengl && !macro) + return program.getShaders (); + #else + return null; + #end + + } + + + public function getAttribLocation (program:GLProgram, name:String):Int { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_attrib_location (program.id, name); + #else + return 0; + #end + + } + + + public function getBufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_buffer_parameter (target, pname); + #else + return 0; + #end + + } + + + public function getContextAttributes ():GLContextAttributes { + + #if (lime_cffi && lime_opengl && !macro) + var base:Dynamic = lime_gl_get_context_attributes (); + base.premultipliedAlpha = false; + base.preserveDrawingBuffer = false; + return base; + #else + return null; + #end + + } + + + public function getError ():Int { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_error (); + #else + return 0; + #end + + } + + + public function getExtension (name:String):Dynamic { + + #if (lime_cffi && lime_opengl && !macro) + + // TODO: Return extension objects + + return lime_gl_get_extension (name); + #else + return null; + #end + + } + + + public function getFramebufferAttachmentParameter (target:Int, attachment:Int, pname:Int):Int /*Dynamic*/ { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_framebuffer_attachment_parameter (target, attachment, pname); + #else + return 0; + #end + + } + + + public function getParameter (pname:Int):Dynamic { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_parameter (pname); + #else + return null; + #end + + } + + + public function getProgramInfoLog (program:GLProgram):String { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_program_info_log (program.id); + #else + return null; + #end + + } + + + public function getProgramParameter (program:GLProgram, pname:Int):Int { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_program_parameter (program.id, pname); + #else + return 0; + #end + + } + + + public function getRenderbufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_render_buffer_parameter (target, pname); + #else + return 0; + #end + + } + + + public function getShaderInfoLog (shader:GLShader):String { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_shader_info_log (shader.id); + #else + return null; + #end + + } + + + public function getShaderParameter (shader:GLShader, pname:Int):Int { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_shader_parameter (shader.id, pname); + #else + return 0; + #end + + } + + + public function getShaderPrecisionFormat (shadertype:Int, precisiontype:Int):GLShaderPrecisionFormat { + + #if (lime_cffi && lime_opengl && !macro) + var result:Dynamic = lime_gl_get_shader_precision_format (shadertype, precisiontype); + return result; + #else + return null; + #end + + } + + + public function getShaderSource (shader:GLShader):String { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_shader_source (shader.id); + #else + return null; + #end + + } + + + public function getSupportedExtensions ():Array { + + #if (lime_cffi && lime_opengl && !macro) + var result = new Array (); + lime_gl_get_supported_extensions (result); + return result; + #else + return null; + #end + + } + + + public function getTexParameter (target:Int, pname:Int):Int /*Dynamic*/ { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_tex_parameter (target, pname); + #else + return 0; + #end + + } + + + public function getUniform (program:GLProgram, location:GLUniformLocation):Dynamic { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_uniform (program.id, location); + #else + return null; + #end + + } + + + public function getUniformLocation (program:GLProgram, name:String):GLUniformLocation { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_uniform_location (program.id, name); + #else + return 0; + #end + + } + + + public function getVertexAttrib (index:Int, pname:Int):Int /*Dynamic*/ { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_vertex_attrib (index, pname); + #else + return 0; + #end + + } + + + public function getVertexAttribOffset (index:Int, pname:Int):Int { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_get_vertex_attrib_offset (index, pname); + #else + return 0; + #end + + } + + + public function hint (target:Int, mode:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_hint (target, mode); + #end + + } + + + public function isBuffer (buffer:GLBuffer):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return buffer != null && buffer.id > 0 && lime_gl_is_buffer (buffer.id); + #else + return false; + #end + + } + + + public function isContextLost ():Bool { + + return false; + + } + + + public function isEnabled (cap:Int):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return lime_gl_is_enabled (cap); + #else + return false; + #end + + } + + + public function isFramebuffer (framebuffer:GLFramebuffer):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return framebuffer != null && framebuffer.id > 0 && lime_gl_is_framebuffer (framebuffer.id); + #else + return false; + #end + + } + + + public function isProgram (program:GLProgram):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return program != null && program.id > 0 && lime_gl_is_program (program.id); + #else + return false; + #end + + } + + + public function isRenderbuffer (renderbuffer:GLRenderbuffer):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return renderbuffer != null && renderbuffer.id > 0 && lime_gl_is_renderbuffer (renderbuffer.id); + #else + return false; + #end + + } + + + public function isShader (shader:GLShader):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return shader != null && shader.id > 0 && lime_gl_is_shader (shader.id); + #else + return false; + #end + + } + + + public function isTexture (texture:GLTexture):Bool { + + #if (lime_cffi && lime_opengl && !macro) + return texture != null && texture.id > 0 && lime_gl_is_texture (texture.id); + #else + return false; + #end + + } + + + public function lineWidth (width:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_line_width (width); + #end + + } + + + public function linkProgram (program:GLProgram):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_link_program (program.id); + #end + + } + + + public function pixelStorei (pname:Int, param:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_pixel_storei (pname, param); + #end + + } + + + public function polygonOffset (factor:Float, units:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_polygon_offset (factor, units); + #end + + } + + + public function readPixels (x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + var buffer = pixels == null ? null : pixels.buffer; + lime_gl_read_pixels (x, y, width, height, format, type, buffer, pixels == null ? 0 : pixels.byteOffset); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_read_pixels (x, y, width, height, format, type, pixels == null ? null : pixels, pixels == null ? null : pixels.byteOffset); + #end + + } + + + public function renderbufferStorage (target:Int, internalformat:Int, width:Int, height:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_renderbuffer_storage (target, internalformat, width, height); + #end + + } + + + public function sampleCoverage (value:Float, invert:Bool):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_sample_coverage (value, invert); + #end + + } + + + public function scissor (x:Int, y:Int, width:Int, height:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_scissor (x, y, width, height); + #end + + } + + + public function shaderSource (shader:GLShader, source:String):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_shader_source (shader.id, source); + #end + + } + + + public function stencilFunc (func:Int, ref:Int, mask:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_stencil_func (func, ref, mask); + #end + + } + + + public function stencilFuncSeparate (face:Int, func:Int, ref:Int, mask:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_stencil_func_separate (face, func, ref, mask); + #end + + } + + + public function stencilMask (mask:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_stencil_mask (mask); + #end + + } + + + public function stencilMaskSeparate (face:Int, mask:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_stencil_mask_separate (face, mask); + #end + + } + + + public function stencilOp (fail:Int, zfail:Int, zpass:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_stencil_op (fail, zfail, zpass); + #end + + } + + + public function stencilOpSeparate (face:Int, fail:Int, zfail:Int, zpass:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_stencil_op_separate (face, fail, zfail, zpass); + #end + + } + + + public function texImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + var buffer = pixels == null ? null : pixels.buffer; + lime_gl_tex_image_2d (target, level, internalformat, width, height, border, format, type, buffer, pixels == null ? 0 : pixels.byteOffset); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_tex_image_2d (target, level, internalformat, width, height, border, format, type, pixels == null ? null : pixels, pixels == null ? null : pixels.byteOffset); + #end + + } + + + public function texParameterf (target:Int, pname:Int, param:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_tex_parameterf (target, pname, param); + #end + + } + + + public function texParameteri (target:Int, pname:Int, param:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_tex_parameteri (target, pname, param); + #end + + } + + + public function texSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + var buffer = pixels == null ? null : pixels.buffer; + lime_gl_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, type, buffer, pixels == null ? 0 : pixels.byteOffset); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, type, pixels == null ? null : pixels, pixels == null ? null : pixels.byteOffset); + #end + + } + + + public function uniform1f (location:GLUniformLocation, x:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform1f (location, x); + #end + + } + + + public function uniform1fv (location:GLUniformLocation, x:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform1fv (location, x.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform1fv (location, x); + #end + + } + + + public function uniform1i (location:GLUniformLocation, x:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform1i (location, x); + #end + + } + + + public function uniform1iv (location:GLUniformLocation, v:Int32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform1iv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform1iv (location, v); + #end + + } + + + public function uniform2f (location:GLUniformLocation, x:Float, y:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform2f (location, x, y); + #end + + } + + + public function uniform2fv (location:GLUniformLocation, v:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform2fv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform2fv (location, v); + #end + + } + + + public function uniform2i (location:GLUniformLocation, x:Int, y:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform2i (location, x, y); + #end + + } + + + public function uniform2iv (location:GLUniformLocation, v:Int32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform2iv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform2iv (location, v); + #end + + } + + + public function uniform3f (location:GLUniformLocation, x:Float, y:Float, z:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform3f (location, x, y, z); + #end + + } + + + public function uniform3fv (location:GLUniformLocation, v:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform3fv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform3fv (location, v); + #end + + } + + + public function uniform3i (location:GLUniformLocation, x:Int, y:Int, z:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform3i (location, x, y, z); + #end + + } + + + public function uniform3iv (location:GLUniformLocation, v:Int32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform3iv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform3iv (location, v); + #end + + } + + + public function uniform4f (location:GLUniformLocation, x:Float, y:Float, z:Float, w:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform4f (location, x, y, z, w); + #end + + } + + + public function uniform4fv (location:GLUniformLocation, v:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform4fv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform4fv (location, v); + #end + + } + + + public function uniform4i (location:GLUniformLocation, x:Int, y:Int, z:Int, w:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_uniform4i (location, x, y, z, w); + #end + + } + + + public function uniform4iv (location:GLUniformLocation, v:Int32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform4iv (location, v.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform4iv (location, v); + #end + + } + + + public function uniformMatrix2fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform_matrix (location, transpose, v.buffer, 2); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform_matrix (location, transpose, v, 2); + #end + + } + + + public function uniformMatrix3fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform_matrix (location, transpose, v.buffer, 3); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform_matrix (location, transpose, v, 3); + #end + + } + + + public function uniformMatrix4fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_uniform_matrix (location, transpose, v.buffer, 4); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_uniform_matrix (location, transpose, v, 4); + #end + + } + + + /*public function uniformMatrix3D(location:GLUniformLocation, transpose:Bool, matrix:Matrix3D):Void { + + lime_gl_uniform_matrix(location, transpose, Float32Array.fromMatrix(matrix).getByteBuffer() , 4); + + }*/ + + + public function useProgram (program:GLProgram):Void { + + __currentProgram = program; + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_use_program (program == null ? null : program.id); + #end + + } + + + public function validateProgram (program:GLProgram):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_validate_program (program.id); + #end + + } + + + public function vertexAttrib1f (indx:Int, x:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_vertex_attrib1f (indx, x); + #end + + } + + + public function vertexAttrib1fv (indx:Int, values:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib1fv (indx, values.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib1fv (indx, values); + #end + + } + + + public function vertexAttrib2f (indx:Int, x:Float, y:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_vertex_attrib2f (indx, x, y); + #end + + } + + + public function vertexAttrib2fv (indx:Int, values:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib2fv (indx, values.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib2fv (indx, values); + #end + + } + + + public function vertexAttrib3f (indx:Int, x:Float, y:Float, z:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_vertex_attrib3f (indx, x, y, z); + #end + + } + + + public function vertexAttrib3fv (indx:Int, values:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib3fv (indx, values.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib3fv (indx, values); + #end + + } + + + public function vertexAttrib4f (indx:Int, x:Float, y:Float, z:Float, w:Float):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_vertex_attrib4f (indx, x, y, z, w); + #end + + } + + + public function vertexAttrib4fv (indx:Int, values:Float32Array):Void { + + #if (lime_cffi && !nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib4fv (indx, values.buffer); + #elseif (nodejs && lime_opengl && !macro) + lime_gl_vertex_attrib4fv (indx, values); + #end + + } + + + public function vertexAttribPointer (indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_vertex_attrib_pointer (indx, size, type, normalized, stride, offset); + #end + + } + + + public function viewport (x:Int, y:Int, width:Int, height:Int):Void { + + #if (lime_cffi && lime_opengl && !macro) + lime_gl_viewport (x, y, width, height); + #end + + } + + + private function get_version ():Int { return 2; } + + + #if (lime_cffi && lime_opengl && !macro) + @:cffi private static function lime_gl_active_texture (texture:Int):Void; + @:cffi private static function lime_gl_attach_shader (program:CFFIPointer, shader:CFFIPointer):Void; + @:cffi private static function lime_gl_bind_attrib_location (program:CFFIPointer, index:Int, name:String):Void; + @:cffi private static function lime_gl_bind_buffer (target:Int, buffer:CFFIPointer):Void; + @:cffi private static function lime_gl_bind_framebuffer (target:Int, framebuffer:CFFIPointer):Void; + @:cffi private static function lime_gl_bind_renderbuffer (target:Int, renderbuffer:CFFIPointer):Void; + @:cffi private static function lime_gl_bind_texture (target:Int, texture:CFFIPointer):Void; + @:cffi private static function lime_gl_blend_color (red:Float32, green:Float32, blue:Float32, alpha:Float32):Void; + @:cffi private static function lime_gl_blend_equation (mode:Int):Void; + @:cffi private static function lime_gl_blend_equation_separate (modeRGB:Int, modeAlpha:Int):Void; + @:cffi private static function lime_gl_blend_func (sfactor:Int, dfactor:Int):Void; + @:cffi private static function lime_gl_blend_func_separate (srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void; + @:cffi private static function lime_gl_buffer_data (target:Int, buffer:Dynamic, byteOffset:Int, size:Int, usage:Int):Void; + @:cffi private static function lime_gl_buffer_sub_data (target:Int, offset:Int, buffer:Dynamic, byteOffset:Int, size:Int):Void; + @:cffi private static function lime_gl_check_framebuffer_status (target:Int):Int; + @:cffi private static function lime_gl_clear (mask:Int):Void; + @:cffi private static function lime_gl_clear_color (red:Float32, green:Float32, blue:Float32, alpha:Float32):Void; + @:cffi private static function lime_gl_clear_depth (depth:Float32):Void; + @:cffi private static function lime_gl_clear_stencil (s:Int):Void; + @:cffi private static function lime_gl_color_mask (red:Bool, green:Bool, blue:Bool, alpha:Bool):Void; + @:cffi private static function lime_gl_compile_shader (shader:CFFIPointer):Void; + @:cffi private static function lime_gl_compressed_tex_image_2d (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, buffer:Dynamic, byteOffset:Int):Void; + @:cffi private static function lime_gl_compressed_tex_sub_image_2d (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, buffer:Dynamic, byteOffset:Int):Void; + @:cffi private static function lime_gl_copy_tex_image_2d (target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void; + @:cffi private static function lime_gl_copy_tex_sub_image_2d (target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void; + @:cffi private static function lime_gl_create_buffer ():CFFIPointer; + @:cffi private static function lime_gl_create_framebuffer ():CFFIPointer; + @:cffi private static function lime_gl_create_program ():CFFIPointer; + @:cffi private static function lime_gl_create_render_buffer ():CFFIPointer; + @:cffi private static function lime_gl_create_shader (type:Int):CFFIPointer; + @:cffi private static function lime_gl_create_texture ():CFFIPointer; + @:cffi private static function lime_gl_cull_face (mode:Int):Void; + @:cffi private static function lime_gl_delete_buffer (buffer:CFFIPointer):Void; + @:cffi private static function lime_gl_delete_framebuffer (framebuffer:CFFIPointer):Void; + @:cffi private static function lime_gl_delete_program (program:CFFIPointer):Void; + @:cffi private static function lime_gl_delete_render_buffer (renderbuffer:CFFIPointer):Void; + @:cffi private static function lime_gl_delete_shader (shader:CFFIPointer):Void; + @:cffi private static function lime_gl_delete_texture (texture:CFFIPointer):Void; + @:cffi private static function lime_gl_depth_func (func:Int):Void; + @:cffi private static function lime_gl_depth_mask (flag:Bool):Void; + @:cffi private static function lime_gl_depth_range (zNear:Float32, zFar:Float32):Void; + @:cffi private static function lime_gl_detach_shader (program:CFFIPointer, shader:CFFIPointer):Void; + @:cffi private static function lime_gl_disable (cap:Int):Void; + @:cffi private static function lime_gl_disable_vertex_attrib_array (index:Int):Void; + @:cffi private static function lime_gl_draw_arrays (mode:Int, first:Int, count:Int):Void; + @:cffi private static function lime_gl_draw_elements (mode:Int, count:Int, type:Int, offset:Int):Void; + @:cffi private static function lime_gl_enable (cap:Int):Void; + @:cffi private static function lime_gl_enable_vertex_attrib_array (index:Int):Void; + @:cffi private static function lime_gl_finish ():Void; + @:cffi private static function lime_gl_flush ():Void; + @:cffi private static function lime_gl_framebuffer_renderbuffer (target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:CFFIPointer):Void; + @:cffi private static function lime_gl_framebuffer_texture2D (target:Int, attachment:Int, textarget:Int, texture:CFFIPointer, level:Int):Void; + @:cffi private static function lime_gl_front_face (mode:Int):Void; + @:cffi private static function lime_gl_generate_mipmap (target:Int):Void; + @:cffi private static function lime_gl_get_active_attrib (program:CFFIPointer, index:Int):Dynamic; + @:cffi private static function lime_gl_get_active_uniform (program:CFFIPointer, index:Int):Dynamic; + @:cffi private static function lime_gl_get_attrib_location (program:CFFIPointer, name:String):Int; + @:cffi private static function lime_gl_get_buffer_parameter (target:Int, pname:Int):Int; + @:cffi private static function lime_gl_get_context_attributes ():Dynamic; + @:cffi private static function lime_gl_get_error ():Int; + @:cffi private static function lime_gl_get_extension (name:String):Dynamic; + @:cffi private static function lime_gl_get_framebuffer_attachment_parameter (target:Int, attachment:Int, pname:Int):Int; + @:cffi private static function lime_gl_get_parameter (pname:Int):Dynamic; + @:cffi private static function lime_gl_get_program_info_log (program:CFFIPointer):String; + @:cffi private static function lime_gl_get_program_parameter (program:CFFIPointer, pname:Int):Int; + @:cffi private static function lime_gl_get_render_buffer_parameter (target:Int, pname:Int):Int; + @:cffi private static function lime_gl_get_shader_info_log (shader:CFFIPointer):String; + @:cffi private static function lime_gl_get_shader_parameter (shader:CFFIPointer, pname:Int):Int; + @:cffi private static function lime_gl_get_shader_precision_format (shadertype:Int, precisiontype:Int):Dynamic; + @:cffi private static function lime_gl_get_shader_source (shader:CFFIPointer):Dynamic; + @:cffi private static function lime_gl_get_supported_extensions (result:Dynamic):Void; + @:cffi private static function lime_gl_get_tex_parameter (target:Int, pname:Int):Int; + @:cffi private static function lime_gl_get_uniform (program:CFFIPointer, location:Int):Dynamic; + @:cffi private static function lime_gl_get_uniform_location (program:CFFIPointer, name:String):Int; + @:cffi private static function lime_gl_get_vertex_attrib (index:Int, pname:Int):Int; + @:cffi private static function lime_gl_get_vertex_attrib_offset (index:Int, pname:Int):Int; + @:cffi private static function lime_gl_hint (target:Int, mode:Int):Void; + @:cffi private static function lime_gl_is_buffer (buffer:CFFIPointer):Bool; + @:cffi private static function lime_gl_is_enabled (cap:Int):Bool; + @:cffi private static function lime_gl_is_framebuffer (framebuffer:CFFIPointer):Bool; + @:cffi private static function lime_gl_is_program (program:CFFIPointer):Bool; + @:cffi private static function lime_gl_is_renderbuffer (renderbuffer:CFFIPointer):Bool; + @:cffi private static function lime_gl_is_shader (shader:CFFIPointer):Bool; + @:cffi private static function lime_gl_is_texture (texture:CFFIPointer):Bool; + @:cffi private static function lime_gl_line_width (width:Float32):Void; + @:cffi private static function lime_gl_link_program (program:CFFIPointer):Void; + @:cffi private static function lime_gl_pixel_storei (pname:Int, param:Int):Void; + @:cffi private static function lime_gl_polygon_offset (factor:Float32, units:Float32):Void; + @:cffi private static function lime_gl_read_pixels (x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, buffer:Dynamic, byteOffset:Int):Void; + @:cffi private static function lime_gl_renderbuffer_storage (target:Int, internalformat:Int, width:Int, height:Int):Void; + @:cffi private static function lime_gl_sample_coverage (value:Float32, invert:Bool):Void; + @:cffi private static function lime_gl_scissor (x:Int, y:Int, width:Int, height:Int):Void; + @:cffi private static function lime_gl_shader_source (shader:CFFIPointer, source:String):Void; + @:cffi private static function lime_gl_stencil_func (func:Int, ref:Int, mask:Int):Void; + @:cffi private static function lime_gl_stencil_func_separate (face:Int, func:Int, ref:Int, mask:Int):Void; + @:cffi private static function lime_gl_stencil_mask (mask:Int):Void; + @:cffi private static function lime_gl_stencil_mask_separate (face:Int, mask:Int):Void; + @:cffi private static function lime_gl_stencil_op (fail:Int, zfail:Int, zpass:Int):Void; + @:cffi private static function lime_gl_stencil_op_separate (face:Int, fail:Int, zfail:Int, zpass:Int):Void; + @:cffi private static function lime_gl_tex_image_2d (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, buffer:Dynamic, byteOffset:Int):Void; + @:cffi private static function lime_gl_tex_parameterf (target:Int, pname:Int, param:Float32):Void; + @:cffi private static function lime_gl_tex_parameteri (target:Int, pname:Int, param:Int):Void; + @:cffi private static function lime_gl_tex_sub_image_2d (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, buffer:Dynamic, byteOffset:Int):Void; + @:cffi private static function lime_gl_uniform1f (location:Int, x:Float32):Void; + @:cffi private static function lime_gl_uniform1fv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform1i (location:Int, x:Int):Void; + @:cffi private static function lime_gl_uniform1iv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform2f (location:Int, x:Float32, y:Float32):Void; + @:cffi private static function lime_gl_uniform2fv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform2i (location:Int, x:Int, y:Int):Void; + @:cffi private static function lime_gl_uniform2iv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform3f (location:Int, x:Float32, y:Float32, z:Float32):Void; + @:cffi private static function lime_gl_uniform3fv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform3i (location:Int, x:Int, y:Int, z:Int):Void; + @:cffi private static function lime_gl_uniform3iv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform4f (location:Int, x:Float32, y:Float32, z:Float32, w:Float32):Void; + @:cffi private static function lime_gl_uniform4fv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform4i (location:Int, x:Int, y:Int, z:Int, w:Int):Void; + @:cffi private static function lime_gl_uniform4iv (location:Int, v:Dynamic):Void; + @:cffi private static function lime_gl_uniform_matrix (location:Int, transpose:Bool, buffer:Dynamic, count:Int):Void; + @:cffi private static function lime_gl_use_program (program:CFFIPointer):Void; + @:cffi private static function lime_gl_validate_program (program:CFFIPointer):Void; + @:cffi private static function lime_gl_version ():String; + @:cffi private static function lime_gl_vertex_attrib1f (indx:Int, x:Float32):Void; + @:cffi private static function lime_gl_vertex_attrib1fv (indx:Int, values:Dynamic):Void; + @:cffi private static function lime_gl_vertex_attrib2f (indx:Int, x:Float32, y:Float32):Void; + @:cffi private static function lime_gl_vertex_attrib2fv (indx:Int, values:Dynamic):Void; + @:cffi private static function lime_gl_vertex_attrib3f (indx:Int, x:Float32, y:Float32, z:Float32):Void; + @:cffi private static function lime_gl_vertex_attrib3fv (indx:Int, values:Dynamic):Void; + @:cffi private static function lime_gl_vertex_attrib4f (indx:Int, x:Float32, y:Float32, z:Float32, w:Float32):Void; + @:cffi private static function lime_gl_vertex_attrib4fv (indx:Int, values:Dynamic):Void; + @:cffi private static function lime_gl_vertex_attrib_pointer (indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int):Void; + @:cffi private static function lime_gl_viewport (x:Int, y:Int, width:Int, height:Int):Void; + #end + + +} \ No newline at end of file diff --git a/lime/_backend/native/NativeRenderer.hx b/lime/_backend/native/NativeRenderer.hx index dff9be2ca..985f77353 100644 --- a/lime/_backend/native/NativeRenderer.hx +++ b/lime/_backend/native/NativeRenderer.hx @@ -12,6 +12,7 @@ import lime.graphics.GLRenderContext; import lime.graphics.Image; import lime.graphics.ImageBuffer; import lime.graphics.Renderer; +import lime.graphics.opengl.GL; import lime.math.Rectangle; import lime.utils.UInt8Array; @@ -19,7 +20,9 @@ import lime.utils.UInt8Array; @:build(lime.system.CFFI.build()) #end +@:access(lime._backend.native.NativeGLRenderContext) @:access(lime.graphics.cairo.Cairo) +@:access(lime.graphics.opengl.GL) @:access(lime.ui.Window) @@ -66,9 +69,17 @@ class NativeRenderer { case "opengl": + var context = new GLRenderContext (); + useHardware = true; - parent.context = OPENGL (new GLRenderContext ()); + parent.context = OPENGL (context); parent.type = OPENGL; + + if (GL.context == null) { + + GL.context = context; + + } default: diff --git a/lime/graphics/GLRenderContext.hx b/lime/graphics/GLRenderContext.hx index 9dcc47c42..a5041fecb 100644 --- a/lime/graphics/GLRenderContext.hx +++ b/lime/graphics/GLRenderContext.hx @@ -1,1344 +1,11 @@ -package lime.graphics; #if (!js || !html5) - - -import lime.graphics.opengl.*; -import lime.utils.ArrayBuffer; -import lime.utils.ArrayBufferView; -import lime.utils.Float32Array; -import lime.utils.Int32Array; - - -class GLRenderContext { - - - public var DEPTH_BUFFER_BIT = 0x00000100; - public var STENCIL_BUFFER_BIT = 0x00000400; - public var COLOR_BUFFER_BIT = 0x00004000; - - public var POINTS = 0x0000; - public var LINES = 0x0001; - public var LINE_LOOP = 0x0002; - public var LINE_STRIP = 0x0003; - public var TRIANGLES = 0x0004; - public var TRIANGLE_STRIP = 0x0005; - public var TRIANGLE_FAN = 0x0006; - - public var ZERO = 0; - public var ONE = 1; - public var SRC_COLOR = 0x0300; - public var ONE_MINUS_SRC_COLOR = 0x0301; - public var SRC_ALPHA = 0x0302; - public var ONE_MINUS_SRC_ALPHA = 0x0303; - public var DST_ALPHA = 0x0304; - public var ONE_MINUS_DST_ALPHA = 0x0305; - - public var DST_COLOR = 0x0306; - public var ONE_MINUS_DST_COLOR = 0x0307; - public var SRC_ALPHA_SATURATE = 0x0308; - - public var FUNC_ADD = 0x8006; - public var BLEND_EQUATION = 0x8009; - public var BLEND_EQUATION_RGB = 0x8009; - public var BLEND_EQUATION_ALPHA = 0x883D; - - public var FUNC_SUBTRACT = 0x800A; - public var FUNC_REVERSE_SUBTRACT = 0x800B; - - public var BLEND_DST_RGB = 0x80C8; - public var BLEND_SRC_RGB = 0x80C9; - public var BLEND_DST_ALPHA = 0x80CA; - public var BLEND_SRC_ALPHA = 0x80CB; - public var CONSTANT_COLOR = 0x8001; - public var ONE_MINUS_CONSTANT_COLOR = 0x8002; - public var CONSTANT_ALPHA = 0x8003; - public var ONE_MINUS_CONSTANT_ALPHA = 0x8004; - public var BLEND_COLOR = 0x8005; - - public var ARRAY_BUFFER = 0x8892; - public var ELEMENT_ARRAY_BUFFER = 0x8893; - public var ARRAY_BUFFER_BINDING = 0x8894; - public var ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; - - public var STREAM_DRAW = 0x88E0; - public var STATIC_DRAW = 0x88E4; - public var DYNAMIC_DRAW = 0x88E8; - - public var BUFFER_SIZE = 0x8764; - public var BUFFER_USAGE = 0x8765; - - public var CURRENT_VERTEX_ATTRIB = 0x8626; - - public var FRONT = 0x0404; - public var BACK = 0x0405; - public var FRONT_AND_BACK = 0x0408; - - public var CULL_FACE = 0x0B44; - public var BLEND = 0x0BE2; - public var DITHER = 0x0BD0; - public var STENCIL_TEST = 0x0B90; - public var DEPTH_TEST = 0x0B71; - public var SCISSOR_TEST = 0x0C11; - public var POLYGON_OFFSET_FILL = 0x8037; - public var SAMPLE_ALPHA_TO_COVERAGE = 0x809E; - public var SAMPLE_COVERAGE = 0x80A0; - - public var NO_ERROR = 0; - public var INVALID_ENUM = 0x0500; - public var INVALID_VALUE = 0x0501; - public var INVALID_OPERATION = 0x0502; - public var OUT_OF_MEMORY = 0x0505; - - public var CW = 0x0900; - public var CCW = 0x0901; - - public var LINE_WIDTH = 0x0B21; - public var ALIASED_POINT_SIZE_RANGE = 0x846D; - public var ALIASED_LINE_WIDTH_RANGE = 0x846E; - public var CULL_FACE_MODE = 0x0B45; - public var FRONT_FACE = 0x0B46; - public var DEPTH_RANGE = 0x0B70; - public var DEPTH_WRITEMASK = 0x0B72; - public var DEPTH_CLEAR_VALUE = 0x0B73; - public var DEPTH_FUNC = 0x0B74; - public var STENCIL_CLEAR_VALUE = 0x0B91; - public var STENCIL_FUNC = 0x0B92; - public var STENCIL_FAIL = 0x0B94; - public var STENCIL_PASS_DEPTH_FAIL = 0x0B95; - public var STENCIL_PASS_DEPTH_PASS = 0x0B96; - public var STENCIL_REF = 0x0B97; - public var STENCIL_VALUE_MASK = 0x0B93; - public var STENCIL_WRITEMASK = 0x0B98; - public var STENCIL_BACK_FUNC = 0x8800; - public var STENCIL_BACK_FAIL = 0x8801; - public var STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - public var STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public var STENCIL_BACK_REF = 0x8CA3; - public var STENCIL_BACK_VALUE_MASK = 0x8CA4; - public var STENCIL_BACK_WRITEMASK = 0x8CA5; - public var VIEWPORT = 0x0BA2; - public var SCISSOR_BOX = 0x0C10; - - public var COLOR_CLEAR_VALUE = 0x0C22; - public var COLOR_WRITEMASK = 0x0C23; - public var UNPACK_ALIGNMENT = 0x0CF5; - public var PACK_ALIGNMENT = 0x0D05; - public var MAX_TEXTURE_SIZE = 0x0D33; - public var MAX_VIEWPORT_DIMS = 0x0D3A; - public var SUBPIXEL_BITS = 0x0D50; - public var RED_BITS = 0x0D52; - public var GREEN_BITS = 0x0D53; - public var BLUE_BITS = 0x0D54; - public var ALPHA_BITS = 0x0D55; - public var DEPTH_BITS = 0x0D56; - public var STENCIL_BITS = 0x0D57; - public var POLYGON_OFFSET_UNITS = 0x2A00; - - public var POLYGON_OFFSET_FACTOR = 0x8038; - public var TEXTURE_BINDING_2D = 0x8069; - public var SAMPLE_BUFFERS = 0x80A8; - public var SAMPLES = 0x80A9; - public var SAMPLE_COVERAGE_VALUE = 0x80AA; - public var SAMPLE_COVERAGE_INVERT = 0x80AB; - - public var COMPRESSED_TEXTURE_FORMATS = 0x86A3; - - public var DONT_CARE = 0x1100; - public var FASTEST = 0x1101; - public var NICEST = 0x1102; - - public var GENERATE_MIPMAP_HINT = 0x8192; - - public var BYTE = 0x1400; - public var UNSIGNED_BYTE = 0x1401; - public var SHORT = 0x1402; - public var UNSIGNED_SHORT = 0x1403; - public var INT = 0x1404; - public var UNSIGNED_INT = 0x1405; - public var FLOAT = 0x1406; - - public var DEPTH_COMPONENT = 0x1902; - public var ALPHA = 0x1906; - public var RGB = 0x1907; - public var RGBA = 0x1908; - public var BGR_EXT = 0x80E0; - public var BGRA_EXT = 0x80E1; - public var LUMINANCE = 0x1909; - public var LUMINANCE_ALPHA = 0x190A; - - public var UNSIGNED_SHORT_4_4_4_4 = 0x8033; - public var UNSIGNED_SHORT_5_5_5_1 = 0x8034; - public var UNSIGNED_SHORT_5_6_5 = 0x8363; - - public var FRAGMENT_SHADER = 0x8B30; - public var VERTEX_SHADER = 0x8B31; - public var MAX_VERTEX_ATTRIBS = 0x8869; - public var MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - public var MAX_VARYING_VECTORS = 0x8DFC; - public var MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - public var MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - public var MAX_TEXTURE_IMAGE_UNITS = 0x8872; - public var MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - public var SHADER_TYPE = 0x8B4F; - public var DELETE_STATUS = 0x8B80; - public var LINK_STATUS = 0x8B82; - public var VALIDATE_STATUS = 0x8B83; - public var ATTACHED_SHADERS = 0x8B85; - public var ACTIVE_UNIFORMS = 0x8B86; - public var ACTIVE_ATTRIBUTES = 0x8B89; - public var SHADING_LANGUAGE_VERSION = 0x8B8C; - public var CURRENT_PROGRAM = 0x8B8D; - - public var NEVER = 0x0200; - public var LESS = 0x0201; - public var EQUAL = 0x0202; - public var LEQUAL = 0x0203; - public var GREATER = 0x0204; - public var NOTEQUAL = 0x0205; - public var GEQUAL = 0x0206; - public var ALWAYS = 0x0207; - - public var KEEP = 0x1E00; - public var REPLACE = 0x1E01; - public var INCR = 0x1E02; - public var DECR = 0x1E03; - public var INVERT = 0x150A; - public var INCR_WRAP = 0x8507; - public var DECR_WRAP = 0x8508; - - public var VENDOR = 0x1F00; - public var RENDERER = 0x1F01; - public var VERSION = 0x1F02; - - public var NEAREST = 0x2600; - public var LINEAR = 0x2601; - - public var NEAREST_MIPMAP_NEAREST = 0x2700; - public var LINEAR_MIPMAP_NEAREST = 0x2701; - public var NEAREST_MIPMAP_LINEAR = 0x2702; - public var LINEAR_MIPMAP_LINEAR = 0x2703; - - public var TEXTURE_MAG_FILTER = 0x2800; - public var TEXTURE_MIN_FILTER = 0x2801; - public var TEXTURE_WRAP_S = 0x2802; - public var TEXTURE_WRAP_T = 0x2803; - - public var TEXTURE_2D = 0x0DE1; - public var TEXTURE = 0x1702; - - public var TEXTURE_CUBE_MAP = 0x8513; - public var TEXTURE_BINDING_CUBE_MAP = 0x8514; - public var TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; - public var TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; - public var TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; - public var TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; - public var TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; - public var TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; - public var MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; - - public var TEXTURE0 = 0x84C0; - public var TEXTURE1 = 0x84C1; - public var TEXTURE2 = 0x84C2; - public var TEXTURE3 = 0x84C3; - public var TEXTURE4 = 0x84C4; - public var TEXTURE5 = 0x84C5; - public var TEXTURE6 = 0x84C6; - public var TEXTURE7 = 0x84C7; - public var TEXTURE8 = 0x84C8; - public var TEXTURE9 = 0x84C9; - public var TEXTURE10 = 0x84CA; - public var TEXTURE11 = 0x84CB; - public var TEXTURE12 = 0x84CC; - public var TEXTURE13 = 0x84CD; - public var TEXTURE14 = 0x84CE; - public var TEXTURE15 = 0x84CF; - public var TEXTURE16 = 0x84D0; - public var TEXTURE17 = 0x84D1; - public var TEXTURE18 = 0x84D2; - public var TEXTURE19 = 0x84D3; - public var TEXTURE20 = 0x84D4; - public var TEXTURE21 = 0x84D5; - public var TEXTURE22 = 0x84D6; - public var TEXTURE23 = 0x84D7; - public var TEXTURE24 = 0x84D8; - public var TEXTURE25 = 0x84D9; - public var TEXTURE26 = 0x84DA; - public var TEXTURE27 = 0x84DB; - public var TEXTURE28 = 0x84DC; - public var TEXTURE29 = 0x84DD; - public var TEXTURE30 = 0x84DE; - public var TEXTURE31 = 0x84DF; - public var ACTIVE_TEXTURE = 0x84E0; - - public var REPEAT = 0x2901; - public var CLAMP_TO_EDGE = 0x812F; - public var MIRRORED_REPEAT = 0x8370; - - public var FLOAT_VEC2 = 0x8B50; - public var FLOAT_VEC3 = 0x8B51; - public var FLOAT_VEC4 = 0x8B52; - public var INT_VEC2 = 0x8B53; - public var INT_VEC3 = 0x8B54; - public var INT_VEC4 = 0x8B55; - public var BOOL = 0x8B56; - public var BOOL_VEC2 = 0x8B57; - public var BOOL_VEC3 = 0x8B58; - public var BOOL_VEC4 = 0x8B59; - public var FLOAT_MAT2 = 0x8B5A; - public var FLOAT_MAT3 = 0x8B5B; - public var FLOAT_MAT4 = 0x8B5C; - public var SAMPLER_2D = 0x8B5E; - public var SAMPLER_CUBE = 0x8B60; - - public var VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - public var VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - public var VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - public var VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - public var VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - public var VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - public var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - - public var VERTEX_PROGRAM_POINT_SIZE = 0x8642; - public var POINT_SPRITE = 0x8861; - - public var COMPILE_STATUS = 0x8B81; - - public var LOW_FLOAT = 0x8DF0; - public var MEDIUM_FLOAT = 0x8DF1; - public var HIGH_FLOAT = 0x8DF2; - public var LOW_INT = 0x8DF3; - public var MEDIUM_INT = 0x8DF4; - public var HIGH_INT = 0x8DF5; - - public var FRAMEBUFFER = 0x8D40; - public var RENDERBUFFER = 0x8D41; - - public var RGBA4 = 0x8056; - public var RGB5_A1 = 0x8057; - public var RGB565 = 0x8D62; - public var DEPTH_COMPONENT16 = 0x81A5; - public var STENCIL_INDEX = 0x1901; - public var STENCIL_INDEX8 = 0x8D48; - public var DEPTH_STENCIL = 0x84F9; - - public var RENDERBUFFER_WIDTH = 0x8D42; - public var RENDERBUFFER_HEIGHT = 0x8D43; - public var RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; - public var RENDERBUFFER_RED_SIZE = 0x8D50; - public var RENDERBUFFER_GREEN_SIZE = 0x8D51; - public var RENDERBUFFER_BLUE_SIZE = 0x8D52; - public var RENDERBUFFER_ALPHA_SIZE = 0x8D53; - public var RENDERBUFFER_DEPTH_SIZE = 0x8D54; - public var RENDERBUFFER_STENCIL_SIZE = 0x8D55; - - public var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; - public var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; - public var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; - public var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; - - public var COLOR_ATTACHMENT0 = 0x8CE0; - public var DEPTH_ATTACHMENT = 0x8D00; - public var STENCIL_ATTACHMENT = 0x8D20; - public var DEPTH_STENCIL_ATTACHMENT = 0x821A; - - public var NONE = 0; - - public var FRAMEBUFFER_COMPLETE = 0x8CD5; - public var FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - public var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; - public var FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; - public var FRAMEBUFFER_UNSUPPORTED = 0x8CDD; - - public var FRAMEBUFFER_BINDING = 0x8CA6; - public var RENDERBUFFER_BINDING = 0x8CA7; - public var MAX_RENDERBUFFER_SIZE = 0x84E8; - - public var INVALID_FRAMEBUFFER_OPERATION = 0x0506; - - public var UNPACK_FLIP_Y_WEBGL = 0x9240; - public var UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241; - public var CONTEXT_LOST_WEBGL = 0x9242; - public var UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243; - public var BROWSER_DEFAULT_WEBGL = 0x9244; - - public var version (get, null):Int; - - - public function new () { - - - - } - - - public inline function activeTexture (texture:Int):Void { - - GL.activeTexture (texture); - - } - - - public inline function attachShader (program:GLProgram, shader:GLShader):Void { - - GL.attachShader (program, shader); - - } - - - public inline function bindAttribLocation (program:GLProgram, index:Int, name:String):Void { - - GL.bindAttribLocation (program, index, name); - - } - - - public inline function bindBuffer (target:Int, buffer:GLBuffer):Void { - - GL.bindBuffer (target, buffer); - - } - - - public inline function bindFramebuffer (target:Int, framebuffer:GLFramebuffer):Void { - - GL.bindFramebuffer (target, framebuffer); - - } - - - public inline function bindRenderbuffer (target:Int, renderbuffer:GLRenderbuffer):Void { - - GL.bindRenderbuffer (target, renderbuffer); - - } - - - public inline function bindTexture (target:Int, texture:GLTexture):Void { - - GL.bindTexture (target, texture); - - } - - - public inline function blendColor (red:Float, green:Float, blue:Float, alpha:Float):Void { - - GL.blendColor (red, green, blue, alpha); - - } - - - public inline function blendEquation (mode:Int):Void { - - GL.blendEquation (mode); - - } - - - public inline function blendEquationSeparate (modeRGB:Int, modeAlpha:Int):Void { - - GL.blendEquationSeparate (modeRGB, modeAlpha); - - } - - - public inline function blendFunc (sfactor:Int, dfactor:Int):Void { - - GL.blendFunc (sfactor, dfactor); - - } - - - public inline function blendFuncSeparate (srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void { - - GL.blendFuncSeparate (srcRGB, dstRGB, srcAlpha, dstAlpha); - - } - - - public inline function bufferData (target:Int, data:ArrayBufferView, usage:Int):Void { - - GL.bufferData (target, data, usage); - - } - - - public inline function bufferSubData (target:Int, offset:Int, data:ArrayBufferView):Void { - - GL.bufferSubData (target, offset, data); - - } - - - public inline function checkFramebufferStatus (target:Int):Int { - - return GL.checkFramebufferStatus (target); - - } - - - public inline function clear (mask:Int):Void { - - GL.clear (mask); - - } - - - public inline function clearColor (red:Float, green:Float, blue:Float, alpha:Float):Void { - - GL.clearColor (red, green, blue, alpha); - - } - - - public inline function clearDepth (depth:Float):Void { - - GL.clearDepth (depth); - - } - - - public inline function clearStencil (s:Int):Void { - - GL.clearStencil (s); - - } - - - public inline function colorMask (red:Bool, green:Bool, blue:Bool, alpha:Bool):Void { - - GL.colorMask (red, green, blue, alpha); - - } - - - public inline function compileShader (shader:GLShader):Void { - - GL.compileShader (shader); - - } - - - public inline function compressedTexImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, data:ArrayBufferView):Void { - - GL.compressedTexImage2D (target, level, internalformat, width, height, border, data); - - } - - - public inline function compressedTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, data:ArrayBufferView):Void { - - GL.compressedTexSubImage2D (target, level, xoffset, yoffset, width, height, format, data); - - } - - - public inline function copyTexImage2D (target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void { - - GL.copyTexImage2D (target, level, internalformat, x, y, width, height, border); - - } - - - public inline function copyTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void { - - GL.copyTexSubImage2D (target, level, xoffset, yoffset, x, y, width, height); - - } - - - public inline function createBuffer ():GLBuffer { - - return GL.createBuffer (); - - } - - - public inline function createFramebuffer ():GLFramebuffer { - - return GL.createFramebuffer (); - - } - - - public inline function createProgram ():GLProgram { - - return GL.createProgram (); - - } - - - public inline function createRenderbuffer ():GLRenderbuffer { - - return GL.createRenderbuffer (); - - } - - - public inline function createShader (type:Int):GLShader { - - return GL.createShader (type); - - } - - - public inline function createTexture ():GLTexture { - - return GL.createTexture (); - - } - - - public inline function cullFace (mode:Int):Void { - - GL.cullFace (mode); - - } - - - public inline function deleteBuffer (buffer:GLBuffer):Void { - - GL.deleteBuffer (buffer); - - } - - - public inline function deleteFramebuffer (framebuffer:GLFramebuffer):Void { - - GL.deleteFramebuffer (framebuffer); - - } - - - public inline function deleteProgram (program:GLProgram):Void { - - GL.deleteProgram (program); - - } - - - public inline function deleteRenderbuffer (renderbuffer:GLRenderbuffer):Void { - - GL.deleteRenderbuffer (renderbuffer); - - } - - - public inline function deleteShader (shader:GLShader):Void { - - GL.deleteShader (shader); - - } - - - public inline function deleteTexture (texture:GLTexture):Void { - - GL.deleteTexture (texture); - - } - - - public inline function depthFunc (func:Int):Void { - - GL.depthFunc (func); - - } - - - public inline function depthMask (flag:Bool):Void { - - GL.depthMask (flag); - - } - - - public inline function depthRange (zNear:Float, zFar:Float):Void { - - GL.depthRange (zNear, zFar); - - } - - - public inline function detachShader (program:GLProgram, shader:GLShader):Void { - - GL.detachShader (program, shader); - - } - - - public inline function disable (cap:Int):Void { - - GL.disable (cap); - - } - - - public inline function disableVertexAttribArray (index:Int):Void { - - GL.disableVertexAttribArray (index); - - } - - - public inline function drawArrays (mode:Int, first:Int, count:Int):Void { - - GL.drawArrays (mode, first, count); - - } - - - public inline function drawElements (mode:Int, count:Int, type:Int, offset:Int):Void { - - GL.drawElements (mode, count, type, offset); - - } - - - public inline function enable (cap:Int):Void { - - GL.enable (cap); - - } - - - public inline function enableVertexAttribArray (index:Int):Void { - - GL.enableVertexAttribArray (index); - - } - - - public inline function finish ():Void { - - GL.finish (); - - } - - - public inline function flush ():Void { - - GL.flush (); - - } - - - public inline function framebufferRenderbuffer (target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:GLRenderbuffer):Void { - - GL.framebufferRenderbuffer (target, attachment, renderbuffertarget, renderbuffer); - - } - - - public inline function framebufferTexture2D (target:Int, attachment:Int, textarget:Int, texture:GLTexture, level:Int):Void { - - GL.framebufferTexture2D (target, attachment, textarget, texture, level); - - } - - - public inline function frontFace (mode:Int):Void { - - GL.frontFace (mode); - - } - - - public inline function generateMipmap (target:Int):Void { - - GL.generateMipmap (target); - - } - - - public inline function getActiveAttrib (program:GLProgram, index:Int):GLActiveInfo { - - return GL.getActiveAttrib (program, index); - - } - - - public inline function getActiveUniform (program:GLProgram, index:Int):GLActiveInfo { - - return GL.getActiveUniform (program, index); - - } - - - public inline function getAttachedShaders (program:GLProgram):Array { - - return GL.getAttachedShaders (program); - - } - - - public inline function getAttribLocation (program:GLProgram, name:String):Int { - - return GL.getAttribLocation (program, name); - - } - - - public inline function getBufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { - - return GL.getBufferParameter (target, pname); - - } - - - public inline function getContextAttributes ():GLContextAttributes { - - return GL.getContextAttributes (); - - } - - - public inline function getError ():Int { - - return GL.getError (); - - } - - - public inline function getExtension (name:String):Dynamic { - - return GL.getExtension (name); - - } - - - public inline function getFramebufferAttachmentParameter (target:Int, attachment:Int, pname:Int):Int /*Dynamic*/ { - - return GL.getFramebufferAttachmentParameter (target, attachment, pname); - - } - - - public inline function getParameter (pname:Int):Dynamic { - - return GL.getParameter (pname); - - } - - - public inline function getProgramInfoLog (program:GLProgram):String { - - return GL.getProgramInfoLog (program); - - } - - - public inline function getProgramParameter (program:GLProgram, pname:Int):Int { - - return GL.getProgramParameter (program, pname); - - } - - - public inline function getRenderbufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { - - return GL.getRenderbufferParameter (target, pname); - - } - - - public inline function getShaderInfoLog (shader:GLShader):String { - - return GL.getShaderInfoLog (shader); - - } - - - public inline function getShaderParameter (shader:GLShader, pname:Int):Int { - - return GL.getShaderParameter (shader, pname); - - } - - - public inline function getShaderPrecisionFormat (shadertype:Int, precisiontype:Int):GLShaderPrecisionFormat { - - return GL.getShaderPrecisionFormat (shadertype, precisiontype); - - } - - - public inline function getShaderSource (shader:GLShader):String { - - return GL.getShaderSource (shader); - - } - - - public inline function getSupportedExtensions ():Array { - - return GL.getSupportedExtensions (); - - } - - - public inline function getTexParameter (target:Int, pname:Int):Int /*Dynamic*/ { - - return GL.getTexParameter (target, pname); - - } - - - public inline function getUniform (program:GLProgram, location:GLUniformLocation):Dynamic { - - return GL.getUniform (program, location); - - } - - - public inline function getUniformLocation (program:GLProgram, name:String):GLUniformLocation { - - return GL.getUniformLocation (program, name); - - } - - - public inline function getVertexAttrib (index:Int, pname:Int):Int /*Dynamic*/ { - - return GL.getVertexAttrib (index, pname); - - } - - - public inline function getVertexAttribOffset (index:Int, pname:Int):Int { - - return GL.getVertexAttribOffset (index, pname); - - } - - - public inline function hint (target:Int, mode:Int):Void { - - GL.hint (target, mode); - - } - - - public inline function isBuffer (buffer:GLBuffer):Bool { - - return GL.isBuffer (buffer); - - } - - - public inline function isContextLost ():Bool { - - return GL.isContextLost (); - - } - - - public inline function isEnabled (cap:Int):Bool { - - return GL.isEnabled (cap); - - } - - - public inline function isFramebuffer (framebuffer:GLFramebuffer):Bool { - - return GL.isFramebuffer (framebuffer); - - } - - - public inline function isProgram (program:GLProgram):Bool { - - return GL.isProgram (program); - - } - - - public inline function isRenderbuffer (renderbuffer:GLRenderbuffer):Bool { - - return GL.isRenderbuffer (renderbuffer); - - } - - - public inline function isShader (shader:GLShader):Bool { - - return GL.isShader (shader); - - } - - - public inline function isTexture (texture:GLTexture):Bool { - - return GL.isTexture (texture); - - } - - - public inline function lineWidth (width:Float):Void { - - GL.lineWidth (width); - - } - - - public inline function linkProgram (program:GLProgram):Void { - - GL.linkProgram (program); - - } - - - public inline function pixelStorei (pname:Int, param:Int):Void { - - GL.pixelStorei (pname, param); - - } - - - public inline function polygonOffset (factor:Float, units:Float):Void { - - GL.polygonOffset (factor, units); - - } - - - public inline function readPixels (x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { - - GL.readPixels (x, y, width, height, format, type, pixels); - - } - - - public inline function renderbufferStorage (target:Int, internalformat:Int, width:Int, height:Int):Void { - - GL.renderbufferStorage (target, internalformat, width, height); - - } - - - public inline function sampleCoverage (value:Float, invert:Bool):Void { - - GL.sampleCoverage (value, invert); - - } - - - public inline function scissor (x:Int, y:Int, width:Int, height:Int):Void { - - GL.scissor (x, y, width, height); - - } - - - public inline function shaderSource (shader:GLShader, source:String):Void { - - GL.shaderSource (shader, source); - - } - - - public inline function stencilFunc (func:Int, ref:Int, mask:Int):Void { - - GL.stencilFunc (func, ref, mask); - - } - - - public inline function stencilFuncSeparate (face:Int, func:Int, ref:Int, mask:Int):Void { - - GL.stencilFuncSeparate (face, func, ref, mask); - - } - - - public inline function stencilMask (mask:Int):Void { - - GL.stencilMask (mask); - - } - - - public inline function stencilMaskSeparate (face:Int, mask:Int):Void { - - GL.stencilMaskSeparate (face, mask); - - } - - - public inline function stencilOp (fail:Int, zfail:Int, zpass:Int):Void { - - GL.stencilOp (fail, zfail, zpass); - - } - - - public inline function stencilOpSeparate (face:Int, fail:Int, zfail:Int, zpass:Int):Void { - - GL.stencilOpSeparate (face, fail, zfail, zpass); - - } - - - public inline function texImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { - - GL.texImage2D (target, level, internalformat, width, height, border, format, type, pixels); - - } - - - public inline function texParameterf (target:Int, pname:Int, param:Float):Void { - - GL.texParameterf (target, pname, param); - - } - - - public inline function texParameteri (target:Int, pname:Int, param:Int):Void { - - GL.texParameteri (target, pname, param); - - } - - - public inline function texSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { - - GL.texSubImage2D (target, level, xoffset, yoffset, width, height, format, type, pixels); - - } - - - public inline function uniform1f (location:GLUniformLocation, x:Float):Void { - - GL.uniform1f (location, x); - - } - - - public inline function uniform1fv (location:GLUniformLocation, x:Float32Array):Void { - - GL.uniform1fv (location, x); - - } - - - public inline function uniform1i (location:GLUniformLocation, x:Int):Void { - - GL.uniform1i (location, x); - - } - - - public inline function uniform1iv (location:GLUniformLocation, v:Int32Array):Void { - - GL.uniform1iv (location, v); - - } - - - public inline function uniform2f (location:GLUniformLocation, x:Float, y:Float):Void { - - GL.uniform2f (location, x, y); - - } - - - public inline function uniform2fv (location:GLUniformLocation, v:Float32Array):Void { - - GL.uniform2fv (location, v); - - } - - - public inline function uniform2i (location:GLUniformLocation, x:Int, y:Int):Void { - - GL.uniform2i (location, x, y); - - } - - - public inline function uniform2iv (location:GLUniformLocation, v:Int32Array):Void { - - GL.uniform2iv (location, v); - - } - - - public inline function uniform3f (location:GLUniformLocation, x:Float, y:Float, z:Float):Void { - - GL.uniform3f (location, x, y, z); - - } - - - public inline function uniform3fv (location:GLUniformLocation, v:Float32Array):Void { - - GL.uniform3fv (location, v); - - } - - - public inline function uniform3i (location:GLUniformLocation, x:Int, y:Int, z:Int):Void { - - GL.uniform3i (location, x, y, z); - - } - - - public inline function uniform3iv (location:GLUniformLocation, v:Int32Array):Void { - - GL.uniform3iv (location, v); - - } - - - public inline function uniform4f (location:GLUniformLocation, x:Float, y:Float, z:Float, w:Float):Void { - - GL.uniform4f (location, x, y, z, w); - - } - - - public inline function uniform4fv (location:GLUniformLocation, v:Float32Array):Void { - - GL.uniform4fv (location, v); - - } - - - public inline function uniform4i (location:GLUniformLocation, x:Int, y:Int, z:Int, w:Int):Void { - - GL.uniform4i (location, x, y, z, w); - - } - - - public inline function uniform4iv (location:GLUniformLocation, v:Int32Array):Void { - - GL.uniform4iv (location, v); - - } - - - public inline function uniformMatrix2fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { - - GL.uniformMatrix2fv (location, transpose, v); - - } - - - public inline function uniformMatrix3fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { - - GL.uniformMatrix3fv (location, transpose, v); - - } - - - public inline function uniformMatrix4fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { - - GL.uniformMatrix4fv (location, transpose, v); - - } - - - /*public inline function uniformMatrix3D(location:GLUniformLocation, transpose:Bool, matrix:Matrix3D):Void { - - lime_gl_uniform_matrix(location, transpose, Float32Array.fromMatrix(matrix).getByteBuffer() , 4); - - }*/ - - - public inline function useProgram (program:GLProgram):Void { - - GL.useProgram (program); - - } - - - public inline function validateProgram (program:GLProgram):Void { - - GL.validateProgram (program); - - } - - - public inline function vertexAttrib1f (indx:Int, x:Float):Void { - - GL.vertexAttrib1f (indx, x); - - } - - - public inline function vertexAttrib1fv (indx:Int, values:Float32Array):Void { - - GL.vertexAttrib1fv (indx, values); - - } - - - public inline function vertexAttrib2f (indx:Int, x:Float, y:Float):Void { - - GL.vertexAttrib2f (indx, x, y); - - } - - - public inline function vertexAttrib2fv (indx:Int, values:Float32Array):Void { - - GL.vertexAttrib2fv (indx, values); - - } - - - public inline function vertexAttrib3f (indx:Int, x:Float, y:Float, z:Float):Void { - - GL.vertexAttrib3f (indx, x, y, z); - - } - - - public inline function vertexAttrib3fv (indx:Int, values:Float32Array):Void { - - GL.vertexAttrib3fv (indx, values); - - } - - - public inline function vertexAttrib4f (indx:Int, x:Float, y:Float, z:Float, w:Float):Void { - - GL.vertexAttrib4f (indx, x, y, z, w); - - } - - - public inline function vertexAttrib4fv (indx:Int, values:Float32Array):Void { - - GL.vertexAttrib4fv (indx, values); - - } - - - public inline function vertexAttribPointer (indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int):Void { - - GL.vertexAttribPointer (indx, size, type, normalized, stride, offset); - - } - - - public inline function viewport (x:Int, y:Int, width:Int, height:Int):Void { - - GL.viewport (x, y, width, height); - - } - - - private function get_version ():Int { return 2; } - - -} +package lime.graphics; +#if (sys && !display) +typedef GLRenderContext = lime._backend.native.NativeGLRenderContext; #else -import js.html.CanvasElement; import lime.graphics.opengl.GLActiveInfo; import lime.graphics.opengl.GLBuffer; import lime.graphics.opengl.GLContextAttributes; @@ -1350,9 +17,13 @@ import lime.graphics.opengl.GLShaderPrecisionFormat; import lime.graphics.opengl.GLTexture; import lime.graphics.opengl.GLUniformLocation; +#if (js && html5) +import js.html.CanvasElement; +#end + @:native("WebGLRenderingContext") -extern class GLRenderContext { +extern class HTML5GLRenderContext { var ACTIVE_ATTRIBUTES:Int; @@ -1651,9 +322,11 @@ extern class GLRenderContext { var VIEWPORT:Int; var ZERO:Int; + #if (js && html5) var canvas (default, null):CanvasElement; var drawingBufferHeight (default,null):Int; - var drawingBufferWidth (default,null):Int; + var drawingBufferWidth (default, null):Int; + #end function activeTexture (texture:Int):Void; function attachShader (program:GLProgram, shader:GLShader):Void; diff --git a/lime/graphics/opengl/GL.hx b/lime/graphics/opengl/GL.hx index a053c6094..15d0b203e 100644 --- a/lime/graphics/opengl/GL.hx +++ b/lime/graphics/opengl/GL.hx @@ -1,34 +1,9 @@ package lime.graphics.opengl; -import lime.utils.ArrayBuffer; import lime.utils.ArrayBufferView; import lime.utils.Float32Array; import lime.utils.Int32Array; -import lime.system.CFFIPointer; -import lime.system.System; - -#if (js && html5) -import js.html.webgl.RenderingContext; -#elseif java -import org.lwjgl.opengl.EXTBlendColor; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL13; -import org.lwjgl.opengl.GL14; -import org.lwjgl.opengl.GL15; -import org.lwjgl.opengl.GL20; -import org.lwjgl.opengl.GL30; -#end - -#if cpp -import cpp.Float32; -#else -typedef Float32 = Float; -#end - -#if !macro -@:build(lime.system.CFFI.build()) -#end @:allow(lime.ui.Window) @@ -387,1680 +362,875 @@ class GL { public static var version (get, null):Int; - #if (js && html5) - private static var context:RenderingContext; - #end + private static var context:GLRenderContext; private static var __currentProgram:GLProgram; public static inline function activeTexture (texture:Int):Void { - #if (js && html5 && !display) context.activeTexture (texture); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_active_texture (texture); - #elseif java - GL13.glActiveTexture (texture); - #end } public static inline function attachShader (program:GLProgram, shader:GLShader):Void { - #if (js && html5 && !display) context.attachShader (program, shader); - #elseif (lime_cffi && lime_opengl && !macro) - program.attach (shader); - lime_gl_attach_shader (program.id, shader.id); - #elseif java - program.attach (shader); - GL20.glAttachShader (program.id, shader.id); - #end } public static inline function bindAttribLocation (program:GLProgram, index:Int, name:String):Void { - #if (js && html5 && !display) context.bindAttribLocation (program, index, name); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_bind_attrib_location (program.id, index, name); - #elseif java - GL20.glBindAttribLocation (program.id, index, name); - #end } public static inline function bindBuffer (target:Int, buffer:GLBuffer):Void { - #if (js && html5 && !display) context.bindBuffer (target, buffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_bind_buffer (target, buffer == null ? null : buffer.id); - #elseif java - GL15.glBindBuffer (target, buffer == null ? null : buffer.id); - #end } public static inline function bindFramebuffer (target:Int, framebuffer:GLFramebuffer):Void { - #if (js && html5 && !display) context.bindFramebuffer (target, framebuffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_bind_framebuffer (target, framebuffer == null ? null : framebuffer.id); - #elseif java - GL30.glBindFramebuffer (target, framebuffer == null ? null : framebuffer.id); - #end } public static inline function bindRenderbuffer (target:Int, renderbuffer:GLRenderbuffer):Void { - #if (js && html5 && !display) context.bindRenderbuffer (target, renderbuffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_bind_renderbuffer (target, renderbuffer == null ? null : renderbuffer.id); - #elseif java - GL30.glBindRenderbuffer (target, renderbuffer == null ? null : renderbuffer.id); - #end } public static inline function bindTexture (target:Int, texture:GLTexture):Void { - #if (js && html5 && !display) context.bindTexture (target, texture); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_bind_texture (target, texture == null ? null : texture.id); - #elseif java - GL11.glBindTexture (target, texture == null ? null : texture.id); - #end } public static inline function blendColor (red:Float, green:Float, blue:Float, alpha:Float):Void { - #if (js && html5 && !display) context.blendColor (red, green, blue, alpha); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_blend_color (red, green, blue, alpha); - #elseif java - EXTBlendColor.glBlendColorEXT (red, green, blue, alpha); - #end } public static inline function blendEquation (mode:Int):Void { - #if (js && html5 && !display) context.blendEquation (mode); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_blend_equation (mode); - #elseif java - GL14.glBlendEquation (mode); - #end } public static inline function blendEquationSeparate (modeRGB:Int, modeAlpha:Int):Void { - #if (js && html5 && !display) context.blendEquationSeparate (modeRGB, modeAlpha); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_blend_equation_separate (modeRGB, modeAlpha); - #elseif java - GL20.glBlendEquationSeparate (modeRGB, modeAlpha); - #end } public static inline function blendFunc (sfactor:Int, dfactor:Int):Void { - #if (js && html5 && !display) context.blendFunc (sfactor, dfactor); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_blend_func (sfactor, dfactor); - #elseif java - GL11.glBlendFunc (sfactor, dfactor); - #end } public static inline function blendFuncSeparate (srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void { - #if (js && html5 && !display) context.blendFuncSeparate (srcRGB, dstRGB, srcAlpha, dstAlpha); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_blend_func_separate (srcRGB, dstRGB, srcAlpha, dstAlpha); - #elseif java - GL14.glBlendFuncSeparate (srcRGB, dstRGB, srcAlpha, dstAlpha); - #end } public static inline function bufferData (target:Int, data:ArrayBufferView, usage:Int):Void { - #if (js && html5 && !display) context.bufferData (target, data, usage); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_buffer_data (target, data.buffer, data.byteOffset, data.byteLength, usage); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_buffer_data (target, data, data.byteOffset, data.byteLength, usage); - #elseif java - //GL15.glBufferData (target, data.buffer, data.byteOffset, data.byteLength, usage); - #end } public static inline function bufferSubData (target:Int, offset:Int, data:ArrayBufferView):Void { - #if (js && html5 && !display) context.bufferSubData (target, offset, data); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_buffer_sub_data (target, offset, data.buffer, data.byteOffset, data.byteLength); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_buffer_sub_data (target, offset, data, data.byteOffset, data.byteLength); - #elseif java - //GL15.glBufferSubData (target, offset, data.buffer, data.byteOffset, data.byteLength); - #end } public static inline function checkFramebufferStatus (target:Int):Int { - #if (js && html5 && !display) return context.checkFramebufferStatus (target); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_check_framebuffer_status (target); - #elseif java - return GL30.glCheckFramebufferStatus (target); - #else - return 0; - #end } public static inline function clear (mask:Int):Void { - #if (js && html5 && !display) context.clear (mask); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_clear (mask); - #elseif java - GL11.glClear (mask); - #end } public static inline function clearColor (red:Float, green:Float, blue:Float, alpha:Float):Void { - #if (js && html5 && !display) context.clearColor (red, green, blue, alpha); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_clear_color (red, green, blue, alpha); - #elseif java - GL11.glClearColor (red, green, blue, alpha); - #end } public static inline function clearDepth (depth:Float):Void { - #if (js && html5 && !display) context.clearDepth (depth); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_clear_depth (depth); - #elseif java - GL11.glClearDepth (depth); - #end } public static inline function clearStencil (s:Int):Void { - #if (js && html5 && !display) context.clearStencil (s); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_clear_stencil (s); - #elseif java - GL11.glClearStencil (s); - #end } public static inline function colorMask (red:Bool, green:Bool, blue:Bool, alpha:Bool):Void { - #if (js && html5 && !display) context.colorMask (red, green, blue, alpha); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_color_mask (red, green, blue, alpha); - #elseif java - GL11.glColorMask (red, green, blue, alpha); - #end } public static inline function compileShader (shader:GLShader):Void { - #if (js && html5 && !display) context.compileShader (shader); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_compile_shader (shader.id); - #elseif java - GL20.glCompileShader (shader.id); - #end } public static inline function compressedTexImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, data:ArrayBufferView):Void { - #if (js && html5 && !display) context.compressedTexImage2D (target, level, internalformat, width, height, border, data); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - var buffer = data == null ? null : data.buffer; - lime_gl_compressed_tex_image_2d (target, level, internalformat, width, height, border, buffer, data == null ? 0 : data.byteOffset); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_compressed_tex_image_2d (target, level, internalformat, width, height, border, data == null ? null : data , data == null ? null : data.byteOffset); - #elseif java - //GL13.glCompressedTexImage2D (target, level, internalformat, width, height, border, data == null ? null : data.buffer, data == null ? null : data.byteOffset); - #end } public static inline function compressedTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, data:ArrayBufferView):Void { - #if (js && html5 && !display) context.compressedTexSubImage2D (target, level, xoffset, yoffset, width, height, format, data); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - var buffer = data == null ? null : data.buffer; - lime_gl_compressed_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, buffer, data == null ? 0 : data.byteOffset); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_compressed_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, data == null ? null : data, data == null ? null : data.byteOffset); - #elseif java - //GL13.glCompressedTexSubImage2D (target, level, xoffset, yoffset, width, height, format, data == null ? null : data.buffer, data == null ? null : data.byteOffset); - #end } public static inline function copyTexImage2D (target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void { - #if (js && html5 && !display) context.copyTexImage2D (target, level, internalformat, x, y, width, height, border); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_copy_tex_image_2d (target, level, internalformat, x, y, width, height, border); - #elseif java - GL11.glCopyTexImage2D (target, level, internalformat, x, y, width, height, border); - #end } public static inline function copyTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void { - #if (js && html5 && !display) context.copyTexSubImage2D (target, level, xoffset, yoffset, x, y, width, height); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_copy_tex_sub_image_2d (target, level, xoffset, yoffset, x, y, width, height); - #elseif java - GL11.glCopyTexSubImage2D (target, level, xoffset, yoffset, x, y, width, height); - #end } public static inline function createBuffer ():GLBuffer { - #if (js && html5 && !display) return context.createBuffer (); - #elseif (lime_cffi && lime_opengl && !macro) - return new GLBuffer (version, lime_gl_create_buffer ()); - #elseif java - //return new GLBuffer (version, GL15.glGenBuffers (1)); - return null; - #else - return null; - #end } public static inline function createFramebuffer ():GLFramebuffer { - #if (js && html5 && !display) return context.createFramebuffer (); - #elseif (lime_cffi && lime_opengl && !macro) - return new GLFramebuffer (version, lime_gl_create_framebuffer ()); - #elseif java - //return new GLFramebuffer (version, GL30.glGenFramebuffers (1)); - return null; - #else - return null; - #end } public static inline function createProgram ():GLProgram { - #if (js && html5 && !display) return context.createProgram (); - #elseif (lime_cffi && lime_opengl && !macro) - return new GLProgram (version, lime_gl_create_program ()); - #elseif java - return new GLProgram (version, GL20.glCreateProgram ()); - #else - return null; - #end } public static inline function createRenderbuffer ():GLRenderbuffer { - #if (js && html5 && !display) return context.createRenderbuffer (); - #elseif (lime_cffi && lime_opengl && !macro) - return new GLRenderbuffer (version, lime_gl_create_render_buffer ()); - #elseif java - //return new GLRenderbuffer (version, GL30.glGenRenderbuffers (1)); - return null; - #else - return null; - #end } public static inline function createShader (type:Int):GLShader { - #if (js && html5 && !display) return context.createShader (type); - #elseif (lime_cffi && lime_opengl && !macro) - return new GLShader (version, lime_gl_create_shader (type)); - #elseif java - return new GLShader (version, GL20.glCreateShader (type)); - #else - return null; - #end } public static inline function createTexture ():GLTexture { - #if (js && html5 && !display) return context.createTexture (); - #elseif (lime_cffi && lime_opengl && !macro) - return new GLTexture (version, lime_gl_create_texture ()); - #elseif java - //return new GLTexture (version, GL11.glGenTextures (1)); - return null; - #else - return null; - #end } public static inline function cullFace (mode:Int):Void { - #if (js && html5 && !display) context.cullFace (mode); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_cull_face (mode); - #elseif java - GL11.glCullFace (mode); - #end } public static inline function deleteBuffer (buffer:GLBuffer):Void { - #if (js && html5 && !display) context.deleteBuffer (buffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_delete_buffer (buffer.id); - buffer.invalidate (); - #elseif java - GL15.glDeleteBuffers (buffer.id); - buffer.invalidate (); - #end } public static inline function deleteFramebuffer (framebuffer:GLFramebuffer):Void { - #if (js && html5 && !display) context.deleteFramebuffer (framebuffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_delete_framebuffer (framebuffer.id); - framebuffer.invalidate (); - #elseif - GL30.glDeleteFramebuffers (framebuffer.id); - framebuffer.invalidate (); - #end } public static inline function deleteProgram (program:GLProgram):Void { - #if (js && html5 && !display) context.deleteProgram (program); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_delete_program (program.id); - program.invalidate (); - #elseif java - GL20.glDeleteProgram (program.id); - program.invalidate (); - #end } public static inline function deleteRenderbuffer (renderbuffer:GLRenderbuffer):Void { - #if (js && html5 && !display) context.deleteRenderbuffer (renderbuffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_delete_render_buffer (renderbuffer.id); - renderbuffer.invalidate (); - #elseif java - GL30.glDeleteRenderbuffers (renderbuffer.id); - renderbuffer.invalidate (); - #end } public static inline function deleteShader (shader:GLShader):Void { - #if (js && html5 && !display) context.deleteShader (shader); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_delete_shader (shader.id); - shader.invalidate (); - #elseif java - GL20.glDeleteShader (shader.id); - shader.invalidate (); - #end } public static inline function deleteTexture (texture:GLTexture):Void { - #if (js && html5 && !display) context.deleteTexture (texture); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_delete_texture (texture.id); - texture.invalidate (); - #elseif java - GL11.glDeleteTextures (texture.id); - texture.invalidate (); - #end } public static inline function depthFunc (func:Int):Void { - #if (js && html5 && !display) context.depthFunc (func); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_depth_func (func); - #elseif java - GL11.glDepthFunc (func); - #end } public static inline function depthMask (flag:Bool):Void { - #if (js && html5 && !display) context.depthMask (flag); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_depth_mask (flag); - #elseif java - GL11.glDepthMask (flag); - #end } public static inline function depthRange (zNear:Float, zFar:Float):Void { - #if (js && html5 && !display) context.depthRange (zNear, zFar); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_depth_range (zNear, zFar); - #elseif java - GL11.glDepthRange (zNear, zFar); - #end } public static inline function detachShader (program:GLProgram, shader:GLShader):Void { - #if (js && html5 && !display) context.detachShader (program, shader); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_detach_shader (program.id, shader.id); - #elseif java - GL20.glDetachShader (program.id, shader.id); - #end } public static inline function disable (cap:Int):Void { - #if (js && html5 && !display) context.disable (cap); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_disable (cap); - #elseif java - GL11.glDisable (cap); - #end } public static inline function disableVertexAttribArray (index:Int):Void { - #if (js && html5 && !display) context.disableVertexAttribArray (index); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_disable_vertex_attrib_array (index); - #elseif java - GL20.glDisableVertexAttribArray (index); - #end } public static inline function drawArrays (mode:Int, first:Int, count:Int):Void { - #if (js && html5 && !display) context.drawArrays (mode, first, count); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_draw_arrays (mode, first, count); - #elseif java - GL11.glDrawArrays (mode, first, count); - #end } public static inline function drawElements (mode:Int, count:Int, type:Int, offset:Int):Void { - #if (js && html5 && !display) context.drawElements (mode, count, type, offset); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_draw_elements (mode, count, type, offset); - #elseif java - //GL11.glDrawElements (mode, count, type, offset); - #end } public static inline function enable (cap:Int):Void { - #if (js && html5 && !display) context.enable (cap); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_enable (cap); - #elseif java - GL11.glEnable (cap); - #end } public static inline function enableVertexAttribArray (index:Int):Void { - #if (js && html5 && !display) context.enableVertexAttribArray (index); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_enable_vertex_attrib_array (index); - #elseif java - GL20.glEnableVertexAttribArray (index); - #end } public static inline function finish ():Void { - #if (js && html5 && !display) context.finish (); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_finish (); - #elseif java - GL11.glFinish (); - #end } public static inline function flush ():Void { - #if (js && html5 && !display) context.flush (); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_flush (); - #elseif java - GL11.glFlush (); - #end } public static inline function framebufferRenderbuffer (target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:GLRenderbuffer):Void { - #if (js && html5 && !display) context.framebufferRenderbuffer (target, attachment, renderbuffertarget, renderbuffer); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_framebuffer_renderbuffer (target, attachment, renderbuffertarget, renderbuffer.id); - #elseif java - GL30.glFramebufferRenderbuffer (target, attachment, renderbuffertarget, renderbuffer.id); - #end } public static inline function framebufferTexture2D (target:Int, attachment:Int, textarget:Int, texture:GLTexture, level:Int):Void { - #if (js && html5 && !display) context.framebufferTexture2D (target, attachment, textarget, texture, level); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_framebuffer_texture2D (target, attachment, textarget, texture.id, level); - #elseif java - GL30.glFramebufferTexture2D (target, attachment, textarget, texture.id, level); - #end } public static inline function frontFace (mode:Int):Void { - #if (js && html5 && !display) context.frontFace (mode); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_front_face (mode); - #elseif java - GL11.glFrontFace (mode); - #end } public static inline function generateMipmap (target:Int):Void { - #if (js && html5 && !display) context.generateMipmap (target); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_generate_mipmap (target); - #elseif java - GL30.glGenerateMipmap (target); - #end } public static inline function getActiveAttrib (program:GLProgram, index:Int):GLActiveInfo { - #if (js && html5 && !display) return context.getActiveAttrib (program, index); - #elseif (lime_cffi && lime_opengl && !macro) - var result:Dynamic = lime_gl_get_active_attrib (program.id, index); - return result; - #elseif java - //return GL20.glGetActiveAttrib (program.id, index); - return null; - #else - return null; - #end } public static inline function getActiveUniform (program:GLProgram, index:Int):GLActiveInfo { - #if (js && html5 && !display) return context.getActiveUniform (program, index); - #elseif (lime_cffi && lime_opengl && !macro) - var result:Dynamic = lime_gl_get_active_uniform (program.id, index); - return result; - #elseif java - //return GL20.glGetActiveUniform (program.id, index); - return null; - #else - return null; - #end } public static inline function getAttachedShaders (program:GLProgram):Array { - #if (js && html5 && !display) return context.getAttachedShaders (program); - #elseif (lime_cffi && lime_opengl && !macro) - return program.getShaders (); - #elseif java - return program.getShaders (); - #else - return null; - #end } public static inline function getAttribLocation (program:GLProgram, name:String):Int { - #if (js && html5 && !display) return context.getAttribLocation (program, name); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_attrib_location (program.id, name); - #elseif java - return GL20.glGetAttribLocation (program.id, name); - #else - return 0; - #end } public static inline function getBufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { - #if (js && html5 && !display) return context.getBufferParameter (target, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_buffer_parameter (target, pname); - #elseif java - //return GL15.glGetBufferParameter (target, pname); - return 0; - #else - return 0; - #end } public static inline function getContextAttributes ():GLContextAttributes { - #if (js && html5 && !display) return context.getContextAttributes (); - #elseif (lime_cffi && lime_opengl && !macro) - var base:Dynamic = lime_gl_get_context_attributes (); - base.premultipliedAlpha = false; - base.preserveDrawingBuffer = false; - return base; - #elseif java - //var base = lime_gl_get_context_attributes (); - var base:Dynamic = {}; - base.premultipliedAlpha = false; - base.preserveDrawingBuffer = false; - return base; - #else - return null; - #end } public static inline function getError ():Int { - #if (js && html5 && !display) return context.getError (); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_error (); - #elseif java - return GL11.glGetError (); - #else - return 0; - #end } public static inline function getExtension (name:String):Dynamic { - #if (js && html5 && !display) return context.getExtension (name); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_extension (name); - #else - return null; - #end } public static inline function getFramebufferAttachmentParameter (target:Int, attachment:Int, pname:Int):Int /*Dynamic*/ { - #if (js && html5 && !display) return context.getFramebufferAttachmentParameter (target, attachment, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_framebuffer_attachment_parameter (target, attachment, pname); - #elseif java - //return GL30.glGetFramebufferAttachmentParameter (target, attachment, pname); - return 0; - #else - return 0; - #end } public static inline function getParameter (pname:Int):Dynamic { - #if (js && html5 && !display) return context.getParameter (pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_parameter (pname); - #elseif java - return null; - #else - return null; - #end } public static inline function getProgramInfoLog (program:GLProgram):String { - #if (js && html5 && !display) return context.getProgramInfoLog (program); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_program_info_log (program.id); - #elseif java - return GL20.glGetProgramInfoLog (program.id); - #else - return null; - #end } public static inline function getProgramParameter (program:GLProgram, pname:Int):Int { - #if (js && html5 && !display) return context.getProgramParameter (program, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_program_parameter (program.id, pname); - #elseif java - //return GL20.glGetProgramParameter (program.id, pname); - return 0; - #else - return 0; - #end } public static inline function getRenderbufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { - #if (js && html5 && !display) return context.getRenderbufferParameter (target, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_render_buffer_parameter (target, pname); - #elseif java - //return GL30.glGetRenderbufferParameter (target, pname); - return 0; - #else - return 0; - #end } public static inline function getShaderInfoLog (shader:GLShader):String { - #if (js && html5 && !display) return context.getShaderInfoLog (shader); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_shader_info_log (shader.id); - #elseif java - return GL20.glGetShaderInfoLog (shader.id); - #else - return null; - #end } public static inline function getShaderParameter (shader:GLShader, pname:Int):Int { - #if (js && html5 && !display) return context.getShaderParameter (shader, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_shader_parameter (shader.id, pname); - #elseif java - //return GL20.glGetShaderParameter (shader.id, pname); - return 0; - #else - return 0; - #end } public static inline function getShaderPrecisionFormat (shadertype:Int, precisiontype:Int):GLShaderPrecisionFormat { - #if (js && html5 && !display) return context.getShaderPrecisionFormat (shadertype, precisiontype); - #elseif (lime_cffi && lime_opengl && !macro) - var result:Dynamic = lime_gl_get_shader_precision_format (shadertype, precisiontype); - return result; - #elseif java - //return GL20.glGetShaderPrecisionFormat (shadertype, precisiontype); - return null; - #else - return null; - #end } public static inline function getShaderSource (shader:GLShader):String { - #if (js && html5 && !display) return context.getShaderSource (shader); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_shader_source (shader.id); - #elseif java - return GL20.glGetShaderSource (shader.id); - #else - return null; - #end } public static inline function getSupportedExtensions ():Array { - #if (js && html5 && !display) return context.getSupportedExtensions (); - #elseif (lime_cffi && lime_opengl && !macro) - var result = new Array (); - lime_gl_get_supported_extensions (result); - return result; - #elseif java - return null; - #else - return null; - #end } public static inline function getTexParameter (target:Int, pname:Int):Int /*Dynamic*/ { - #if (js && html5 && !display) return context.getTexParameter (target, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_tex_parameter (target, pname); - #elseif java - //return GL11.nglGetTexParameteriv (target, pname); - return 0; - #else - return 0; - #end } public static inline function getUniform (program:GLProgram, location:GLUniformLocation):Dynamic { - #if (js && html5 && !display) return context.getUniform (program, location); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_uniform (program.id, location); - #elseif java - //return GL20.glGetUniform (program.id, location); - return null; - #else - return null; - #end } public static inline function getUniformLocation (program:GLProgram, name:String):GLUniformLocation { - #if (js && html5 && !display) return context.getUniformLocation (program, name); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_uniform_location (program.id, name); - #elseif java - return GL20.glGetUniformLocation (program.id, name); - #else - return 0; - #end } public static inline function getVertexAttrib (index:Int, pname:Int):Int /*Dynamic*/ { - #if (js && html5 && !display) return context.getVertexAttrib (index, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_vertex_attrib (index, pname); - #elseif java - return 0; - #else - return 0; - #end } public static inline function getVertexAttribOffset (index:Int, pname:Int):Int { - #if (js && html5 && !display) return context.getVertexAttribOffset (index, pname); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_get_vertex_attrib_offset (index, pname); - #elseif java - return 0; - #else - return 0; - #end } public static inline function hint (target:Int, mode:Int):Void { - #if (js && html5 && !display) context.hint (target, mode); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_hint (target, mode); - #end } public static inline function isBuffer (buffer:GLBuffer):Bool { - #if (js && html5 && !display) return context.isBuffer (buffer); - #elseif (lime_cffi && lime_opengl && !macro) - return buffer != null && buffer.id > 0 && lime_gl_is_buffer (buffer.id); - #else - return false; - #end } public static inline function isContextLost ():Bool { - #if (js && html5 && !display) return context.isContextLost (); - #else - return false; - #end } public static inline function isEnabled (cap:Int):Bool { - #if (js && html5 && !display) return context.isEnabled (cap); - #elseif (lime_cffi && lime_opengl && !macro) - return lime_gl_is_enabled (cap); - #else - return false; - #end } public static inline function isFramebuffer (framebuffer:GLFramebuffer):Bool { - #if (js && html5 && !display) return context.isFramebuffer (framebuffer); - #elseif (lime_cffi && lime_opengl && !macro) - return framebuffer != null && framebuffer.id > 0 && lime_gl_is_framebuffer (framebuffer.id); - #else - return false; - #end } public static inline function isProgram (program:GLProgram):Bool { - #if (js && html5 && !display) return context.isProgram (program); - #elseif (lime_cffi && lime_opengl && !macro) - return program != null && program.id > 0 && lime_gl_is_program (program.id); - #else - return false; - #end } public static inline function isRenderbuffer (renderbuffer:GLRenderbuffer):Bool { - #if (js && html5 && !display) return context.isRenderbuffer (renderbuffer); - #elseif (lime_cffi && lime_opengl && !macro) - return renderbuffer != null && renderbuffer.id > 0 && lime_gl_is_renderbuffer (renderbuffer.id); - #else - return false; - #end } public static inline function isShader (shader:GLShader):Bool { - #if (js && html5 && !display) return context.isShader (shader); - #elseif (lime_cffi && lime_opengl && !macro) - return shader != null && shader.id > 0 && lime_gl_is_shader (shader.id); - #else - return false; - #end } public static inline function isTexture (texture:GLTexture):Bool { - #if (js && html5 && !display) return context.isTexture (texture); - #elseif (lime_cffi && lime_opengl && !macro) - return texture != null && texture.id > 0 && lime_gl_is_texture (texture.id); - #else - return false; - #end } public static inline function lineWidth (width:Float):Void { - #if (js && html5 && !display) context.lineWidth (width); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_line_width (width); - #end } public static inline function linkProgram (program:GLProgram):Void { - #if (js && html5 && !display) context.linkProgram (program); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_link_program (program.id); - #end } public static inline function pixelStorei (pname:Int, param:Int):Void { - #if (js && html5 && !display) context.pixelStorei (pname, param); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_pixel_storei (pname, param); - #end } public static inline function polygonOffset (factor:Float, units:Float):Void { - #if (js && html5 && !display) context.polygonOffset (factor, units); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_polygon_offset (factor, units); - #end } public static inline function readPixels (x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { - #if (js && html5 && !display) context.readPixels (x, y, width, height, format, type, pixels); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - var buffer = pixels == null ? null : pixels.buffer; - lime_gl_read_pixels (x, y, width, height, format, type, buffer, pixels == null ? 0 : pixels.byteOffset); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_read_pixels (x, y, width, height, format, type, pixels == null ? null : pixels, pixels == null ? null : pixels.byteOffset); - #end } public static inline function renderbufferStorage (target:Int, internalformat:Int, width:Int, height:Int):Void { - #if (js && html5 && !display) context.renderbufferStorage (target, internalformat, width, height); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_renderbuffer_storage (target, internalformat, width, height); - #end } public static inline function sampleCoverage (value:Float, invert:Bool):Void { - #if (js && html5 && !display) context.sampleCoverage (value, invert); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_sample_coverage (value, invert); - #end } public static inline function scissor (x:Int, y:Int, width:Int, height:Int):Void { - #if (js && html5 && !display) context.scissor (x, y, width, height); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_scissor (x, y, width, height); - #end } public static inline function shaderSource (shader:GLShader, source:String):Void { - #if (js && html5 && !display) context.shaderSource (shader, source); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_shader_source (shader.id, source); - #end } public static inline function stencilFunc (func:Int, ref:Int, mask:Int):Void { - #if (js && html5 && !display) context.stencilFunc (func, ref, mask); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_stencil_func (func, ref, mask); - #end } public static inline function stencilFuncSeparate (face:Int, func:Int, ref:Int, mask:Int):Void { - #if (js && html5 && !display) context.stencilFuncSeparate (face, func, ref, mask); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_stencil_func_separate (face, func, ref, mask); - #end } public static inline function stencilMask (mask:Int):Void { - #if (js && html5 && !display) context.stencilMask (mask); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_stencil_mask (mask); - #end } public static inline function stencilMaskSeparate (face:Int, mask:Int):Void { - #if (js && html5 && !display) context.stencilMaskSeparate (face, mask); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_stencil_mask_separate (face, mask); - #end } public static inline function stencilOp (fail:Int, zfail:Int, zpass:Int):Void { - #if (js && html5 && !display) context.stencilOp (fail, zfail, zpass); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_stencil_op (fail, zfail, zpass); - #end } public static inline function stencilOpSeparate (face:Int, fail:Int, zfail:Int, zpass:Int):Void { - #if (js && html5 && !display) context.stencilOpSeparate (face, fail, zfail, zpass); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_stencil_op_separate (face, fail, zfail, zpass); - #end } public static inline function texImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { - #if (js && html5 && !display) context.texImage2D (target, level, internalformat, width, height, border, format, type, pixels); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - var buffer = pixels == null ? null : pixels.buffer; - lime_gl_tex_image_2d (target, level, internalformat, width, height, border, format, type, buffer, pixels == null ? 0 : pixels.byteOffset); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_tex_image_2d (target, level, internalformat, width, height, border, format, type, pixels == null ? null : pixels, pixels == null ? null : pixels.byteOffset); - #end } public static inline function texParameterf (target:Int, pname:Int, param:Float):Void { - #if (js && html5 && !display) context.texParameterf (target, pname, param); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_tex_parameterf (target, pname, param); - #end } public static inline function texParameteri (target:Int, pname:Int, param:Int):Void { - #if (js && html5 && !display) context.texParameteri (target, pname, param); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_tex_parameteri (target, pname, param); - #end } public static inline function texSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { - #if (js && html5 && !display) context.texSubImage2D (target, level, xoffset, yoffset, width, height, format, type, pixels); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - var buffer = pixels == null ? null : pixels.buffer; - lime_gl_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, type, buffer, pixels == null ? 0 : pixels.byteOffset); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_tex_sub_image_2d (target, level, xoffset, yoffset, width, height, format, type, pixels == null ? null : pixels, pixels == null ? null : pixels.byteOffset); - #end } public static inline function uniform1f (location:GLUniformLocation, x:Float):Void { - #if (js && html5 && !display) context.uniform1f (location, x); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform1f (location, x); - #end } public static inline function uniform1fv (location:GLUniformLocation, x:Float32Array):Void { - #if (js && html5 && !display) context.uniform1fv (location, x); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform1fv (location, x.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform1fv (location, x); - #end } public static inline function uniform1i (location:GLUniformLocation, x:Int):Void { - #if (js && html5 && !display) context.uniform1i (location, x); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform1i (location, x); - #end } public static inline function uniform1iv (location:GLUniformLocation, v:Int32Array):Void { - #if (js && html5 && !display) context.uniform1iv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform1iv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform1iv (location, v); - #end } public static inline function uniform2f (location:GLUniformLocation, x:Float, y:Float):Void { - #if (js && html5 && !display) context.uniform2f (location, x, y); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform2f (location, x, y); - #end } public static inline function uniform2fv (location:GLUniformLocation, v:Float32Array):Void { - #if (js && html5 && !display) context.uniform2fv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform2fv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform2fv (location, v); - #end } public static inline function uniform2i (location:GLUniformLocation, x:Int, y:Int):Void { - #if (js && html5 && !display) context.uniform2i (location, x, y); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform2i (location, x, y); - #end } public static inline function uniform2iv (location:GLUniformLocation, v:Int32Array):Void { - #if (js && html5 && !display) context.uniform2iv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform2iv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform2iv (location, v); - #end } public static inline function uniform3f (location:GLUniformLocation, x:Float, y:Float, z:Float):Void { - #if (js && html5 && !display) context.uniform3f (location, x, y, z); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform3f (location, x, y, z); - #end } public static inline function uniform3fv (location:GLUniformLocation, v:Float32Array):Void { - #if (js && html5 && !display) context.uniform3fv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform3fv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform3fv (location, v); - #end } public static inline function uniform3i (location:GLUniformLocation, x:Int, y:Int, z:Int):Void { - #if (js && html5 && !display) context.uniform3i (location, x, y, z); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform3i (location, x, y, z); - #end } public static inline function uniform3iv (location:GLUniformLocation, v:Int32Array):Void { - #if (js && html5 && !display) context.uniform3iv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform3iv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform3iv (location, v); - #end } public static inline function uniform4f (location:GLUniformLocation, x:Float, y:Float, z:Float, w:Float):Void { - #if (js && html5 && !display) context.uniform4f (location, x, y, z, w); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform4f (location, x, y, z, w); - #end } public static inline function uniform4fv (location:GLUniformLocation, v:Float32Array):Void { - #if (js && html5 && !display) context.uniform4fv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform4fv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform4fv (location, v); - #end } public static inline function uniform4i (location:GLUniformLocation, x:Int, y:Int, z:Int, w:Int):Void { - #if (js && html5 && !display) context.uniform4i (location, x, y, z, w); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_uniform4i (location, x, y, z, w); - #end } public static inline function uniform4iv (location:GLUniformLocation, v:Int32Array):Void { - #if (js && html5 && !display) context.uniform4iv (location, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform4iv (location, v.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform4iv (location, v); - #end } public static inline function uniformMatrix2fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { - #if (js && html5 && !display) context.uniformMatrix2fv (location, transpose, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform_matrix (location, transpose, v.buffer, 2); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform_matrix (location, transpose, v, 2); - #end } public static inline function uniformMatrix3fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { - #if (js && html5 && !display) context.uniformMatrix3fv (location, transpose, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform_matrix (location, transpose, v.buffer, 3); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform_matrix (location, transpose, v, 3); - #end } public static inline function uniformMatrix4fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { - #if (js && html5 && !display) context.uniformMatrix4fv (location, transpose, v); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_uniform_matrix (location, transpose, v.buffer, 4); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_uniform_matrix (location, transpose, v, 4); - #end } @@ -2076,140 +1246,84 @@ class GL { __currentProgram = program; - #if (js && html5 && !display) context.useProgram (program); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_use_program (program == null ? null : program.id); - #end } public static inline function validateProgram (program:GLProgram):Void { - #if (js && html5 && !display) context.validateProgram (program); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_validate_program (program.id); - #end } public static inline function vertexAttrib1f (indx:Int, x:Float):Void { - #if (js && html5 && !display) context.vertexAttrib1f (indx, x); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_vertex_attrib1f (indx, x); - #end } public static inline function vertexAttrib1fv (indx:Int, values:Float32Array):Void { - #if (js && html5 && !display) context.vertexAttrib1fv (indx, values); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib1fv (indx, values.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib1fv (indx, values); - #end } public static inline function vertexAttrib2f (indx:Int, x:Float, y:Float):Void { - #if (js && html5 && !display) context.vertexAttrib2f (indx, x, y); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_vertex_attrib2f (indx, x, y); - #end } public static inline function vertexAttrib2fv (indx:Int, values:Float32Array):Void { - #if (js && html5 && !display) context.vertexAttrib2fv (indx, values); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib2fv (indx, values.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib2fv (indx, values); - #end } public static inline function vertexAttrib3f (indx:Int, x:Float, y:Float, z:Float):Void { - #if (js && html5 && !display) context.vertexAttrib3f (indx, x, y, z); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_vertex_attrib3f (indx, x, y, z); - #end } public static inline function vertexAttrib3fv (indx:Int, values:Float32Array):Void { - #if (js && html5 && !display) context.vertexAttrib3fv (indx, values); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib3fv (indx, values.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib3fv (indx, values); - #end } public static inline function vertexAttrib4f (indx:Int, x:Float, y:Float, z:Float, w:Float):Void { - #if (js && html5 && !display) context.vertexAttrib4f (indx, x, y, z, w); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_vertex_attrib4f (indx, x, y, z, w); - #end } public static inline function vertexAttrib4fv (indx:Int, values:Float32Array):Void { - #if (js && html5 && !display) context.vertexAttrib4fv (indx, values); - #elseif (lime_cffi && !nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib4fv (indx, values.buffer); - #elseif (nodejs && lime_opengl && !macro) - lime_gl_vertex_attrib4fv (indx, values); - #end } public static inline function vertexAttribPointer (indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int):Void { - #if (js && html5 && !display) context.vertexAttribPointer (indx, size, type, normalized, stride, offset); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_vertex_attrib_pointer (indx, size, type, normalized, stride, offset); - #end } public static inline function viewport (x:Int, y:Int, width:Int, height:Int):Void { - #if (js && html5 && !display) context.viewport (x, y, width, height); - #elseif (lime_cffi && lime_opengl && !macro) - lime_gl_viewport (x, y, width, height); - #end } @@ -2217,141 +1331,4 @@ class GL { private static function get_version ():Int { return 2; } - #if (lime_cffi && lime_opengl && !macro) - @:cffi private static function lime_gl_active_texture (texture:Int):Void; - @:cffi private static function lime_gl_attach_shader (program:CFFIPointer, shader:CFFIPointer):Void; - @:cffi private static function lime_gl_bind_attrib_location (program:CFFIPointer, index:Int, name:String):Void; - @:cffi private static function lime_gl_bind_buffer (target:Int, buffer:CFFIPointer):Void; - @:cffi private static function lime_gl_bind_framebuffer (target:Int, framebuffer:CFFIPointer):Void; - @:cffi private static function lime_gl_bind_renderbuffer (target:Int, renderbuffer:CFFIPointer):Void; - @:cffi private static function lime_gl_bind_texture (target:Int, texture:CFFIPointer):Void; - @:cffi private static function lime_gl_blend_color (red:Float32, green:Float32, blue:Float32, alpha:Float32):Void; - @:cffi private static function lime_gl_blend_equation (mode:Int):Void; - @:cffi private static function lime_gl_blend_equation_separate (modeRGB:Int, modeAlpha:Int):Void; - @:cffi private static function lime_gl_blend_func (sfactor:Int, dfactor:Int):Void; - @:cffi private static function lime_gl_blend_func_separate (srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void; - @:cffi private static function lime_gl_buffer_data (target:Int, buffer:Dynamic, byteOffset:Int, size:Int, usage:Int):Void; - @:cffi private static function lime_gl_buffer_sub_data (target:Int, offset:Int, buffer:Dynamic, byteOffset:Int, size:Int):Void; - @:cffi private static function lime_gl_check_framebuffer_status (target:Int):Int; - @:cffi private static function lime_gl_clear (mask:Int):Void; - @:cffi private static function lime_gl_clear_color (red:Float32, green:Float32, blue:Float32, alpha:Float32):Void; - @:cffi private static function lime_gl_clear_depth (depth:Float32):Void; - @:cffi private static function lime_gl_clear_stencil (s:Int):Void; - @:cffi private static function lime_gl_color_mask (red:Bool, green:Bool, blue:Bool, alpha:Bool):Void; - @:cffi private static function lime_gl_compile_shader (shader:CFFIPointer):Void; - @:cffi private static function lime_gl_compressed_tex_image_2d (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, buffer:Dynamic, byteOffset:Int):Void; - @:cffi private static function lime_gl_compressed_tex_sub_image_2d (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, buffer:Dynamic, byteOffset:Int):Void; - @:cffi private static function lime_gl_copy_tex_image_2d (target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void; - @:cffi private static function lime_gl_copy_tex_sub_image_2d (target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void; - @:cffi private static function lime_gl_create_buffer ():CFFIPointer; - @:cffi private static function lime_gl_create_framebuffer ():CFFIPointer; - @:cffi private static function lime_gl_create_program ():CFFIPointer; - @:cffi private static function lime_gl_create_render_buffer ():CFFIPointer; - @:cffi private static function lime_gl_create_shader (type:Int):CFFIPointer; - @:cffi private static function lime_gl_create_texture ():CFFIPointer; - @:cffi private static function lime_gl_cull_face (mode:Int):Void; - @:cffi private static function lime_gl_delete_buffer (buffer:CFFIPointer):Void; - @:cffi private static function lime_gl_delete_framebuffer (framebuffer:CFFIPointer):Void; - @:cffi private static function lime_gl_delete_program (program:CFFIPointer):Void; - @:cffi private static function lime_gl_delete_render_buffer (renderbuffer:CFFIPointer):Void; - @:cffi private static function lime_gl_delete_shader (shader:CFFIPointer):Void; - @:cffi private static function lime_gl_delete_texture (texture:CFFIPointer):Void; - @:cffi private static function lime_gl_depth_func (func:Int):Void; - @:cffi private static function lime_gl_depth_mask (flag:Bool):Void; - @:cffi private static function lime_gl_depth_range (zNear:Float32, zFar:Float32):Void; - @:cffi private static function lime_gl_detach_shader (program:CFFIPointer, shader:CFFIPointer):Void; - @:cffi private static function lime_gl_disable (cap:Int):Void; - @:cffi private static function lime_gl_disable_vertex_attrib_array (index:Int):Void; - @:cffi private static function lime_gl_draw_arrays (mode:Int, first:Int, count:Int):Void; - @:cffi private static function lime_gl_draw_elements (mode:Int, count:Int, type:Int, offset:Int):Void; - @:cffi private static function lime_gl_enable (cap:Int):Void; - @:cffi private static function lime_gl_enable_vertex_attrib_array (index:Int):Void; - @:cffi private static function lime_gl_finish ():Void; - @:cffi private static function lime_gl_flush ():Void; - @:cffi private static function lime_gl_framebuffer_renderbuffer (target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:CFFIPointer):Void; - @:cffi private static function lime_gl_framebuffer_texture2D (target:Int, attachment:Int, textarget:Int, texture:CFFIPointer, level:Int):Void; - @:cffi private static function lime_gl_front_face (mode:Int):Void; - @:cffi private static function lime_gl_generate_mipmap (target:Int):Void; - @:cffi private static function lime_gl_get_active_attrib (program:CFFIPointer, index:Int):Dynamic; - @:cffi private static function lime_gl_get_active_uniform (program:CFFIPointer, index:Int):Dynamic; - @:cffi private static function lime_gl_get_attrib_location (program:CFFIPointer, name:String):Int; - @:cffi private static function lime_gl_get_buffer_parameter (target:Int, pname:Int):Int; - @:cffi private static function lime_gl_get_context_attributes ():Dynamic; - @:cffi private static function lime_gl_get_error ():Int; - @:cffi private static function lime_gl_get_extension (name:String):Dynamic; - @:cffi private static function lime_gl_get_framebuffer_attachment_parameter (target:Int, attachment:Int, pname:Int):Int; - @:cffi private static function lime_gl_get_parameter (pname:Int):Dynamic; - @:cffi private static function lime_gl_get_program_info_log (program:CFFIPointer):String; - @:cffi private static function lime_gl_get_program_parameter (program:CFFIPointer, pname:Int):Int; - @:cffi private static function lime_gl_get_render_buffer_parameter (target:Int, pname:Int):Int; - @:cffi private static function lime_gl_get_shader_info_log (shader:CFFIPointer):String; - @:cffi private static function lime_gl_get_shader_parameter (shader:CFFIPointer, pname:Int):Int; - @:cffi private static function lime_gl_get_shader_precision_format (shadertype:Int, precisiontype:Int):Dynamic; - @:cffi private static function lime_gl_get_shader_source (shader:CFFIPointer):Dynamic; - @:cffi private static function lime_gl_get_supported_extensions (result:Dynamic):Void; - @:cffi private static function lime_gl_get_tex_parameter (target:Int, pname:Int):Int; - @:cffi private static function lime_gl_get_uniform (program:CFFIPointer, location:Int):Dynamic; - @:cffi private static function lime_gl_get_uniform_location (program:CFFIPointer, name:String):Int; - @:cffi private static function lime_gl_get_vertex_attrib (index:Int, pname:Int):Int; - @:cffi private static function lime_gl_get_vertex_attrib_offset (index:Int, pname:Int):Int; - @:cffi private static function lime_gl_hint (target:Int, mode:Int):Void; - @:cffi private static function lime_gl_is_buffer (buffer:CFFIPointer):Bool; - @:cffi private static function lime_gl_is_enabled (cap:Int):Bool; - @:cffi private static function lime_gl_is_framebuffer (framebuffer:CFFIPointer):Bool; - @:cffi private static function lime_gl_is_program (program:CFFIPointer):Bool; - @:cffi private static function lime_gl_is_renderbuffer (renderbuffer:CFFIPointer):Bool; - @:cffi private static function lime_gl_is_shader (shader:CFFIPointer):Bool; - @:cffi private static function lime_gl_is_texture (texture:CFFIPointer):Bool; - @:cffi private static function lime_gl_line_width (width:Float32):Void; - @:cffi private static function lime_gl_link_program (program:CFFIPointer):Void; - @:cffi private static function lime_gl_pixel_storei (pname:Int, param:Int):Void; - @:cffi private static function lime_gl_polygon_offset (factor:Float32, units:Float32):Void; - @:cffi private static function lime_gl_read_pixels (x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, buffer:Dynamic, byteOffset:Int):Void; - @:cffi private static function lime_gl_renderbuffer_storage (target:Int, internalformat:Int, width:Int, height:Int):Void; - @:cffi private static function lime_gl_sample_coverage (value:Float32, invert:Bool):Void; - @:cffi private static function lime_gl_scissor (x:Int, y:Int, width:Int, height:Int):Void; - @:cffi private static function lime_gl_shader_source (shader:CFFIPointer, source:String):Void; - @:cffi private static function lime_gl_stencil_func (func:Int, ref:Int, mask:Int):Void; - @:cffi private static function lime_gl_stencil_func_separate (face:Int, func:Int, ref:Int, mask:Int):Void; - @:cffi private static function lime_gl_stencil_mask (mask:Int):Void; - @:cffi private static function lime_gl_stencil_mask_separate (face:Int, mask:Int):Void; - @:cffi private static function lime_gl_stencil_op (fail:Int, zfail:Int, zpass:Int):Void; - @:cffi private static function lime_gl_stencil_op_separate (face:Int, fail:Int, zfail:Int, zpass:Int):Void; - @:cffi private static function lime_gl_tex_image_2d (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, buffer:Dynamic, byteOffset:Int):Void; - @:cffi private static function lime_gl_tex_parameterf (target:Int, pname:Int, param:Float32):Void; - @:cffi private static function lime_gl_tex_parameteri (target:Int, pname:Int, param:Int):Void; - @:cffi private static function lime_gl_tex_sub_image_2d (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, buffer:Dynamic, byteOffset:Int):Void; - @:cffi private static function lime_gl_uniform1f (location:Int, x:Float32):Void; - @:cffi private static function lime_gl_uniform1fv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform1i (location:Int, x:Int):Void; - @:cffi private static function lime_gl_uniform1iv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform2f (location:Int, x:Float32, y:Float32):Void; - @:cffi private static function lime_gl_uniform2fv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform2i (location:Int, x:Int, y:Int):Void; - @:cffi private static function lime_gl_uniform2iv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform3f (location:Int, x:Float32, y:Float32, z:Float32):Void; - @:cffi private static function lime_gl_uniform3fv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform3i (location:Int, x:Int, y:Int, z:Int):Void; - @:cffi private static function lime_gl_uniform3iv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform4f (location:Int, x:Float32, y:Float32, z:Float32, w:Float32):Void; - @:cffi private static function lime_gl_uniform4fv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform4i (location:Int, x:Int, y:Int, z:Int, w:Int):Void; - @:cffi private static function lime_gl_uniform4iv (location:Int, v:Dynamic):Void; - @:cffi private static function lime_gl_uniform_matrix (location:Int, transpose:Bool, buffer:Dynamic, count:Int):Void; - @:cffi private static function lime_gl_use_program (program:CFFIPointer):Void; - @:cffi private static function lime_gl_validate_program (program:CFFIPointer):Void; - @:cffi private static function lime_gl_version ():String; - @:cffi private static function lime_gl_vertex_attrib1f (indx:Int, x:Float32):Void; - @:cffi private static function lime_gl_vertex_attrib1fv (indx:Int, values:Dynamic):Void; - @:cffi private static function lime_gl_vertex_attrib2f (indx:Int, x:Float32, y:Float32):Void; - @:cffi private static function lime_gl_vertex_attrib2fv (indx:Int, values:Dynamic):Void; - @:cffi private static function lime_gl_vertex_attrib3f (indx:Int, x:Float32, y:Float32, z:Float32):Void; - @:cffi private static function lime_gl_vertex_attrib3fv (indx:Int, values:Dynamic):Void; - @:cffi private static function lime_gl_vertex_attrib4f (indx:Int, x:Float32, y:Float32, z:Float32, w:Float32):Void; - @:cffi private static function lime_gl_vertex_attrib4fv (indx:Int, values:Dynamic):Void; - @:cffi private static function lime_gl_vertex_attrib_pointer (indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int):Void; - @:cffi private static function lime_gl_viewport (x:Int, y:Int, width:Int, height:Int):Void; - #end - - } \ No newline at end of file diff --git a/lime/graphics/opengl/GLES2Context.hx b/lime/graphics/opengl/GLES2Context.hx new file mode 100644 index 000000000..84ffebb90 --- /dev/null +++ b/lime/graphics/opengl/GLES2Context.hx @@ -0,0 +1,1624 @@ +package lime.graphics.opengl; + + +import lime.utils.ArrayBufferView; +import lime.utils.Float32Array; +import lime.utils.Int32Array; + + +abstract GLES2Context(GLRenderContext) from GLRenderContext to GLRenderContext { + + + public var DEPTH_BUFFER_BIT (get, never):Int; + public var STENCIL_BUFFER_BIT (get, never):Int; + public var COLOR_BUFFER_BIT (get, never):Int; + + public var POINTS (get, never):Int; + public var LINES (get, never):Int; + public var LINE_LOOP (get, never):Int; + public var LINE_STRIP (get, never):Int; + public var TRIANGLES (get, never):Int; + public var TRIANGLE_STRIP (get, never):Int; + public var TRIANGLE_FAN (get, never):Int; + + public var ZERO (get, never):Int; + public var ONE (get, never):Int; + public var SRC_COLOR (get, never):Int; + public var ONE_MINUS_SRC_COLOR (get, never):Int; + public var SRC_ALPHA (get, never):Int; + public var ONE_MINUS_SRC_ALPHA (get, never):Int; + public var DST_ALPHA (get, never):Int; + public var ONE_MINUS_DST_ALPHA (get, never):Int; + + public var DST_COLOR (get, never):Int; + public var ONE_MINUS_DST_COLOR (get, never):Int; + public var SRC_ALPHA_SATURATE (get, never):Int; + + public var FUNC_ADD (get, never):Int; + public var BLEND_EQUATION (get, never):Int; + public var BLEND_EQUATION_RGB (get, never):Int; + public var BLEND_EQUATION_ALPHA (get, never):Int; + + public var FUNC_SUBTRACT (get, never):Int; + public var FUNC_REVERSE_SUBTRACT (get, never):Int; + + public var BLEND_DST_RGB (get, never):Int; + public var BLEND_SRC_RGB (get, never):Int; + public var BLEND_DST_ALPHA (get, never):Int; + public var BLEND_SRC_ALPHA (get, never):Int; + public var CONSTANT_COLOR (get, never):Int; + public var ONE_MINUS_CONSTANT_COLOR (get, never):Int; + public var CONSTANT_ALPHA (get, never):Int; + public var ONE_MINUS_CONSTANT_ALPHA (get, never):Int; + public var BLEND_COLOR (get, never):Int; + + public var ARRAY_BUFFER (get, never):Int; + public var ELEMENT_ARRAY_BUFFER (get, never):Int; + public var ARRAY_BUFFER_BINDING (get, never):Int; + public var ELEMENT_ARRAY_BUFFER_BINDING (get, never):Int; + + public var STREAM_DRAW (get, never):Int; + public var STATIC_DRAW (get, never):Int; + public var DYNAMIC_DRAW (get, never):Int; + + public var BUFFER_SIZE (get, never):Int; + public var BUFFER_USAGE (get, never):Int; + + public var CURRENT_VERTEX_ATTRIB (get, never):Int; + + public var FRONT (get, never):Int; + public var BACK (get, never):Int; + public var FRONT_AND_BACK (get, never):Int; + + public var CULL_FACE (get, never):Int; + public var BLEND (get, never):Int; + public var DITHER (get, never):Int; + public var STENCIL_TEST (get, never):Int; + public var DEPTH_TEST (get, never):Int; + public var SCISSOR_TEST (get, never):Int; + public var POLYGON_OFFSET_FILL (get, never):Int; + public var SAMPLE_ALPHA_TO_COVERAGE (get, never):Int; + public var SAMPLE_COVERAGE (get, never):Int; + + public var NO_ERROR (get, never):Int; + public var INVALID_ENUM (get, never):Int; + public var INVALID_VALUE (get, never):Int; + public var INVALID_OPERATION (get, never):Int; + public var OUT_OF_MEMORY (get, never):Int; + + public var CW (get, never):Int; + public var CCW (get, never):Int; + + public var LINE_WIDTH (get, never):Int; + public var ALIASED_POINT_SIZE_RANGE (get, never):Int; + public var ALIASED_LINE_WIDTH_RANGE (get, never):Int; + public var CULL_FACE_MODE (get, never):Int; + public var FRONT_FACE (get, never):Int; + public var DEPTH_RANGE (get, never):Int; + public var DEPTH_WRITEMASK (get, never):Int; + public var DEPTH_CLEAR_VALUE (get, never):Int; + public var DEPTH_FUNC (get, never):Int; + public var STENCIL_CLEAR_VALUE (get, never):Int; + public var STENCIL_FUNC (get, never):Int; + public var STENCIL_FAIL (get, never):Int; + public var STENCIL_PASS_DEPTH_FAIL (get, never):Int; + public var STENCIL_PASS_DEPTH_PASS (get, never):Int; + public var STENCIL_REF (get, never):Int; + public var STENCIL_VALUE_MASK (get, never):Int; + public var STENCIL_WRITEMASK (get, never):Int; + public var STENCIL_BACK_FUNC (get, never):Int; + public var STENCIL_BACK_FAIL (get, never):Int; + public var STENCIL_BACK_PASS_DEPTH_FAIL (get, never):Int; + public var STENCIL_BACK_PASS_DEPTH_PASS (get, never):Int; + public var STENCIL_BACK_REF (get, never):Int; + public var STENCIL_BACK_VALUE_MASK (get, never):Int; + public var STENCIL_BACK_WRITEMASK (get, never):Int; + public var VIEWPORT (get, never):Int; + public var SCISSOR_BOX (get, never):Int; + + public var COLOR_CLEAR_VALUE (get, never):Int; + public var COLOR_WRITEMASK (get, never):Int; + public var UNPACK_ALIGNMENT (get, never):Int; + public var PACK_ALIGNMENT (get, never):Int; + public var MAX_TEXTURE_SIZE (get, never):Int; + public var MAX_VIEWPORT_DIMS (get, never):Int; + public var SUBPIXEL_BITS (get, never):Int; + public var RED_BITS (get, never):Int; + public var GREEN_BITS (get, never):Int; + public var BLUE_BITS (get, never):Int; + public var ALPHA_BITS (get, never):Int; + public var DEPTH_BITS (get, never):Int; + public var STENCIL_BITS (get, never):Int; + public var POLYGON_OFFSET_UNITS (get, never):Int; + + public var POLYGON_OFFSET_FACTOR (get, never):Int; + public var TEXTURE_BINDING_2D (get, never):Int; + public var SAMPLE_BUFFERS (get, never):Int; + public var SAMPLES (get, never):Int; + public var SAMPLE_COVERAGE_VALUE (get, never):Int; + public var SAMPLE_COVERAGE_INVERT (get, never):Int; + + public var COMPRESSED_TEXTURE_FORMATS (get, never):Int; + + public var DONT_CARE (get, never):Int; + public var FASTEST (get, never):Int; + public var NICEST (get, never):Int; + + public var GENERATE_MIPMAP_HINT (get, never):Int; + + public var BYTE (get, never):Int; + public var UNSIGNED_BYTE (get, never):Int; + public var SHORT (get, never):Int; + public var UNSIGNED_SHORT (get, never):Int; + public var INT (get, never):Int; + public var UNSIGNED_INT (get, never):Int; + public var FLOAT (get, never):Int; + + public var DEPTH_COMPONENT (get, never):Int; + public var ALPHA (get, never):Int; + public var RGB (get, never):Int; + public var RGBA (get, never):Int; + public var BGR_EXT (get, never):Int; + public var BGRA_EXT (get, never):Int; + public var LUMINANCE (get, never):Int; + public var LUMINANCE_ALPHA (get, never):Int; + + public var UNSIGNED_SHORT_4_4_4_4 (get, never):Int; + public var UNSIGNED_SHORT_5_5_5_1 (get, never):Int; + public var UNSIGNED_SHORT_5_6_5 (get, never):Int; + + public var FRAGMENT_SHADER (get, never):Int; + public var VERTEX_SHADER (get, never):Int; + public var MAX_VERTEX_ATTRIBS (get, never):Int; + public var MAX_VERTEX_UNIFORM_VECTORS (get, never):Int; + public var MAX_VARYING_VECTORS (get, never):Int; + public var MAX_COMBINED_TEXTURE_IMAGE_UNITS (get, never):Int; + public var MAX_VERTEX_TEXTURE_IMAGE_UNITS (get, never):Int; + public var MAX_TEXTURE_IMAGE_UNITS (get, never):Int; + public var MAX_FRAGMENT_UNIFORM_VECTORS (get, never):Int; + public var SHADER_TYPE (get, never):Int; + public var DELETE_STATUS (get, never):Int; + public var LINK_STATUS (get, never):Int; + public var VALIDATE_STATUS (get, never):Int; + public var ATTACHED_SHADERS (get, never):Int; + public var ACTIVE_UNIFORMS (get, never):Int; + public var ACTIVE_ATTRIBUTES (get, never):Int; + public var SHADING_LANGUAGE_VERSION (get, never):Int; + public var CURRENT_PROGRAM (get, never):Int; + + public var NEVER (get, never):Int; + public var LESS (get, never):Int; + public var EQUAL (get, never):Int; + public var LEQUAL (get, never):Int; + public var GREATER (get, never):Int; + public var NOTEQUAL (get, never):Int; + public var GEQUAL (get, never):Int; + public var ALWAYS (get, never):Int; + + public var KEEP (get, never):Int; + public var REPLACE (get, never):Int; + public var INCR (get, never):Int; + public var DECR (get, never):Int; + public var INVERT (get, never):Int; + public var INCR_WRAP (get, never):Int; + public var DECR_WRAP (get, never):Int; + + public var VENDOR (get, never):Int; + public var RENDERER (get, never):Int; + public var VERSION (get, never):Int; + + public var NEAREST (get, never):Int; + public var LINEAR (get, never):Int; + + public var NEAREST_MIPMAP_NEAREST (get, never):Int; + public var LINEAR_MIPMAP_NEAREST (get, never):Int; + public var NEAREST_MIPMAP_LINEAR (get, never):Int; + public var LINEAR_MIPMAP_LINEAR (get, never):Int; + + public var TEXTURE_MAG_FILTER (get, never):Int; + public var TEXTURE_MIN_FILTER (get, never):Int; + public var TEXTURE_WRAP_S (get, never):Int; + public var TEXTURE_WRAP_T (get, never):Int; + + public var TEXTURE_2D (get, never):Int; + public var TEXTURE (get, never):Int; + + public var TEXTURE_CUBE_MAP (get, never):Int; + public var TEXTURE_BINDING_CUBE_MAP (get, never):Int; + public var TEXTURE_CUBE_MAP_POSITIVE_X (get, never):Int; + public var TEXTURE_CUBE_MAP_NEGATIVE_X (get, never):Int; + public var TEXTURE_CUBE_MAP_POSITIVE_Y (get, never):Int; + public var TEXTURE_CUBE_MAP_NEGATIVE_Y (get, never):Int; + public var TEXTURE_CUBE_MAP_POSITIVE_Z (get, never):Int; + public var TEXTURE_CUBE_MAP_NEGATIVE_Z (get, never):Int; + public var MAX_CUBE_MAP_TEXTURE_SIZE (get, never):Int; + + public var TEXTURE0 (get, never):Int; + public var TEXTURE1 (get, never):Int; + public var TEXTURE2 (get, never):Int; + public var TEXTURE3 (get, never):Int; + public var TEXTURE4 (get, never):Int; + public var TEXTURE5 (get, never):Int; + public var TEXTURE6 (get, never):Int; + public var TEXTURE7 (get, never):Int; + public var TEXTURE8 (get, never):Int; + public var TEXTURE9 (get, never):Int; + public var TEXTURE10 (get, never):Int; + public var TEXTURE11 (get, never):Int; + public var TEXTURE12 (get, never):Int; + public var TEXTURE13 (get, never):Int; + public var TEXTURE14 (get, never):Int; + public var TEXTURE15 (get, never):Int; + public var TEXTURE16 (get, never):Int; + public var TEXTURE17 (get, never):Int; + public var TEXTURE18 (get, never):Int; + public var TEXTURE19 (get, never):Int; + public var TEXTURE20 (get, never):Int; + public var TEXTURE21 (get, never):Int; + public var TEXTURE22 (get, never):Int; + public var TEXTURE23 (get, never):Int; + public var TEXTURE24 (get, never):Int; + public var TEXTURE25 (get, never):Int; + public var TEXTURE26 (get, never):Int; + public var TEXTURE27 (get, never):Int; + public var TEXTURE28 (get, never):Int; + public var TEXTURE29 (get, never):Int; + public var TEXTURE30 (get, never):Int; + public var TEXTURE31 (get, never):Int; + public var ACTIVE_TEXTURE (get, never):Int; + + public var REPEAT (get, never):Int; + public var CLAMP_TO_EDGE (get, never):Int; + public var MIRRORED_REPEAT (get, never):Int; + + public var FLOAT_VEC2 (get, never):Int; + public var FLOAT_VEC3 (get, never):Int; + public var FLOAT_VEC4 (get, never):Int; + public var INT_VEC2 (get, never):Int; + public var INT_VEC3 (get, never):Int; + public var INT_VEC4 (get, never):Int; + public var BOOL (get, never):Int; + public var BOOL_VEC2 (get, never):Int; + public var BOOL_VEC3 (get, never):Int; + public var BOOL_VEC4 (get, never):Int; + public var FLOAT_MAT2 (get, never):Int; + public var FLOAT_MAT3 (get, never):Int; + public var FLOAT_MAT4 (get, never):Int; + public var SAMPLER_2D (get, never):Int; + public var SAMPLER_CUBE (get, never):Int; + + public var VERTEX_ATTRIB_ARRAY_ENABLED (get, never):Int; + public var VERTEX_ATTRIB_ARRAY_SIZE (get, never):Int; + public var VERTEX_ATTRIB_ARRAY_STRIDE (get, never):Int; + public var VERTEX_ATTRIB_ARRAY_TYPE (get, never):Int; + public var VERTEX_ATTRIB_ARRAY_NORMALIZED (get, never):Int; + public var VERTEX_ATTRIB_ARRAY_POINTER (get, never):Int; + public var VERTEX_ATTRIB_ARRAY_BUFFER_BINDING (get, never):Int; + + public var VERTEX_PROGRAM_POINT_SIZE (get, never):Int; + public var POINT_SPRITE (get, never):Int; + + public var COMPILE_STATUS (get, never):Int; + + public var LOW_FLOAT (get, never):Int; + public var MEDIUM_FLOAT (get, never):Int; + public var HIGH_FLOAT (get, never):Int; + public var LOW_INT (get, never):Int; + public var MEDIUM_INT (get, never):Int; + public var HIGH_INT (get, never):Int; + + public var FRAMEBUFFER (get, never):Int; + public var RENDERBUFFER (get, never):Int; + + public var RGBA4 (get, never):Int; + public var RGB5_A1 (get, never):Int; + public var RGB565 (get, never):Int; + public var DEPTH_COMPONENT16 (get, never):Int; + public var STENCIL_INDEX (get, never):Int; + public var STENCIL_INDEX8 (get, never):Int; + public var DEPTH_STENCIL (get, never):Int; + + public var RENDERBUFFER_WIDTH (get, never):Int; + public var RENDERBUFFER_HEIGHT (get, never):Int; + public var RENDERBUFFER_INTERNAL_FORMAT (get, never):Int; + public var RENDERBUFFER_RED_SIZE (get, never):Int; + public var RENDERBUFFER_GREEN_SIZE (get, never):Int; + public var RENDERBUFFER_BLUE_SIZE (get, never):Int; + public var RENDERBUFFER_ALPHA_SIZE (get, never):Int; + public var RENDERBUFFER_DEPTH_SIZE (get, never):Int; + public var RENDERBUFFER_STENCIL_SIZE (get, never):Int; + + public var FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE (get, never):Int; + public var FRAMEBUFFER_ATTACHMENT_OBJECT_NAME (get, never):Int; + public var FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL (get, never):Int; + public var FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE (get, never):Int; + + public var COLOR_ATTACHMENT0 (get, never):Int; + public var DEPTH_ATTACHMENT (get, never):Int; + public var STENCIL_ATTACHMENT (get, never):Int; + public var DEPTH_STENCIL_ATTACHMENT (get, never):Int; + + public var NONE (get, never):Int; + + public var FRAMEBUFFER_COMPLETE (get, never):Int; + public var FRAMEBUFFER_INCOMPLETE_ATTACHMENT (get, never):Int; + public var FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT (get, never):Int; + public var FRAMEBUFFER_INCOMPLETE_DIMENSIONS (get, never):Int; + public var FRAMEBUFFER_UNSUPPORTED (get, never):Int; + + public var FRAMEBUFFER_BINDING (get, never):Int; + public var RENDERBUFFER_BINDING (get, never):Int; + public var MAX_RENDERBUFFER_SIZE (get, never):Int; + + public var INVALID_FRAMEBUFFER_OPERATION (get, never):Int; + + public var UNPACK_FLIP_Y_WEBGL (get, never):Int; + public var UNPACK_PREMULTIPLY_ALPHA_WEBGL (get, never):Int; + public var CONTEXT_LOST_WEBGL (get, never):Int; + public var UNPACK_COLORSPACE_CONVERSION_WEBGL (get, never):Int; + public var BROWSER_DEFAULT_WEBGL (get, never):Int; + + public var version (get, never):Int; + + private inline function get_DEPTH_BUFFER_BIT ():Int { return this.DEPTH_BUFFER_BIT; } + private inline function get_STENCIL_BUFFER_BIT ():Int { return this.STENCIL_BUFFER_BIT; } + private inline function get_COLOR_BUFFER_BIT ():Int { return this.COLOR_BUFFER_BIT; } + private inline function get_POINTS ():Int { return this.POINTS; } + private inline function get_LINES ():Int { return this.LINES; } + private inline function get_LINE_LOOP ():Int { return this.LINE_LOOP; } + private inline function get_LINE_STRIP ():Int { return this.LINE_STRIP; } + private inline function get_TRIANGLES ():Int { return this.TRIANGLES; } + private inline function get_TRIANGLE_STRIP ():Int { return this.TRIANGLE_STRIP; } + private inline function get_TRIANGLE_FAN ():Int { return this.TRIANGLE_FAN; } + private inline function get_ZERO ():Int { return this.ZERO; } + private inline function get_ONE ():Int { return this.ONE; } + private inline function get_SRC_COLOR ():Int { return this.SRC_COLOR; } + private inline function get_ONE_MINUS_SRC_COLOR ():Int { return this.ONE_MINUS_SRC_COLOR; } + private inline function get_SRC_ALPHA ():Int { return this.SRC_ALPHA; } + private inline function get_ONE_MINUS_SRC_ALPHA ():Int { return this.ONE_MINUS_SRC_ALPHA; } + private inline function get_DST_ALPHA ():Int { return this.DST_ALPHA; } + private inline function get_ONE_MINUS_DST_ALPHA ():Int { return this.ONE_MINUS_DST_ALPHA; } + private inline function get_DST_COLOR ():Int { return this.DST_COLOR; } + private inline function get_ONE_MINUS_DST_COLOR ():Int { return this.ONE_MINUS_DST_COLOR; } + private inline function get_SRC_ALPHA_SATURATE ():Int { return this.SRC_ALPHA_SATURATE; } + private inline function get_FUNC_ADD ():Int { return this.FUNC_ADD; } + private inline function get_BLEND_EQUATION ():Int { return this.BLEND_EQUATION; } + private inline function get_BLEND_EQUATION_RGB ():Int { return this.BLEND_EQUATION_RGB; } + private inline function get_BLEND_EQUATION_ALPHA ():Int { return this.BLEND_EQUATION_ALPHA; } + private inline function get_FUNC_SUBTRACT ():Int { return this.FUNC_SUBTRACT; } + private inline function get_FUNC_REVERSE_SUBTRACT ():Int { return this.FUNC_REVERSE_SUBTRACT; } + private inline function get_BLEND_DST_RGB ():Int { return this.BLEND_DST_RGB; } + private inline function get_BLEND_SRC_RGB ():Int { return this.BLEND_SRC_RGB; } + private inline function get_BLEND_DST_ALPHA ():Int { return this.BLEND_DST_ALPHA; } + private inline function get_BLEND_SRC_ALPHA ():Int { return this.BLEND_SRC_ALPHA; } + private inline function get_CONSTANT_COLOR ():Int { return this.CONSTANT_COLOR; } + private inline function get_ONE_MINUS_CONSTANT_COLOR ():Int { return this.ONE_MINUS_CONSTANT_COLOR; } + private inline function get_CONSTANT_ALPHA ():Int { return this.CONSTANT_ALPHA; } + private inline function get_ONE_MINUS_CONSTANT_ALPHA ():Int { return this.ONE_MINUS_CONSTANT_ALPHA; } + private inline function get_BLEND_COLOR ():Int { return this.BLEND_COLOR; } + private inline function get_ARRAY_BUFFER ():Int { return this.ARRAY_BUFFER; } + private inline function get_ELEMENT_ARRAY_BUFFER ():Int { return this.ELEMENT_ARRAY_BUFFER; } + private inline function get_ARRAY_BUFFER_BINDING ():Int { return this.ARRAY_BUFFER_BINDING; } + private inline function get_ELEMENT_ARRAY_BUFFER_BINDING ():Int { return this.ELEMENT_ARRAY_BUFFER_BINDING; } + private inline function get_STREAM_DRAW ():Int { return this.STREAM_DRAW; } + private inline function get_STATIC_DRAW ():Int { return this.STATIC_DRAW; } + private inline function get_DYNAMIC_DRAW ():Int { return this.DYNAMIC_DRAW; } + private inline function get_BUFFER_SIZE ():Int { return this.BUFFER_SIZE; } + private inline function get_BUFFER_USAGE ():Int { return this.BUFFER_USAGE; } + private inline function get_CURRENT_VERTEX_ATTRIB ():Int { return this.CURRENT_VERTEX_ATTRIB; } + private inline function get_FRONT ():Int { return this.FRONT; } + private inline function get_BACK ():Int { return this.BACK; } + private inline function get_FRONT_AND_BACK ():Int { return this.FRONT_AND_BACK; } + private inline function get_CULL_FACE ():Int { return this.CULL_FACE; } + private inline function get_BLEND ():Int { return this.BLEND; } + private inline function get_DITHER ():Int { return this.DITHER; } + private inline function get_STENCIL_TEST ():Int { return this.STENCIL_TEST; } + private inline function get_DEPTH_TEST ():Int { return this.DEPTH_TEST; } + private inline function get_SCISSOR_TEST ():Int { return this.SCISSOR_TEST; } + private inline function get_POLYGON_OFFSET_FILL ():Int { return this.POLYGON_OFFSET_FILL; } + private inline function get_SAMPLE_ALPHA_TO_COVERAGE ():Int { return this.SAMPLE_ALPHA_TO_COVERAGE; } + private inline function get_SAMPLE_COVERAGE ():Int { return this.SAMPLE_COVERAGE; } + private inline function get_NO_ERROR ():Int { return this.NO_ERROR; } + private inline function get_INVALID_ENUM ():Int { return this.INVALID_ENUM; } + private inline function get_INVALID_VALUE ():Int { return this.INVALID_VALUE; } + private inline function get_INVALID_OPERATION ():Int { return this.INVALID_OPERATION; } + private inline function get_OUT_OF_MEMORY ():Int { return this.OUT_OF_MEMORY; } + private inline function get_CW ():Int { return this.CW; } + private inline function get_CCW ():Int { return this.CCW; } + private inline function get_LINE_WIDTH ():Int { return this.LINE_WIDTH; } + private inline function get_ALIASED_POINT_SIZE_RANGE ():Int { return this.ALIASED_POINT_SIZE_RANGE; } + private inline function get_ALIASED_LINE_WIDTH_RANGE ():Int { return this.ALIASED_LINE_WIDTH_RANGE; } + private inline function get_CULL_FACE_MODE ():Int { return this.CULL_FACE_MODE; } + private inline function get_FRONT_FACE ():Int { return this.FRONT_FACE; } + private inline function get_DEPTH_RANGE ():Int { return this.DEPTH_RANGE; } + private inline function get_DEPTH_WRITEMASK ():Int { return this.DEPTH_WRITEMASK; } + private inline function get_DEPTH_CLEAR_VALUE ():Int { return this.DEPTH_CLEAR_VALUE; } + private inline function get_DEPTH_FUNC ():Int { return this.DEPTH_FUNC; } + private inline function get_STENCIL_CLEAR_VALUE ():Int { return this.STENCIL_CLEAR_VALUE; } + private inline function get_STENCIL_FUNC ():Int { return this.STENCIL_FUNC; } + private inline function get_STENCIL_FAIL ():Int { return this.STENCIL_FAIL; } + private inline function get_STENCIL_PASS_DEPTH_FAIL ():Int { return this.STENCIL_PASS_DEPTH_FAIL; } + private inline function get_STENCIL_PASS_DEPTH_PASS ():Int { return this.STENCIL_PASS_DEPTH_PASS; } + private inline function get_STENCIL_REF ():Int { return this.STENCIL_REF; } + private inline function get_STENCIL_VALUE_MASK ():Int { return this.STENCIL_VALUE_MASK; } + private inline function get_STENCIL_WRITEMASK ():Int { return this.STENCIL_WRITEMASK; } + private inline function get_STENCIL_BACK_FUNC ():Int { return this.STENCIL_BACK_FUNC; } + private inline function get_STENCIL_BACK_FAIL ():Int { return this.STENCIL_BACK_FAIL; } + private inline function get_STENCIL_BACK_PASS_DEPTH_FAIL ():Int { return this.STENCIL_BACK_PASS_DEPTH_FAIL; } + private inline function get_STENCIL_BACK_PASS_DEPTH_PASS ():Int { return this.STENCIL_BACK_PASS_DEPTH_PASS; } + private inline function get_STENCIL_BACK_REF ():Int { return this.STENCIL_BACK_REF; } + private inline function get_STENCIL_BACK_VALUE_MASK ():Int { return this.STENCIL_BACK_VALUE_MASK; } + private inline function get_STENCIL_BACK_WRITEMASK ():Int { return this.STENCIL_BACK_WRITEMASK; } + private inline function get_VIEWPORT ():Int { return this.VIEWPORT; } + private inline function get_SCISSOR_BOX ():Int { return this.SCISSOR_BOX; } + private inline function get_COLOR_CLEAR_VALUE ():Int { return this.COLOR_CLEAR_VALUE; } + private inline function get_COLOR_WRITEMASK ():Int { return this.COLOR_WRITEMASK; } + private inline function get_UNPACK_ALIGNMENT ():Int { return this.UNPACK_ALIGNMENT; } + private inline function get_PACK_ALIGNMENT ():Int { return this.PACK_ALIGNMENT; } + private inline function get_MAX_TEXTURE_SIZE ():Int { return this.MAX_TEXTURE_SIZE; } + private inline function get_MAX_VIEWPORT_DIMS ():Int { return this.MAX_VIEWPORT_DIMS; } + private inline function get_SUBPIXEL_BITS ():Int { return this.SUBPIXEL_BITS; } + private inline function get_RED_BITS ():Int { return this.RED_BITS; } + private inline function get_GREEN_BITS ():Int { return this.GREEN_BITS; } + private inline function get_BLUE_BITS ():Int { return this.BLUE_BITS; } + private inline function get_ALPHA_BITS ():Int { return this.ALPHA_BITS; } + private inline function get_DEPTH_BITS ():Int { return this.DEPTH_BITS; } + private inline function get_STENCIL_BITS ():Int { return this.STENCIL_BITS; } + private inline function get_POLYGON_OFFSET_UNITS ():Int { return this.POLYGON_OFFSET_UNITS; } + private inline function get_POLYGON_OFFSET_FACTOR ():Int { return this.POLYGON_OFFSET_FACTOR; } + private inline function get_TEXTURE_BINDING_2D ():Int { return this.TEXTURE_BINDING_2D; } + private inline function get_SAMPLE_BUFFERS ():Int { return this.SAMPLE_BUFFERS; } + private inline function get_SAMPLES ():Int { return this.SAMPLES; } + private inline function get_SAMPLE_COVERAGE_VALUE ():Int { return this.SAMPLE_COVERAGE_VALUE; } + private inline function get_SAMPLE_COVERAGE_INVERT ():Int { return this.SAMPLE_COVERAGE_INVERT; } + private inline function get_COMPRESSED_TEXTURE_FORMATS ():Int { return this.COMPRESSED_TEXTURE_FORMATS; } + private inline function get_DONT_CARE ():Int { return this.DONT_CARE; } + private inline function get_FASTEST ():Int { return this.FASTEST; } + private inline function get_NICEST ():Int { return this.NICEST; } + private inline function get_GENERATE_MIPMAP_HINT ():Int { return this.GENERATE_MIPMAP_HINT; } + private inline function get_BYTE ():Int { return this.BYTE; } + private inline function get_UNSIGNED_BYTE ():Int { return this.UNSIGNED_BYTE; } + private inline function get_SHORT ():Int { return this.SHORT; } + private inline function get_UNSIGNED_SHORT ():Int { return this.UNSIGNED_SHORT; } + private inline function get_INT ():Int { return this.INT; } + private inline function get_UNSIGNED_INT ():Int { return this.UNSIGNED_INT; } + private inline function get_FLOAT ():Int { return this.FLOAT; } + private inline function get_DEPTH_COMPONENT ():Int { return this.DEPTH_COMPONENT; } + private inline function get_ALPHA ():Int { return this.ALPHA; } + private inline function get_RGB ():Int { return this.RGB; } + private inline function get_RGBA ():Int { return this.RGBA; } + private inline function get_BGR_EXT ():Int { return this.BGR_EXT; } + private inline function get_BGRA_EXT ():Int { return this.BGRA_EXT; } + private inline function get_LUMINANCE ():Int { return this.LUMINANCE; } + private inline function get_LUMINANCE_ALPHA ():Int { return this.LUMINANCE_ALPHA; } + private inline function get_UNSIGNED_SHORT_4_4_4_4 ():Int { return this.UNSIGNED_SHORT_4_4_4_4; } + private inline function get_UNSIGNED_SHORT_5_5_5_1 ():Int { return this.UNSIGNED_SHORT_5_5_5_1; } + private inline function get_UNSIGNED_SHORT_5_6_5 ():Int { return this.UNSIGNED_SHORT_5_6_5; } + private inline function get_FRAGMENT_SHADER ():Int { return this.FRAGMENT_SHADER; } + private inline function get_VERTEX_SHADER ():Int { return this.VERTEX_SHADER; } + private inline function get_MAX_VERTEX_ATTRIBS ():Int { return this.MAX_VERTEX_ATTRIBS; } + private inline function get_MAX_VERTEX_UNIFORM_VECTORS ():Int { return this.MAX_VERTEX_UNIFORM_VECTORS; } + private inline function get_MAX_VARYING_VECTORS ():Int { return this.MAX_VARYING_VECTORS; } + private inline function get_MAX_COMBINED_TEXTURE_IMAGE_UNITS ():Int { return this.MAX_COMBINED_TEXTURE_IMAGE_UNITS; } + private inline function get_MAX_VERTEX_TEXTURE_IMAGE_UNITS ():Int { return this.MAX_VERTEX_TEXTURE_IMAGE_UNITS; } + private inline function get_MAX_TEXTURE_IMAGE_UNITS ():Int { return this.MAX_TEXTURE_IMAGE_UNITS; } + private inline function get_MAX_FRAGMENT_UNIFORM_VECTORS ():Int { return this.MAX_FRAGMENT_UNIFORM_VECTORS; } + private inline function get_SHADER_TYPE ():Int { return this.SHADER_TYPE; } + private inline function get_DELETE_STATUS ():Int { return this.DELETE_STATUS; } + private inline function get_LINK_STATUS ():Int { return this.LINK_STATUS; } + private inline function get_VALIDATE_STATUS ():Int { return this.VALIDATE_STATUS; } + private inline function get_ATTACHED_SHADERS ():Int { return this.ATTACHED_SHADERS; } + private inline function get_ACTIVE_UNIFORMS ():Int { return this.ACTIVE_UNIFORMS; } + private inline function get_ACTIVE_ATTRIBUTES ():Int { return this.ACTIVE_ATTRIBUTES; } + private inline function get_SHADING_LANGUAGE_VERSION ():Int { return this.SHADING_LANGUAGE_VERSION; } + private inline function get_CURRENT_PROGRAM ():Int { return this.CURRENT_PROGRAM; } + private inline function get_NEVER ():Int { return this.NEVER; } + private inline function get_LESS ():Int { return this.LESS; } + private inline function get_EQUAL ():Int { return this.EQUAL; } + private inline function get_LEQUAL ():Int { return this.LEQUAL; } + private inline function get_GREATER ():Int { return this.GREATER; } + private inline function get_NOTEQUAL ():Int { return this.NOTEQUAL; } + private inline function get_GEQUAL ():Int { return this.GEQUAL; } + private inline function get_ALWAYS ():Int { return this.ALWAYS; } + private inline function get_KEEP ():Int { return this.KEEP; } + private inline function get_REPLACE ():Int { return this.REPLACE; } + private inline function get_INCR ():Int { return this.INCR; } + private inline function get_DECR ():Int { return this.DECR; } + private inline function get_INVERT ():Int { return this.INVERT; } + private inline function get_INCR_WRAP ():Int { return this.INCR_WRAP; } + private inline function get_DECR_WRAP ():Int { return this.DECR_WRAP; } + private inline function get_VENDOR ():Int { return this.VENDOR; } + private inline function get_RENDERER ():Int { return this.RENDERER; } + private inline function get_VERSION ():Int { return this.VERSION; } + private inline function get_NEAREST ():Int { return this.NEAREST; } + private inline function get_LINEAR ():Int { return this.LINEAR; } + private inline function get_NEAREST_MIPMAP_NEAREST ():Int { return this.NEAREST_MIPMAP_NEAREST; } + private inline function get_LINEAR_MIPMAP_NEAREST ():Int { return this.LINEAR_MIPMAP_NEAREST; } + private inline function get_NEAREST_MIPMAP_LINEAR ():Int { return this.NEAREST_MIPMAP_LINEAR; } + private inline function get_LINEAR_MIPMAP_LINEAR ():Int { return this.LINEAR_MIPMAP_LINEAR; } + private inline function get_TEXTURE_MAG_FILTER ():Int { return this.TEXTURE_MAG_FILTER; } + private inline function get_TEXTURE_MIN_FILTER ():Int { return this.TEXTURE_MIN_FILTER; } + private inline function get_TEXTURE_WRAP_S ():Int { return this.TEXTURE_WRAP_S; } + private inline function get_TEXTURE_WRAP_T ():Int { return this.TEXTURE_WRAP_T; } + private inline function get_TEXTURE_2D ():Int { return this.TEXTURE_2D; } + private inline function get_TEXTURE ():Int { return this.TEXTURE; } + private inline function get_TEXTURE_CUBE_MAP ():Int { return this.TEXTURE_CUBE_MAP; } + private inline function get_TEXTURE_BINDING_CUBE_MAP ():Int { return this.TEXTURE_BINDING_CUBE_MAP; } + private inline function get_TEXTURE_CUBE_MAP_POSITIVE_X ():Int { return this.TEXTURE_CUBE_MAP_POSITIVE_X; } + private inline function get_TEXTURE_CUBE_MAP_NEGATIVE_X ():Int { return this.TEXTURE_CUBE_MAP_NEGATIVE_X; } + private inline function get_TEXTURE_CUBE_MAP_POSITIVE_Y ():Int { return this.TEXTURE_CUBE_MAP_POSITIVE_Y; } + private inline function get_TEXTURE_CUBE_MAP_NEGATIVE_Y ():Int { return this.TEXTURE_CUBE_MAP_NEGATIVE_Y; } + private inline function get_TEXTURE_CUBE_MAP_POSITIVE_Z ():Int { return this.TEXTURE_CUBE_MAP_POSITIVE_Z; } + private inline function get_TEXTURE_CUBE_MAP_NEGATIVE_Z ():Int { return this.TEXTURE_CUBE_MAP_NEGATIVE_Z; } + private inline function get_MAX_CUBE_MAP_TEXTURE_SIZE ():Int { return this.MAX_CUBE_MAP_TEXTURE_SIZE; } + private inline function get_TEXTURE0 ():Int { return this.TEXTURE0; } + private inline function get_TEXTURE1 ():Int { return this.TEXTURE1; } + private inline function get_TEXTURE2 ():Int { return this.TEXTURE2; } + private inline function get_TEXTURE3 ():Int { return this.TEXTURE3; } + private inline function get_TEXTURE4 ():Int { return this.TEXTURE4; } + private inline function get_TEXTURE5 ():Int { return this.TEXTURE5; } + private inline function get_TEXTURE6 ():Int { return this.TEXTURE6; } + private inline function get_TEXTURE7 ():Int { return this.TEXTURE7; } + private inline function get_TEXTURE8 ():Int { return this.TEXTURE8; } + private inline function get_TEXTURE9 ():Int { return this.TEXTURE9; } + private inline function get_TEXTURE10 ():Int { return this.TEXTURE10; } + private inline function get_TEXTURE11 ():Int { return this.TEXTURE11; } + private inline function get_TEXTURE12 ():Int { return this.TEXTURE12; } + private inline function get_TEXTURE13 ():Int { return this.TEXTURE13; } + private inline function get_TEXTURE14 ():Int { return this.TEXTURE14; } + private inline function get_TEXTURE15 ():Int { return this.TEXTURE15; } + private inline function get_TEXTURE16 ():Int { return this.TEXTURE16; } + private inline function get_TEXTURE17 ():Int { return this.TEXTURE17; } + private inline function get_TEXTURE18 ():Int { return this.TEXTURE18; } + private inline function get_TEXTURE19 ():Int { return this.TEXTURE19; } + private inline function get_TEXTURE20 ():Int { return this.TEXTURE20; } + private inline function get_TEXTURE21 ():Int { return this.TEXTURE21; } + private inline function get_TEXTURE22 ():Int { return this.TEXTURE22; } + private inline function get_TEXTURE23 ():Int { return this.TEXTURE23; } + private inline function get_TEXTURE24 ():Int { return this.TEXTURE24; } + private inline function get_TEXTURE25 ():Int { return this.TEXTURE25; } + private inline function get_TEXTURE26 ():Int { return this.TEXTURE26; } + private inline function get_TEXTURE27 ():Int { return this.TEXTURE27; } + private inline function get_TEXTURE28 ():Int { return this.TEXTURE28; } + private inline function get_TEXTURE29 ():Int { return this.TEXTURE29; } + private inline function get_TEXTURE30 ():Int { return this.TEXTURE30; } + private inline function get_TEXTURE31 ():Int { return this.TEXTURE31; } + private inline function get_ACTIVE_TEXTURE ():Int { return this.ACTIVE_TEXTURE; } + private inline function get_REPEAT ():Int { return this.REPEAT; } + private inline function get_CLAMP_TO_EDGE ():Int { return this.CLAMP_TO_EDGE; } + private inline function get_MIRRORED_REPEAT ():Int { return this.MIRRORED_REPEAT; } + private inline function get_FLOAT_VEC2 ():Int { return this.FLOAT_VEC2; } + private inline function get_FLOAT_VEC3 ():Int { return this.FLOAT_VEC3; } + private inline function get_FLOAT_VEC4 ():Int { return this.FLOAT_VEC4; } + private inline function get_INT_VEC2 ():Int { return this.INT_VEC2; } + private inline function get_INT_VEC3 ():Int { return this.INT_VEC3; } + private inline function get_INT_VEC4 ():Int { return this.INT_VEC4; } + private inline function get_BOOL ():Int { return this.BOOL; } + private inline function get_BOOL_VEC2 ():Int { return this.BOOL_VEC2; } + private inline function get_BOOL_VEC3 ():Int { return this.BOOL_VEC3; } + private inline function get_BOOL_VEC4 ():Int { return this.BOOL_VEC4; } + private inline function get_FLOAT_MAT2 ():Int { return this.FLOAT_MAT2; } + private inline function get_FLOAT_MAT3 ():Int { return this.FLOAT_MAT3; } + private inline function get_FLOAT_MAT4 ():Int { return this.FLOAT_MAT4; } + private inline function get_SAMPLER_2D ():Int { return this.SAMPLER_2D; } + private inline function get_SAMPLER_CUBE ():Int { return this.SAMPLER_CUBE; } + private inline function get_VERTEX_ATTRIB_ARRAY_ENABLED ():Int { return this.VERTEX_ATTRIB_ARRAY_ENABLED; } + private inline function get_VERTEX_ATTRIB_ARRAY_SIZE ():Int { return this.VERTEX_ATTRIB_ARRAY_SIZE; } + private inline function get_VERTEX_ATTRIB_ARRAY_STRIDE ():Int { return this.VERTEX_ATTRIB_ARRAY_STRIDE; } + private inline function get_VERTEX_ATTRIB_ARRAY_TYPE ():Int { return this.VERTEX_ATTRIB_ARRAY_TYPE; } + private inline function get_VERTEX_ATTRIB_ARRAY_NORMALIZED ():Int { return this.VERTEX_ATTRIB_ARRAY_NORMALIZED; } + private inline function get_VERTEX_ATTRIB_ARRAY_POINTER ():Int { return this.VERTEX_ATTRIB_ARRAY_POINTER; } + private inline function get_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING ():Int { return this.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING; } + private inline function get_VERTEX_PROGRAM_POINT_SIZE ():Int { return this.VERTEX_PROGRAM_POINT_SIZE; } + private inline function get_POINT_SPRITE ():Int { return this.POINT_SPRITE; } + private inline function get_COMPILE_STATUS ():Int { return this.COMPILE_STATUS; } + private inline function get_LOW_FLOAT ():Int { return this.LOW_FLOAT; } + private inline function get_MEDIUM_FLOAT ():Int { return this.MEDIUM_FLOAT; } + private inline function get_HIGH_FLOAT ():Int { return this.HIGH_FLOAT; } + private inline function get_LOW_INT ():Int { return this.LOW_INT; } + private inline function get_MEDIUM_INT ():Int { return this.MEDIUM_INT; } + private inline function get_HIGH_INT ():Int { return this.HIGH_INT; } + private inline function get_FRAMEBUFFER ():Int { return this.FRAMEBUFFER; } + private inline function get_RENDERBUFFER ():Int { return this.RENDERBUFFER; } + private inline function get_RGBA4 ():Int { return this.RGBA4; } + private inline function get_RGB5_A1 ():Int { return this.RGB5_A1; } + private inline function get_RGB565 ():Int { return this.RGB565; } + private inline function get_DEPTH_COMPONENT16 ():Int { return this.DEPTH_COMPONENT16; } + private inline function get_STENCIL_INDEX ():Int { return this.STENCIL_INDEX; } + private inline function get_STENCIL_INDEX8 ():Int { return this.STENCIL_INDEX8; } + private inline function get_DEPTH_STENCIL ():Int { return this.DEPTH_STENCIL; } + private inline function get_RENDERBUFFER_WIDTH ():Int { return this.RENDERBUFFER_WIDTH; } + private inline function get_RENDERBUFFER_HEIGHT ():Int { return this.RENDERBUFFER_HEIGHT; } + private inline function get_RENDERBUFFER_INTERNAL_FORMAT ():Int { return this.RENDERBUFFER_INTERNAL_FORMAT; } + private inline function get_RENDERBUFFER_RED_SIZE ():Int { return this.RENDERBUFFER_RED_SIZE; } + private inline function get_RENDERBUFFER_GREEN_SIZE ():Int { return this.RENDERBUFFER_GREEN_SIZE; } + private inline function get_RENDERBUFFER_BLUE_SIZE ():Int { return this.RENDERBUFFER_BLUE_SIZE; } + private inline function get_RENDERBUFFER_ALPHA_SIZE ():Int { return this.RENDERBUFFER_ALPHA_SIZE; } + private inline function get_RENDERBUFFER_DEPTH_SIZE ():Int { return this.RENDERBUFFER_DEPTH_SIZE; } + private inline function get_RENDERBUFFER_STENCIL_SIZE ():Int { return this.RENDERBUFFER_STENCIL_SIZE; } + private inline function get_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE ():Int { return this.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE; } + private inline function get_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME ():Int { return this.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME; } + private inline function get_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL ():Int { return this.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL; } + private inline function get_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE ():Int { return this.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE; } + private inline function get_COLOR_ATTACHMENT0 ():Int { return this.COLOR_ATTACHMENT0; } + private inline function get_DEPTH_ATTACHMENT ():Int { return this.DEPTH_ATTACHMENT; } + private inline function get_STENCIL_ATTACHMENT ():Int { return this.STENCIL_ATTACHMENT; } + private inline function get_DEPTH_STENCIL_ATTACHMENT ():Int { return this.DEPTH_STENCIL_ATTACHMENT; } + private inline function get_NONE ():Int { return this.NONE; } + private inline function get_FRAMEBUFFER_COMPLETE ():Int { return this.FRAMEBUFFER_COMPLETE; } + private inline function get_FRAMEBUFFER_INCOMPLETE_ATTACHMENT ():Int { return this.FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } + private inline function get_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT ():Int { return this.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; } + private inline function get_FRAMEBUFFER_INCOMPLETE_DIMENSIONS ():Int { return this.FRAMEBUFFER_INCOMPLETE_DIMENSIONS; } + private inline function get_FRAMEBUFFER_UNSUPPORTED ():Int { return this.FRAMEBUFFER_UNSUPPORTED; } + private inline function get_FRAMEBUFFER_BINDING ():Int { return this.FRAMEBUFFER_BINDING; } + private inline function get_RENDERBUFFER_BINDING ():Int { return this.RENDERBUFFER_BINDING; } + private inline function get_MAX_RENDERBUFFER_SIZE ():Int { return this.MAX_RENDERBUFFER_SIZE; } + private inline function get_INVALID_FRAMEBUFFER_OPERATION ():Int { return this.INVALID_FRAMEBUFFER_OPERATION; } + private inline function get_UNPACK_FLIP_Y_WEBGL ():Int { return this.UNPACK_FLIP_Y_WEBGL; } + private inline function get_UNPACK_PREMULTIPLY_ALPHA_WEBGL ():Int { return this.UNPACK_PREMULTIPLY_ALPHA_WEBGL; } + private inline function get_CONTEXT_LOST_WEBGL ():Int { return this.CONTEXT_LOST_WEBGL; } + private inline function get_UNPACK_COLORSPACE_CONVERSION_WEBGL ():Int { return this.UNPACK_COLORSPACE_CONVERSION_WEBGL; } + private inline function get_BROWSER_DEFAULT_WEBGL ():Int { return this.BROWSER_DEFAULT_WEBGL; } + private inline function get_version ():Int { return this.version; } + + + public inline function activeTexture (texture:Int):Void { + + this.activeTexture (texture); + + } + + + public inline function attachShader (program:GLProgram, shader:GLShader):Void { + + this.attachShader (program, shader); + + } + + + public inline function bindAttribLocation (program:GLProgram, index:Int, name:String):Void { + + this.bindAttribLocation (program, index, name); + + } + + + public inline function bindBuffer (target:Int, buffer:GLBuffer):Void { + + this.bindBuffer (target, buffer); + + } + + + public inline function bindFramebuffer (target:Int, framebuffer:GLFramebuffer):Void { + + this.bindFramebuffer (target, framebuffer); + + } + + + public inline function bindRenderbuffer (target:Int, renderbuffer:GLRenderbuffer):Void { + + this.bindRenderbuffer (target, renderbuffer); + + } + + + public inline function bindTexture (target:Int, texture:GLTexture):Void { + + this.bindTexture (target, texture); + + } + + + public inline function blendColor (red:Float, green:Float, blue:Float, alpha:Float):Void { + + this.blendColor (red, green, blue, alpha); + + } + + + public inline function blendEquation (mode:Int):Void { + + this.blendEquation (mode); + + } + + + public inline function blendEquationSeparate (modeRGB:Int, modeAlpha:Int):Void { + + this.blendEquationSeparate (modeRGB, modeAlpha); + + } + + + public inline function blendFunc (sfactor:Int, dfactor:Int):Void { + + this.blendFunc (sfactor, dfactor); + + } + + + public inline function blendFuncSeparate (srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void { + + this.blendFuncSeparate (srcRGB, dstRGB, srcAlpha, dstAlpha); + + } + + + public inline function bufferData (target:Int, data:ArrayBufferView, usage:Int):Void { + + this.bufferData (target, data, usage); + + } + + + public inline function bufferSubData (target:Int, offset:Int, data:ArrayBufferView):Void { + + this.bufferSubData (target, offset, data); + + } + + + public inline function checkFramebufferStatus (target:Int):Int { + + return this.checkFramebufferStatus (target); + + } + + + public inline function clear (mask:Int):Void { + + this.clear (mask); + + } + + + public inline function clearColor (red:Float, green:Float, blue:Float, alpha:Float):Void { + + this.clearColor (red, green, blue, alpha); + + } + + + public inline function clearDepth (depth:Float):Void { + + this.clearDepth (depth); + + } + + + public inline function clearStencil (s:Int):Void { + + this.clearStencil (s); + + } + + + public inline function colorMask (red:Bool, green:Bool, blue:Bool, alpha:Bool):Void { + + this.colorMask (red, green, blue, alpha); + + } + + + public inline function compileShader (shader:GLShader):Void { + + this.compileShader (shader); + + } + + + public inline function compressedTexImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, data:ArrayBufferView):Void { + + this.compressedTexImage2D (target, level, internalformat, width, height, border, data); + + } + + + public inline function compressedTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, data:ArrayBufferView):Void { + + this.compressedTexSubImage2D (target, level, xoffset, yoffset, width, height, format, data); + + } + + + public inline function copyTexImage2D (target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void { + + this.copyTexImage2D (target, level, internalformat, x, y, width, height, border); + + } + + + public inline function copyTexSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void { + + this.copyTexSubImage2D (target, level, xoffset, yoffset, x, y, width, height); + + } + + + public inline function createBuffer ():GLBuffer { + + return this.createBuffer (); + + } + + + public inline function createFramebuffer ():GLFramebuffer { + + return this.createFramebuffer (); + + } + + + public inline function createProgram ():GLProgram { + + return this.createProgram (); + + } + + + public inline function createRenderbuffer ():GLRenderbuffer { + + return this.createRenderbuffer (); + + } + + + public inline function createShader (type:Int):GLShader { + + return this.createShader (type); + + } + + + public inline function createTexture ():GLTexture { + + return this.createTexture (); + + } + + + public inline function cullFace (mode:Int):Void { + + this.cullFace (mode); + + } + + + public inline function deleteBuffer (buffer:GLBuffer):Void { + + this.deleteBuffer (buffer); + + } + + + public inline function deleteFramebuffer (framebuffer:GLFramebuffer):Void { + + this.deleteFramebuffer (framebuffer); + + } + + + public inline function deleteProgram (program:GLProgram):Void { + + this.deleteProgram (program); + + } + + + public inline function deleteRenderbuffer (renderbuffer:GLRenderbuffer):Void { + + this.deleteRenderbuffer (renderbuffer); + + } + + + public inline function deleteShader (shader:GLShader):Void { + + this.deleteShader (shader); + + } + + + public inline function deleteTexture (texture:GLTexture):Void { + + this.deleteTexture (texture); + + } + + + public inline function depthFunc (func:Int):Void { + + this.depthFunc (func); + + } + + + public inline function depthMask (flag:Bool):Void { + + this.depthMask (flag); + + } + + + public inline function depthRange (zNear:Float, zFar:Float):Void { + + this.depthRange (zNear, zFar); + + } + + + public inline function detachShader (program:GLProgram, shader:GLShader):Void { + + this.detachShader (program, shader); + + } + + + public inline function disable (cap:Int):Void { + + this.disable (cap); + + } + + + public inline function disableVertexAttribArray (index:Int):Void { + + this.disableVertexAttribArray (index); + + } + + + public inline function drawArrays (mode:Int, first:Int, count:Int):Void { + + this.drawArrays (mode, first, count); + + } + + + public inline function drawElements (mode:Int, count:Int, type:Int, offset:Int):Void { + + this.drawElements (mode, count, type, offset); + + } + + + public inline function enable (cap:Int):Void { + + this.enable (cap); + + } + + + public inline function enableVertexAttribArray (index:Int):Void { + + this.enableVertexAttribArray (index); + + } + + + public inline function finish ():Void { + + this.finish (); + + } + + + public inline function flush ():Void { + + this.flush (); + + } + + + public inline function framebufferRenderbuffer (target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:GLRenderbuffer):Void { + + this.framebufferRenderbuffer (target, attachment, renderbuffertarget, renderbuffer); + + } + + + public inline function framebufferTexture2D (target:Int, attachment:Int, textarget:Int, texture:GLTexture, level:Int):Void { + + this.framebufferTexture2D (target, attachment, textarget, texture, level); + + } + + + public inline function frontFace (mode:Int):Void { + + this.frontFace (mode); + + } + + + public inline function generateMipmap (target:Int):Void { + + this.generateMipmap (target); + + } + + + public inline function getActiveAttrib (program:GLProgram, index:Int):GLActiveInfo { + + return this.getActiveAttrib (program, index); + + } + + + public inline function getActiveUniform (program:GLProgram, index:Int):GLActiveInfo { + + return this.getActiveUniform (program, index); + + } + + + public inline function getAttachedShaders (program:GLProgram):Array { + + return this.getAttachedShaders (program); + + } + + + public inline function getAttribLocation (program:GLProgram, name:String):Int { + + return this.getAttribLocation (program, name); + + } + + + public inline function getBufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { + + return this.getBufferParameter (target, pname); + + } + + + public inline function getContextAttributes ():GLContextAttributes { + + return this.getContextAttributes (); + + } + + + public inline function getError ():Int { + + return this.getError (); + + } + + + public inline function getExtension (name:String):Dynamic { + + return this.getExtension (name); + + } + + + public inline function getFramebufferAttachmentParameter (target:Int, attachment:Int, pname:Int):Int /*Dynamic*/ { + + return this.getFramebufferAttachmentParameter (target, attachment, pname); + + } + + + public inline function getParameter (pname:Int):Dynamic { + + return this.getParameter (pname); + + } + + + public inline function getProgramInfoLog (program:GLProgram):String { + + return this.getProgramInfoLog (program); + + } + + + public inline function getProgramParameter (program:GLProgram, pname:Int):Int { + + return this.getProgramParameter (program, pname); + + } + + + public inline function getRenderbufferParameter (target:Int, pname:Int):Int /*Dynamic*/ { + + return this.getRenderbufferParameter (target, pname); + + } + + + public inline function getShaderInfoLog (shader:GLShader):String { + + return this.getShaderInfoLog (shader); + + } + + + public inline function getShaderParameter (shader:GLShader, pname:Int):Int { + + return this.getShaderParameter (shader, pname); + + } + + + public inline function getShaderPrecisionFormat (shadertype:Int, precisiontype:Int):GLShaderPrecisionFormat { + + return this.getShaderPrecisionFormat (shadertype, precisiontype); + + } + + + public inline function getShaderSource (shader:GLShader):String { + + return this.getShaderSource (shader); + + } + + + public inline function getSupportedExtensions ():Array { + + return this.getSupportedExtensions (); + + } + + + public inline function getTexParameter (target:Int, pname:Int):Int /*Dynamic*/ { + + return this.getTexParameter (target, pname); + + } + + + public inline function getUniform (program:GLProgram, location:GLUniformLocation):Dynamic { + + return this.getUniform (program, location); + + } + + + public inline function getUniformLocation (program:GLProgram, name:String):GLUniformLocation { + + return this.getUniformLocation (program, name); + + } + + + public inline function getVertexAttrib (index:Int, pname:Int):Int /*Dynamic*/ { + + return this.getVertexAttrib (index, pname); + + } + + + public inline function getVertexAttribOffset (index:Int, pname:Int):Int { + + return this.getVertexAttribOffset (index, pname); + + } + + + public inline function hint (target:Int, mode:Int):Void { + + this.hint (target, mode); + + } + + + public inline function isBuffer (buffer:GLBuffer):Bool { + + return this.isBuffer (buffer); + + } + + + public inline function isContextLost ():Bool { + + return this.isContextLost (); + + } + + + public inline function isEnabled (cap:Int):Bool { + + return this.isEnabled (cap); + + } + + + public inline function isFramebuffer (framebuffer:GLFramebuffer):Bool { + + return this.isFramebuffer (framebuffer); + + } + + + public inline function isProgram (program:GLProgram):Bool { + + return this.isProgram (program); + + } + + + public inline function isRenderbuffer (renderbuffer:GLRenderbuffer):Bool { + + return this.isRenderbuffer (renderbuffer); + + } + + + public inline function isShader (shader:GLShader):Bool { + + return this.isShader (shader); + + } + + + public inline function isTexture (texture:GLTexture):Bool { + + return this.isTexture (texture); + + } + + + public inline function lineWidth (width:Float):Void { + + this.lineWidth (width); + + } + + + public inline function linkProgram (program:GLProgram):Void { + + this.linkProgram (program); + + } + + + public inline function pixelStorei (pname:Int, param:Int):Void { + + this.pixelStorei (pname, param); + + } + + + public inline function polygonOffset (factor:Float, units:Float):Void { + + this.polygonOffset (factor, units); + + } + + + public inline function readPixels (x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { + + this.readPixels (x, y, width, height, format, type, pixels); + + } + + + public inline function renderbufferStorage (target:Int, internalformat:Int, width:Int, height:Int):Void { + + this.renderbufferStorage (target, internalformat, width, height); + + } + + + public inline function sampleCoverage (value:Float, invert:Bool):Void { + + this.sampleCoverage (value, invert); + + } + + + public inline function scissor (x:Int, y:Int, width:Int, height:Int):Void { + + this.scissor (x, y, width, height); + + } + + + public inline function shaderSource (shader:GLShader, source:String):Void { + + this.shaderSource (shader, source); + + } + + + public inline function stencilFunc (func:Int, ref:Int, mask:Int):Void { + + this.stencilFunc (func, ref, mask); + + } + + + public inline function stencilFuncSeparate (face:Int, func:Int, ref:Int, mask:Int):Void { + + this.stencilFuncSeparate (face, func, ref, mask); + + } + + + public inline function stencilMask (mask:Int):Void { + + this.stencilMask (mask); + + } + + + public inline function stencilMaskSeparate (face:Int, mask:Int):Void { + + this.stencilMaskSeparate (face, mask); + + } + + + public inline function stencilOp (fail:Int, zfail:Int, zpass:Int):Void { + + this.stencilOp (fail, zfail, zpass); + + } + + + public inline function stencilOpSeparate (face:Int, fail:Int, zfail:Int, zpass:Int):Void { + + this.stencilOpSeparate (face, fail, zfail, zpass); + + } + + + public inline function texImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { + + this.texImage2D (target, level, internalformat, width, height, border, format, type, pixels); + + } + + + public inline function texParameterf (target:Int, pname:Int, param:Float):Void { + + this.texParameterf (target, pname, param); + + } + + + public inline function texParameteri (target:Int, pname:Int, param:Int):Void { + + this.texParameteri (target, pname, param); + + } + + + public inline function texSubImage2D (target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, pixels:ArrayBufferView):Void { + + this.texSubImage2D (target, level, xoffset, yoffset, width, height, format, type, pixels); + + } + + + public inline function uniform1f (location:GLUniformLocation, x:Float):Void { + + this.uniform1f (location, x); + + } + + + public inline function uniform1fv (location:GLUniformLocation, x:Float32Array):Void { + + this.uniform1fv (location, x); + + } + + + public inline function uniform1i (location:GLUniformLocation, x:Int):Void { + + this.uniform1i (location, x); + + } + + + public inline function uniform1iv (location:GLUniformLocation, v:Int32Array):Void { + + this.uniform1iv (location, v); + + } + + + public inline function uniform2f (location:GLUniformLocation, x:Float, y:Float):Void { + + this.uniform2f (location, x, y); + + } + + + public inline function uniform2fv (location:GLUniformLocation, v:Float32Array):Void { + + this.uniform2fv (location, v); + + } + + + public inline function uniform2i (location:GLUniformLocation, x:Int, y:Int):Void { + + this.uniform2i (location, x, y); + + } + + + public inline function uniform2iv (location:GLUniformLocation, v:Int32Array):Void { + + this.uniform2iv (location, v); + + } + + + public inline function uniform3f (location:GLUniformLocation, x:Float, y:Float, z:Float):Void { + + this.uniform3f (location, x, y, z); + + } + + + public inline function uniform3fv (location:GLUniformLocation, v:Float32Array):Void { + + this.uniform3fv (location, v); + + } + + + public inline function uniform3i (location:GLUniformLocation, x:Int, y:Int, z:Int):Void { + + this.uniform3i (location, x, y, z); + + } + + + public inline function uniform3iv (location:GLUniformLocation, v:Int32Array):Void { + + this.uniform3iv (location, v); + + } + + + public inline function uniform4f (location:GLUniformLocation, x:Float, y:Float, z:Float, w:Float):Void { + + this.uniform4f (location, x, y, z, w); + + } + + + public inline function uniform4fv (location:GLUniformLocation, v:Float32Array):Void { + + this.uniform4fv (location, v); + + } + + + public inline function uniform4i (location:GLUniformLocation, x:Int, y:Int, z:Int, w:Int):Void { + + this.uniform4i (location, x, y, z, w); + + } + + + public inline function uniform4iv (location:GLUniformLocation, v:Int32Array):Void { + + this.uniform4iv (location, v); + + } + + + public inline function uniformMatrix2fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { + + this.uniformMatrix2fv (location, transpose, v); + + } + + + public inline function uniformMatrix3fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { + + this.uniformMatrix3fv (location, transpose, v); + + } + + + public inline function uniformMatrix4fv (location:GLUniformLocation, transpose:Bool, v:Float32Array):Void { + + this.uniformMatrix4fv (location, transpose, v); + + } + + + /*public inline function uniformMatrix3D(location:GLUniformLocation, transpose:Bool, matrix:Matrix3D):Void { + + lime_gl_uniform_matrix(location, transpose, Float32Array.fromMatrix(matrix).getByteBuffer() , 4); + + }*/ + + + public inline function useProgram (program:GLProgram):Void { + + this.useProgram (program); + + } + + + public inline function validateProgram (program:GLProgram):Void { + + this.validateProgram (program); + + } + + + public inline function vertexAttrib1f (indx:Int, x:Float):Void { + + this.vertexAttrib1f (indx, x); + + } + + + public inline function vertexAttrib1fv (indx:Int, values:Float32Array):Void { + + this.vertexAttrib1fv (indx, values); + + } + + + public inline function vertexAttrib2f (indx:Int, x:Float, y:Float):Void { + + this.vertexAttrib2f (indx, x, y); + + } + + + public inline function vertexAttrib2fv (indx:Int, values:Float32Array):Void { + + this.vertexAttrib2fv (indx, values); + + } + + + public inline function vertexAttrib3f (indx:Int, x:Float, y:Float, z:Float):Void { + + this.vertexAttrib3f (indx, x, y, z); + + } + + + public inline function vertexAttrib3fv (indx:Int, values:Float32Array):Void { + + this.vertexAttrib3fv (indx, values); + + } + + + public inline function vertexAttrib4f (indx:Int, x:Float, y:Float, z:Float, w:Float):Void { + + this.vertexAttrib4f (indx, x, y, z, w); + + } + + + public inline function vertexAttrib4fv (indx:Int, values:Float32Array):Void { + + this.vertexAttrib4fv (indx, values); + + } + + + public inline function vertexAttribPointer (indx:Int, size:Int, type:Int, normalized:Bool, stride:Int, offset:Int):Void { + + this.vertexAttribPointer (indx, size, type, normalized, stride, offset); + + } + + + public inline function viewport (x:Int, y:Int, width:Int, height:Int):Void { + + this.viewport (x, y, width, height); + + } + + +} \ No newline at end of file diff --git a/lime/graphics/opengl/GLES3Context.hx b/lime/graphics/opengl/GLES3Context.hx new file mode 100644 index 000000000..944359099 --- /dev/null +++ b/lime/graphics/opengl/GLES3Context.hx @@ -0,0 +1,17 @@ +package lime.graphics.opengl; + + +import lime.utils.ArrayBufferView; +import lime.utils.Float32Array; +import lime.utils.Int32Array; + +@:forward() + + +abstract GLES3Context(GLES2Context) from GLES2Context to GLES2Context from GLRenderContext to GLRenderContext { + + + + + +} \ No newline at end of file