diff --git a/.gitignore b/.gitignore index 47eceb5..ad17527 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.hl +out +setup.ini +docs/theme docs/ -pages/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..188ed0e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "liblemons"] + path = liblemons + url = https://github.com/LemonsFramework/liblemons diff --git a/LICENSE b/LICENSE index f0fdee5..93a1d1d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,13 +1,21 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 +MIT License - Copyright (C) 2004 Sam Hocevar +Copyright (c) 2024 Lemons Framework - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - 0. You just DO WHAT THE FUCK YOU WANT TO. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index f590881..8c854a4 100644 --- a/README.md +++ b/README.md @@ -1,35 +1,24 @@ -> [!CAUTION] -> this repository is VERY old, and a rewrite is going to happen soon. -> -> currently, lemons is using the builtin hashlink extensions for openal, opengl and sdl etc, but they lack a lot of functionality that i want. -> -> oh also the entire redering pipeline sucks and its broken + -# (old logo) +lemons is a game framework that's built on haxe that provides.. well what a game framework should, a framework to build your games on -idk another haxe game framework smh my head +# installing -this only supports hashlink because fuck you !! +there isnt a haxelib version avalible yet so you'll have to follow the installing from github instructions -code example: +## installing from github +go to your bash shell of choice or command prompt and run -```haxe -package; - -import sys.io.File; +``` +cd +git clone --recurse-submodules https://github.com/LemonsFramework/lemons.git +cd lemons +haxelib dev . +``` +since `haxelib git` doesent recursivley clone submodules, you have to use this janky fix -import lemons.App; -import lemons.sound.Sound; +you will need to follow the building instructions at the bottom if you're installing it from github -class Main extends App { - override public function init():Void { - var sound:Sound = Sound.createFromBytes(File.getBytes('${Sys.getCwd()}\\res\\testsong.wav')); - sound.volume = 0.75; - sound.loop = true; - sound.play(); - } +# building - static public function main() - var app = new Main(); -} -``` +again, go to your bash shell of choice or command prompt and run `haxelib run lemons rebuild`. oh, and you'll have to have cmake installed. \ No newline at end of file diff --git a/art/LogoWithText.png b/art/LogoWithText.png index 9ce0d05..70f855c 100644 Binary files a/art/LogoWithText.png and b/art/LogoWithText.png differ diff --git a/art/LogoWithText.svg b/art/LogoWithText.svg index 23198f4..03453a2 100644 --- a/art/LogoWithText.svg +++ b/art/LogoWithText.svg @@ -1,8 +1,125 @@ - + + + - - - @@ -255,6 +372,11 @@ L 467 1554 156 1554 156 0 Z"/> + + + + + @@ -266,7 +388,7 @@ L 467 1554 156 1554 156 0 Z"/> -lemons +lemons @@ -274,7 +396,8 @@ L 467 1554 156 1554 156 0 Z"/> -2d game framework i think +2d game framework i think + diff --git a/art/tmpLogo.png b/art/tmpLogo.png deleted file mode 100644 index 868d5ed..0000000 Binary files a/art/tmpLogo.png and /dev/null differ diff --git a/art/tmpLogoWithText.png b/art/tmpLogoWithText.png deleted file mode 100644 index a6a79f7..0000000 Binary files a/art/tmpLogoWithText.png and /dev/null differ diff --git a/buildDox.bat b/buildDox.bat index 408db89..037dc67 100644 --- a/buildDox.bat +++ b/buildDox.bat @@ -1 +1,4 @@ -haxelib run dox -i docs --title "lemons api reference" -D version "balls" -D website "https://github.com/ThePlank/lemons" -D logo "https://cdn.discordapp.com/attachments/1083070583245373564/1162054095910207528/Untitled12_20231008154638.png" -D themeColor 0xFFFF63 -D textColor 0xFFFF63 -D description "dumb game framework" -D source-path "https://github.com/ThePlank/lemons/tree/main/src" \ No newline at end of file +rem theme will be avalible later when i finish it +haxelib run dox -i docs -o docs -theme docs/theme +cd docs/out +haxelib run snake-server \ No newline at end of file diff --git a/extraParams.hxml b/extraParams.hxml index db80b49..e930b6e 100644 --- a/extraParams.hxml +++ b/extraParams.hxml @@ -1,3 +1 @@ --lib hlsdl --lib hlopenal -lib format \ No newline at end of file diff --git a/genDocs.hxml b/genDocs.hxml index d723d4d..8844c7a 100644 --- a/genDocs.hxml +++ b/genDocs.hxml @@ -3,6 +3,6 @@ extraParams.hxml -p src -hl dummy.hl -D gen_docs +-dce no lemons - --cmd buildDox.bat \ No newline at end of file +# -cmd buildDox.bat \ No newline at end of file diff --git a/haxelib.json b/haxelib.json index db4bb48..b917114 100644 --- a/haxelib.json +++ b/haxelib.json @@ -1,17 +1,15 @@ { "name": "lemons", - "url" : "https://github.com/ThePlank/lemons/", + "url" : "https://github.com/LemonsFramework/lemons", "license": "WTFPL", "tags": ["hl"], - "description": "dumb game framework", + "description": "2d game framework i think", "version": "1.0.0", "classPath": "src/", - "releasenote": "initial release, idk what to say uuggghhh *shakes butt*", + "releasenote": "initial release", "contributors": ["ThePlank"], "dependencies": { - "format": "", - "hlsdl": "", - "hlopenal": "", - "stb_ogg_sound": "" - } + "format": "" + }, + "main": "tools.Main" } \ No newline at end of file diff --git a/resources/unknown.png b/resources/unknown.png new file mode 100644 index 0000000..e471bb6 Binary files /dev/null and b/resources/unknown.png differ diff --git a/src/hl/Format.hx b/src/hl/Format.hx deleted file mode 100644 index ee83160..0000000 --- a/src/hl/Format.hx +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C)2005-2019 Haxe Foundation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package hl; - -enum abstract PixelFormat(Int) { - var RGB = 0; - var BGR = 1; - var RGBX = 2; - var BGRX = 3; - var XBGR = 4; - var XRGB = 5; - var GRAY = 6; - var RGBA = 7; - var BGRA = 8; - var ABGR = 9; - var ARGB = 10; - var CMYK = 11; -} - -typedef OGG = hl.Abstract<"fmt_ogg">; -typedef Mp3 = hl.Abstract<"fmt_mp3">; - - -// These are the bindings for the HL `fmt.hdll` library, which contains various low level formats handling. -class Format { - // Decode JPG data into the target buffer. - @:hlNative("fmt", "jpg_decode") - public static function decodeJPG(src:hl.Bytes, srcLen:Int, dst:hl.Bytes, width:Int, height:Int, stride:Int, format:PixelFormat, flags:Int):Bool { - return false; - } - - // Decode PNG data into the target buffer. - @:hlNative("fmt", "png_decode") - public static function decodePNG(src:hl.Bytes, srcLen:Int, dst:hl.Bytes, width:Int, height:Int, stride:Int, format:PixelFormat, flags:Int):Bool { - return false; - } - - // Decode any image data into ARGB pixels - #if (hl_ver >= version("1.10.0")) - @:hlNative("fmt", "dxt_decode") - public static function decodeDXT(src:hl.Bytes, dst:hl.Bytes, width:Int, height:Int, dxtFormat:Int):Bool { - return false; - } - #end - - /** - Upscale/downscale an image. - Currently supported flag bits: 1 = bilinear filtering - **/ - @:hlNative("fmt", "img_scale") - public static function scaleImage(out:hl.Bytes, outPos:Int, outStride:Int, outWidth:Int, outHeight:Int, _in:hl.Bytes, inPos:Int, inStride:Int, - inWidth:Int, inHeight:Int, flags:Int) {} - - /** - Performs a cryptographic digest of some bytes. - 0 = Md5 , 1 = Sha1 , 2 = Crc32, 3 = Adler32 - Set 256 flag to tell the src are String bytes. - **/ - @:hlNative("fmt", "digest") - public static function digest(out:hl.Bytes, src:hl.Bytes, srcLen:Int, algorithm:Int) {} - - - // ogg - - @:hlNative("fmt", "ogg_open") - public static function openOgg(bytes:hl.Bytes, size:Int):OGG - return null; - - @:hlNative("fmt", "ogg_info") - public static function oggInfo(ogg:OGG, bitrate:hl.Ref, freq:hl.Ref, samples:hl.Ref, channels:hl.Ref):Void {} - - @:hlNative("fmt", "ogg_tell") - public static function oggTell(ogg:OGG):Int - return 0; - - @:hlNative("fmt", "ogg_seek") - public static function oggSeek(ogg:OGG, sample:Int):Bool - return false; - - @:hlNative("fmt", "ogg_read") - public static function oggRead(ogg:OGG, output:hl.Bytes, size:Int, format:Int):Int - return -1; - - // mp3 - - @:hlNative("fmt", "mp3_open") - public static function openMp3(#if (hl_ver >= "1.13.0") bytes:hl.Bytes, size:Int #end):Mp3 - return null; - - @:hlNative("fmt", "mp3_frame_info") - public static function mp3FrameInfo(mp3:Mp3, bitrate:hl.Ref, channels:hl.Ref, frameBytes:hl.Ref, hz:hl.Ref, layer:hl.Ref):Void {} - - @:hlNative("fmt", "mp3_decode_frame") - public static function mp3DecodeFrame(mp3:Mp3, bytes:hl.Bytes, size:Int, position:Int, output:hl.Bytes, outputSize:Int, offset:Int):Int - return 0; -} - -class Mikktspace { - public var buffer:hl.BytesAccess; - public var stride:Int; - public var xPos:Int; - public var normalPos:Int; - public var uvPos:Int; - public var tangents:hl.BytesAccess; - public var tangentStride:Int; - public var tangentPos:Int; - public var indexes:hl.BytesAccess; - public var indices:Int; - - public function new() {} - - public function compute(threshold = 180.) { - if (!_compute(this, threshold)) - throw "assert"; - } - - @:hlNative("fmt", "compute_mikkt_tangents") static function _compute(m:Dynamic, threshold:Float):Bool { - return false; - } -} diff --git a/src/lemons/App.hx b/src/lemons/App.hx index d058c2e..2139300 100644 --- a/src/lemons/App.hx +++ b/src/lemons/App.hx @@ -1,267 +1,55 @@ package lemons; -import sdl.GL; -import sdl.Event; -import sdl.Sdl; -import sdl.Sdl.SDLHint; -import sdl.Window; -import sdl.Event.WindowStateChange; - -import lemons.input.keyboard.KeyCode; +import lemons.display.render.Renderer; +import lemons.display.render.Window; +import lemons.display.render.GLFWWindow; import lemons.macro.DefineMacro; -import lemons.sound.Sound; -import lemons.geom.Matrix4; - -import lemons.display.Scene; -import lemons.display.Sprite; - -import lemons.util.Signal; +import lemons.Time; /** - * Entry point for every Lemons project + * entry point for every lemons project **/ class App { - - private static var _glVao:VertexArray; - private static var _glVbo:Buffer; - private static var _glEbo:Buffer; + public var renderer:Renderer; + public var window:Window; /** - * Main game window - **/ - public static var mainWindow:sdl.Window; - - /** - * A container for SDL signals - **/ - public var callbacks:WindowCallbacks; - - - public var scene:Scene; - - /** - * Creates the main window and starts the update loop, don't override this + * creates the main window and starts the update loop, don't override this **/ public function new() { - Sdl.init(); - - callbacks = new WindowCallbacks(); - - var windowSize = DefineMacro.getDefineValue('windowResolution').split(','); - mainWindow = new sdl.Window(DefineMacro.getDefineValue('windowTitle'), - Std.parseInt(windowSize[0]), Std.parseInt(windowSize[1]), 0, 0, - Window.SDL_WINDOW_SHOWN | Window.SDL_WINDOW_RESIZABLE); - mainWindow.center(); - - initBuffers(); - - #if windowVsync mainWindow.vsync = true; #end - GL.viewport(0, 0, Std.parseInt(windowSize[0]), Std.parseInt(windowSize[1])); - Sprite.projection = Matrix4.orthographic(0, Std.parseInt(windowSize[0]), Std.parseInt(windowSize[1]), 0); - - scene = new Scene(); + var rendererType:RendererType = DefineMacro.getDefineValue('renderer'); + var windowSettings = haxe.Unserializer.run(DefineMacro.getDefineValue('windowSettings')); + var gameSize = DefineMacro.getDefineValue('gameSize').split('x').map((str) -> return Std.parseInt(str)); - init(); - - var lastTime = Sys.time(); - while (true) { - var newTime = Sys.time(); - if (!Sdl.processEvents(onEvent)) break; - - update(newTime - lastTime); - scene.draw(); - mainWindow.present(); - lastTime = newTime; - if (mainWindow.vsync) Sys.sleep(1 / 60); + switch(rendererType) { + case OPENGL | VULKAN: window = new GLFWWindow(gameSize[0], gameSize[1], windowSettings.title); + default: throw 'not implemented'; } - Sound.stopEngine(); - } - - - private function initBuffers() { - var vertex:Array = [ - 1, 1, 1, 1, // top right - 1, -1, 1, 0, // bottom right - -1, -1, 0, 0, // bottom left - -1, 1, 0, 1, // top left - ]; - - var indices:Array = [ - 0, 1, 3, // first triangle - 1, 2, 3 // second triangle - ]; - - var vertexBytes = hl.Bytes.getArray(vertex); - var indiceBytes = hl.Bytes.getArray(indices); - - _glVbo = GL.createBuffer(); - _glEbo = GL.createBuffer(); - - _glVao = GL.createVertexArray(); - - GL.bindBuffer(GL.ARRAY_BUFFER, _glVbo); - GL.bufferData(GL.ARRAY_BUFFER, vertex.length * 4, vertexBytes, GL.STATIC_DRAW); + this.renderer = new Renderer(rendererType, gameSize[0], gameSize[1], window); - GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, _glEbo); - GL.bufferData(GL.ELEMENT_ARRAY_BUFFER, indices.length * 4, indiceBytes, GL.STATIC_DRAW); - - GL.bindVertexArray(_glVao); - - GL.vertexAttribPointer(0, 2, GL.FLOAT, false, 4 * 4, 0); - GL.enableVertexAttribArray(0); + init(); - GL.vertexAttribPointer(1, 2, GL.FLOAT, false, 4 * 4, 2 * 4); - GL.enableVertexAttribArray(1); + new Time().start(() -> { + update(); + final _data:RendererData = renderer.prepare(); + draw(_data); + }, this); } /** - * Called after the window gets initialized, override this when creating a new app + * called after the window gets initialized, override this when creating a new app **/ public function init():Void {} /** - * Main update function - * @param Delta time between the last update call in seconds - **/ - public function update(delta:Float):Void {} - - /** - * Called when a SDL event gets called - * @param event The SDL event in question: - **/ - @:dox(show) - private function onEvent(event:Event):Bool { - if (callbacks == null) return true; - switch (event.type) { - case Quit: callbacks.onClose.dispatch(null); - case MouseMove: callbacks.onMouseMove.dispatch({x: event.mouseX, y: event.mouseY}); - case MouseLeave: callbacks.onMouseLeave.dispatch(null); - case MouseDown: callbacks.onMouseDown.dispatch(event.button); - case MouseUp: callbacks.onMouseUp.dispatch(event.button); - case MouseWheel: callbacks.onMouseWheel.dispatch(event.wheelDelta); - case KeyDown: callbacks.onKeyDown.dispatch(event.keyCode); - case KeyUp: callbacks.onKeyUp.dispatch(event.keyCode); - case WindowState: - var targetCallback:Signal = switch(event.state) { - case Show: callbacks.onWindowShow; - case Hide: callbacks.onWindowHide; - case Expose: callbacks.onWindowExpose; - case Move: callbacks.onWindowMove; - case Resize: callbacks.onWindowResize; - case Minimize: callbacks.onWindowMinimize; - case Maximize: callbacks.onWindowMaximize; - case Restore: callbacks.onWindowRestore; - case Enter: callbacks.onWindowEnter; - case Leave: callbacks.onWindowLeave; - case Focus: callbacks.onWindowFocus; - case Blur: callbacks.onWindowBlur; - case Close: callbacks.onWindowClose; - } - targetCallback.dispatch(null); - default: - } - - return true; - } -} - -/** - * Class that holds all callbacks in SDL -**/ -@:publicFields -class WindowCallbacks { - // TODO: update Signal to allow Void as a avalible input type - - /** - * Not really a window event but it's in the event list so... - * - * Called when the game is closed - **/ - var onClose:Signal; - - // window - - /** - * Called when the window gets shown(?) idk since focus is a thing - **/ - var onWindowShow:Signal; - var onWindowHide:Signal; - var onWindowExpose:Signal; - var onWindowMove:Signal; - var onWindowResize:Signal; - var onWindowMinimize:Signal; - var onWindowMaximize:Signal; - var onWindowRestore:Signal; - var onWindowEnter:Signal; - var onWindowLeave:Signal; - var onWindowFocus:Signal; - var onWindowBlur:Signal; - var onWindowClose:Signal; - - // mouse - - /** - * Called when the mouse is moved in the window - **/ - var onMouseMove:Signal<{x:Int, y:Int}, Void>; - /** - * Called when the mouse leaves the window but i'm not sure since this has never happened to me when testing - **/ - var onMouseLeave:Signal; - /** - * Called when a mouse button is pressed - **/ - var onMouseDown:Signal; - /** - * Called when a mouse button is released - **/ - var onMouseUp:Signal; - /** - * Called when the mouse wheel gets moved - **/ - var onMouseWheel:Signal; - - // keyboard - - /** - * Called when a key is down / held down + * main update function **/ - var onKeyDown:Signal; + public function update():Void {} /** - * Called when a key is released + * main draw function **/ - var onKeyUp:Signal; - - - public function new():Void { - onClose = new Signal(); - - onWindowShow = new Signal(); - onWindowHide = new Signal(); - onWindowExpose = new Signal(); - onWindowMove = new Signal(); - onWindowResize = new Signal(); - onWindowMinimize = new Signal(); - onWindowMaximize = new Signal(); - onWindowRestore = new Signal(); - onWindowEnter = new Signal(); - onWindowLeave = new Signal(); - onWindowFocus = new Signal(); - onWindowBlur = new Signal(); - onWindowClose = new Signal(); - - onMouseMove = new Signal<{x:Int, y:Int}, Void>(); - onMouseLeave = new Signal(); - onMouseDown = new Signal(); - onMouseUp = new Signal(); - onMouseWheel = new Signal(); - - onKeyDown = new Signal(); - onKeyUp = new Signal(); - - } - -} \ No newline at end of file + public function draw(_data:RendererData):Void {} +} \ No newline at end of file diff --git a/src/lemons/Time.hx b/src/lemons/Time.hx new file mode 100644 index 0000000..54ba800 --- /dev/null +++ b/src/lemons/Time.hx @@ -0,0 +1,68 @@ +package lemons; + +/** + * time keeping singleton of lemons. contains the main loop and other variables related to timing +**/ +class Time { + /** + * instance of `Time` + **/ + public static var self(default, null):Time; + + /** + * target framerate of the game + **/ + public var fps(get, set):Int; + + /** + * time between the last frame and current frame + **/ + public var delta(default, null):Float; + + /** + * creates a new instance of `Time` + * @throws Exception `cannot have more than one main loop` when a `Time` already exists. use `Time.self` instead + **/ + public function new():Void { + if (self != null) throw 'cannot have more than one main loop'; + + self = this; + } + + var _timestamp:Float = 0; + var _delta:Float = 0; + + /** + * starts the main loop + * @param updateFunc function to call when an update happens + * @param app a `lemons.App` with an existing window + **/ + public function start(updateFunc:Void->Void, app:lemons.App) { + while (app.window.live) { + #if profiler + hl.Profile.event(-1); + #end + + final time:Float = app.window.time; + delta = time - _timestamp; + + if (delta <= _delta) Sys.sleep(_delta - delta); + + updateFunc(); + app.window.update(); + + _timestamp = time; + + #if profiler + hl.Profile.event(0); + hl.Profile.event(-2); + #end + } + } + + function get_fps():Int return Math.floor(1 / _delta); + function set_fps(fps:Int):Int { + _delta = 1 / fps; + return fps; + } +} \ No newline at end of file diff --git a/src/lemons/display/Camera.hx b/src/lemons/display/Camera.hx deleted file mode 100644 index 1bc28dd..0000000 --- a/src/lemons/display/Camera.hx +++ /dev/null @@ -1,18 +0,0 @@ -package lemons.display; - -import sdl.GL.Buffer; -import sdl.GL.VertexArray; - -class Camera extends Object { - - - public function new(x:Int, y:Int, width:Int, height:Int) { - super(x, y, width, height); - // initBuffers(); - } - - - override public function update(elapsed:Float) { - - } -} \ No newline at end of file diff --git a/src/lemons/display/Color.hx b/src/lemons/display/Color.hx new file mode 100644 index 0000000..1c5eca2 --- /dev/null +++ b/src/lemons/display/Color.hx @@ -0,0 +1,49 @@ +package lemons.display; + +/** + * abstract used to indentify colo(u)r in lemons + * the internal format for color is AARRGGBB + * TODO: right now the abstract can't reconstruct itself, so you can't just set one component of the color unless you reconstruct it +**/ +abstract Color(Int) to Int { + public var redFloat(get, never):Float; + public var greenFloat(get, never):Float; + public var blueFloat(get, never):Float; + public var alphaFloat(get, never):Float; + + public var red(get, never):Int; + public var green(get, never):Int; + public var blue(get, never):Int; + public var alpha(get, never):Int; + + @:from + static function fromInt(int:Int) { + return new Color(int); + } + + public function new(int:Int) { + this = int; + } + + function get_alpha():Int return ((this >> 24) & 0xFF); + function get_red():Int return ((this >> 16) & 0xFF); + function get_green():Int return ((this >> 8) & 0xFF); + function get_blue():Int return ((this) & 0xFF); + + function get_alphaFloat():Float return alpha / 255; + function get_redFloat():Float return red / 255; + function get_greenFloat():Float return green / 255; + function get_blueFloat():Float return blue / 255; + + function toString():String return '#' + this.hex(8); + + + // function reconstruct(r:Int, g:Int, b:Int, a:Int):Void + // this = +} + +/** + * the correct spelling of colour + * people hated that i used color primarily so this is now a typedef +**/ +typedef Colour = lemons.display.Color; \ No newline at end of file diff --git a/src/lemons/display/Group.hx b/src/lemons/display/Group.hx deleted file mode 100644 index 1062c77..0000000 --- a/src/lemons/display/Group.hx +++ /dev/null @@ -1,32 +0,0 @@ -package lemons.display; - -import lemons.display.Object; -import lemons.display.IDrawable; - -class Group extends Object implements IDrawable { - public final members:Array = []; - - public function new() { - super(0, 0, 0, 0); - } - - public function add(newMember:T):T { - if (members.contains(newMember)) return newMember; - - members.push(newMember); - return newMember; - } - - public function insert(newMember:T, index:Int):T { - if (members.contains(newMember)) return newMember; - - members.insert(index, newMember); - return newMember; - } - - public function remove(newMember:T):Bool - return members.remove(newMember); - - public function draw() - for (member in members) if (member is IDrawable) cast (member, IDrawable).draw(); -} \ No newline at end of file diff --git a/src/lemons/display/IDrawable.hx b/src/lemons/display/IDrawable.hx deleted file mode 100644 index edb601d..0000000 --- a/src/lemons/display/IDrawable.hx +++ /dev/null @@ -1,6 +0,0 @@ -package lemons.display; - -interface IDrawable { - // public var camera: - public function draw():Void; -} \ No newline at end of file diff --git a/src/lemons/display/Mesh.hx b/src/lemons/display/Mesh.hx new file mode 100644 index 0000000..adb9deb --- /dev/null +++ b/src/lemons/display/Mesh.hx @@ -0,0 +1,75 @@ +package lemons.display; + +import lemons.display.render.Buffer; + +/** + * a mesh. stores vertex, uv and indecie data +**/ +@:allow(lemons.display.render.Renderer) +class Mesh { + var _vertex:SingleBuffer; + var _indices:UIntBuffer; + + public var bufferMode(default, null):BufferUploadMode; + public var verticies(default, null):UInt; + public var length(default, null):UInt; + + var _verticies:UInt = 0; + var _length:UInt = 0; + + var _vertexArr:Array = []; + var _indecieArr:Array = []; + + public function new(bufferMode:BufferUploadMode) { + this.bufferMode = bufferMode; + _vertex = new SingleBuffer(this.bufferMode); + _indices = new UIntBuffer(this.bufferMode); + } + + public function clear() { + _vertex.clear(); + _indices.clear(); + _vertexArr = []; + _indecieArr = []; + _verticies = 0; + verticies = 0; + + _length = 0; + length = 0; + } + + public function addVertex(x:Single, y:Single, u:Single, v:Single):Int { + _vertexArr.push(x); + _vertexArr.push(y); + _vertexArr.push(0); + _vertexArr.push(u); + _vertexArr.push(v); + return _verticies++; + } + + public function makeQuad(v1:Int, v2:Int, v3:Int, v4:Int) { + _indecieArr.push(v1); + _indecieArr.push(v2); + _indecieArr.push(v3); + + _indecieArr.push(v1); + _indecieArr.push(v3); + _indecieArr.push(v4); + _length += 6; + } + + public function makeTrig(v1:Int, v2:Int, v3:Int) { + _indecieArr.push(v1); + _indecieArr.push(v2); + _indecieArr.push(v3); + _length += 3; + } + + public function finish() { + _vertex.bufferData(_vertexArr); + _indices.bufferData(_indecieArr); + verticies = _verticies; + length = _length; + } + +} \ No newline at end of file diff --git a/src/lemons/display/Object.hx b/src/lemons/display/Object.hx deleted file mode 100644 index b8dca05..0000000 --- a/src/lemons/display/Object.hx +++ /dev/null @@ -1,20 +0,0 @@ -package lemons.display; - -import lemons.geom.Vector2; - -class Object { - public var position:Vector2; - public var scale:Vector2; - public var width:Int; - public var height:Int; - public var rotation:Float = 0; - - public function new(x:Int, y:Int, width:Int, height:Int) { - this.position = new Vector2(x, y); - this.scale = new Vector2(1, 1); - this.width = width; - this.height = height; - } - - public function update(delta:Float) {} -} \ No newline at end of file diff --git a/src/lemons/display/Scene.hx b/src/lemons/display/Scene.hx deleted file mode 100644 index 917131f..0000000 --- a/src/lemons/display/Scene.hx +++ /dev/null @@ -1,6 +0,0 @@ -package lemons.display; - -import lemons.display.Object; -import lemons.display.Group; - -class Scene extends Group {} \ No newline at end of file diff --git a/src/lemons/display/Shader.hx b/src/lemons/display/Shader.hx deleted file mode 100644 index 44adc52..0000000 --- a/src/lemons/display/Shader.hx +++ /dev/null @@ -1,92 +0,0 @@ -package lemons.display; - -import sdl.GL.Shader as GLShader; -import sdl.GL.Program as GLProgram; -import sdl.GL; -import lemons.geom.Matrix4; -import lemons.display.Sprite; - -using StringTools; - -class Shader { - private static final headerTag:String = '#header'; - private static final bodyTag:String = '#body'; - - private static var vertexHeader:String = ' - #version 400 - layout (location = 0) in vec3 glPos; - layout (location = 1) in vec2 glTexPos; - uniform mat4 drawMatrix; - uniform mat4 projection; - out vec2 texPos; - '; - - private static var vertexBody:String = ' - void main(void) { - gl_Position = projection * drawMatrix * vec4(glPos, 1.0); - texPos = vec2(glTexPos.x, -glTexPos.y); - } - '; - - private static var fragmentHeader:String = ' - #version 400 - out vec4 fragColor; - in vec2 texPos; - uniform sampler2D tex; - '; - - private static var fragmentBody:String = ' - void main(void) { - vec4 texel = texture(tex, texPos); - if (texel.a == 0) { discard; } - fragColor = texel; - } - '; - - private var glProgram:GLProgram; - - public function new(?vertSource:String, ?fragSource:String) { - var vertexShader:GLShader = GL.createShader(GL.VERTEX_SHADER); - var fragShader:GLShader = GL.createShader(GL.FRAGMENT_SHADER); - - if (vertSource == null) vertSource = '#header#body'; - if (fragSource == null) fragSource = '#header#body'; - - vertSource = vertSource.replace(headerTag, vertexHeader); - fragSource = fragSource.replace(headerTag, fragmentHeader); - vertSource = vertSource.replace(bodyTag, vertexBody); - fragSource = fragSource.replace(bodyTag, fragmentBody); - - // todo: refactor - GL.shaderSource(vertexShader, vertSource); - GL.compileShader(vertexShader); - - if (!GL.getShaderParameter(vertexShader, GL.COMPILE_STATUS)) - trace('oops! shader forgored\nlog:\n${GL.getShaderInfoLog(vertexShader)}'); - - GL.shaderSource(fragShader, fragSource); - GL.compileShader(fragShader); - - if (!GL.getShaderParameter(fragShader, GL.COMPILE_STATUS)) - trace('oops! shader forgored\nlog:\n${GL.getShaderInfoLog(fragShader)}'); - - glProgram = GL.createProgram(); - GL.attachShader(glProgram, vertexShader); - GL.attachShader(glProgram, fragShader); - GL.linkProgram(glProgram); - - if (!GL.getProgramParameter(glProgram, GL.LINK_STATUS)) - trace('oops! program forgored\nlog:\n${GL.getShaderInfoLog(fragShader)}'); - - GL.deleteShader(vertexShader); - GL.deleteShader(fragShader); - } - - public function use() GL.useProgram(glProgram); - - public function setBool(name:String, value:Bool) GL.uniform1i(GL.getUniformLocation(glProgram, name), (value ? 1 : 0)); - public function setInt(name:String, value:Int) GL.uniform1i(GL.getUniformLocation(glProgram, name), value); - - public function setMatrix4(name:String, value:Matrix4) - GL.uniformMatrix4fv(GL.getUniformLocation(glProgram, name), false, value.toGLByteShit(), 0, 1); -} \ No newline at end of file diff --git a/src/lemons/display/Sprite.hx b/src/lemons/display/Sprite.hx deleted file mode 100644 index a02a3ad..0000000 --- a/src/lemons/display/Sprite.hx +++ /dev/null @@ -1,58 +0,0 @@ -package lemons.display; - -import sdl.GL; -import lemons.display.Shader; -import lemons.display.Texture; -import lemons.display.Object; -import lemons.display.IDrawable; -import lemons.geom.Matrix4; - -class Sprite extends Object implements IDrawable { - - @:allow(lemons.display.Shader) - @:allow(lemons.App) - private static var projection:Matrix4; - - public var shader:Shader; - public var texture(default, set):Texture; - - private var drawMatrix:Matrix4; - - public function new(x:Int, y:Int, ?texture:Texture) { - super(x, y, 0, 0); - this.shader = new Shader(); - this.drawMatrix = new Matrix4(); - - if (texture != null) { - width = texture.width; - height = texture.height; - this.texture = texture; - } - } - - private function set_texture(tex:Texture) { - tex.use(); - shader.use(); - shader.setInt('tex', 0); - return texture = tex; - } - - - public function draw() { - // trace('gay'); - drawMatrix.identity(); - drawMatrix.translateByVector2(position); - drawMatrix.scaleByVector2(scale); - // drawMatrix.rotateX(rotation); - @:privateAccess GL.bindBuffer(GL.ELEMENT_ARRAY_BUFFER, App._glEbo); - @:privateAccess GL.bindVertexArray(App._glVao); - - GL.activeTexture(GL.TEXTURE0); - texture.use(); - shader.use(); - shader.setMatrix4('drawMatrix', drawMatrix); - shader.setMatrix4('projection', projection); - - GL.drawElements(GL.TRIANGLES, 6, GL.UNSIGNED_INT, 0); - } -} \ No newline at end of file diff --git a/src/lemons/display/Texture.hx b/src/lemons/display/Texture.hx index 3583b83..cf1c224 100644 --- a/src/lemons/display/Texture.hx +++ b/src/lemons/display/Texture.hx @@ -1,75 +1,12 @@ package lemons.display; -import sdl.GL.Texture as GLTexture; -import sdl.GL; -import haxe.io.Bytes; -import lemons.util.IDestroyable; -import hl.Format.PixelFormat; -import format.png.Tools as PNGTools; -import format.png.Reader as PNGReader; -import haxe.io.BytesInput; -enum TextureFiltering { - LINEAR; - NEAREST_NEIGHBOUR; -} +/** + * a texture. note that this isn't the same as `Image`. `Image` is a class that holds image data at a software level, while `Texture` is at a hardware level. +**/ +@:allow(lemons.display.render.Renderer) +class Texture { + -class Texture implements IDestroyable { - private var glTexture:GLTexture; - public var data:Bytes; - public var format:PixelFormat; - public var width:Int; - public var height:Int; - - public function new(width:Int, height:Int) { - this.width = width; - this.height = height; - glTexture = GL.createTexture(); - format = RGBA; - use(); - GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_S, GL.REPEAT); - GL.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_T, GL.REPEAT); - } - - private function uploadToGL() { - use(); - GL.texImage2D(GL.TEXTURE_2D, 0, fromPixelFormat(format), width, height, 0, GL.RGBA, GL.UNSIGNED_BYTE, data); - GL.generateMipmap(GL.TEXTURE_2D); - } - - public function use() GL.bindTexture(GL.TEXTURE_2D, glTexture); - - public function destroy():Void { - data = null; - GL.deleteTexture(glTexture); - } - - public static function fromBytes(bytes:Bytes):Texture { - var tex:Texture = new Texture(0, 0); - try { - var format = PNGTools.getHeader(new PNGReader(new BytesInput(bytes)).read()); - tex.width = format.width; - tex.height = format.height; - - var daData:Bytes = Bytes.alloc(format.width * format.height); - hl.Format.decodePNG(bytes, bytes.length, daData, format.width, format.height, 0, RGBA, 0); - tex.data = daData; - tex.uploadToGL(); - } catch(e) {} - return tex; - } - - private static function fromPixelFormat(format:PixelFormat) - return switch(format) { - case RGB: GL.RGB; - - case BGR: GL.BGRA; - case BGRA: GL.BGRA; - case BGRX: GL.BGRA; - - case RGBX: GL.RGB; - case RGBA: GL.RGBA; - default: throw 'unknown pixel fomat !!'; - } } \ No newline at end of file diff --git a/src/lemons/display/render/Buffer.hx b/src/lemons/display/render/Buffer.hx new file mode 100644 index 0000000..4ae67a0 --- /dev/null +++ b/src/lemons/display/render/Buffer.hx @@ -0,0 +1,62 @@ +package lemons.display.render; + +import lemons.display.render.drivers.Driver; + +enum abstract BufferType(Int) to Int { + var VERTEX = 0; + var ELEMENT = 1; +} + +/** + * defines the buffer mode for a mesh object +**/ +enum abstract BufferUploadMode(Int) from Int to Int { + /** + * stream buffer type, ideal for changing vertex data sub-each frame + **/ + var STREAM = 0; + + /** + * Static buffer type, ideal to re-use prebuilt vertex data + **/ + var STATIC = 1; + + /** + * dynamic buffer type, ideal for occasional data updates + **/ + var DYNAMIC = 2; +} + +@:allow(lemons.display.render.Renderer) +@:generic +class Buffer implements IDestroyable { + var _nativeHandle:Int = -1; + var _needsReupload:Bool = false; + var _needsAllocation:Bool = false; + var _bufferMode:BufferUploadMode = STATIC; + + public var data(default, null):Array; + + public function new(mode:BufferUploadMode) { + _bufferMode = mode; + _needsAllocation = true; + } + + public function bufferData(arr:Array) { + data = arr.copy(); + _needsReupload = true; + } + + public function clear() { + data = []; + _needsReupload = true; + } + + public function destroy() { + data = null; + // TODO: tell the driver to delete the handle here + } +} + +typedef SingleBuffer = Buffer; +typedef UIntBuffer = Buffer; \ No newline at end of file diff --git a/src/lemons/display/render/GLFWWindow.hx b/src/lemons/display/render/GLFWWindow.hx new file mode 100644 index 0000000..f00b9b3 --- /dev/null +++ b/src/lemons/display/render/GLFWWindow.hx @@ -0,0 +1,64 @@ +package lemons.display.render; + +import lemons.display.render._internal.GLFW; +import lemons.display.render._internal.OpenGL; + +@SuppressWarnings("checkstyle:CodeSimilarity") +class GLFWWindow extends Window { + var windowHandle:NativeGLFWWindow; + static var initialized:Bool; + + public function new(width:Int, height:Int, title:String) { + super(width, height, title); + if (!initialized) + GLFW.glfwInit(); + + GLFW.glfwInitHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 3); + GLFW.glfwInitHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 3); + GLFW.glfwInitHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE); + GLFW.glfwInitHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT, OpenGL.GL_TRUE); + windowHandle = GLFW.glfwCreateWindow(width, height, title, (0:hl.I64), (0:hl.I64)); + } + + override public function close():Void {} + + override public function update():Void { + GLFW.glfwSwapBuffers(windowHandle); + GLFW.glfwPollEvents(); + } + + override function get_width():Int { + var wid = 0; + var hei = 0; + GLFW.glfwGetWindowSize(windowHandle, wid, hei); + return wid; + } + + override function get_time():Float + return GLFW.glfwGetTime(); + + override function get_height():Int { + var wid = 0; + var hei = 0; + GLFW.glfwGetWindowSize(windowHandle, wid, hei); + return hei; + } + + override function get_live():Bool + return GLFW.glfwWindowShouldClose(windowHandle) == GLFW.GLFW_FALSE; + + override function set_width(wid:Int):Int { + GLFW.glfwSetWindowSize(windowHandle, wid, height); + return width = wid; + } + + override function set_height(hei:Int):Int { + GLFW.glfwSetWindowSize(windowHandle, width, hei); + return height = hei; + } + + override function set_time(time:Float):Float{ + GLFW.glfwSetTime(time); + return time; + } +} \ No newline at end of file diff --git a/src/lemons/display/render/Renderer.hx b/src/lemons/display/render/Renderer.hx new file mode 100644 index 0000000..7a57d59 --- /dev/null +++ b/src/lemons/display/render/Renderer.hx @@ -0,0 +1,216 @@ +package lemons.display.render; + +import lemons.display.render.*; +import lemons.display.Mesh; +import lemons.display.render.Buffer; +import lemons.display.shader.Shader; +import lemons.display.shader.Program; +import lemons.display.render.drivers.*; + +enum abstract RendererType(String) from String { + var OPENGL = "OPENGL"; + var VULKAN = "VULKAN"; + var DIRECTX = "DIRECTX"; +} + +enum abstract DataType(Int) to Int { + var INT = 0; + var SINGLE = 1; +} + +/** + * holder for draw instruction data that `Renderer` should handle + * this class is obtained when using `Renderer.prepare` and passed onto all `IRenderable`s +**/ +class RendererData { + // var _area:Rect; + public var renderer:Renderer; + public var program(default, null):Program; + + var defaultProgram:Program; + + var vertexArray:Int; + + // TODO: make this start a batch and not just setup the mesh + public function startBatch(mesh:Mesh) { + renderer.checkBuffer(mesh._vertex, VERTEX); + renderer.checkBuffer(mesh._indices, ELEMENT); + + renderer.driver.selectBuffer(mesh._vertex._nativeHandle, VERTEX); + renderer.driver.selectBuffer(mesh._indices._nativeHandle, ELEMENT); + setupAttributes(defaultProgram); + + renderer.driver.selectBuffer(0, VERTEX); + } + + public function useProgram(?program:Program) { + if (program != null) renderer.checkProgram(program); + this.program = (program != null ? program : defaultProgram); + } + + public function draw(mesh:Mesh) { + renderer.driver.selectBuffer(mesh._indices._nativeHandle, ELEMENT); + renderer.driver.selectVertexArray(vertexArray); + renderer.driver.selectProgram(program._nativeHandle); + renderer.driver.drawElements(0, mesh.length); + } + + /** + * sets a area of where objects should start rendering, everything outside of this area is ignored + **/ + public function renderArea(x:Int, y:Int, width:Int, height:Int) { + + } + + public function clear() { + program = defaultProgram; + } + + public function new(renderer:Renderer) { + this.renderer = renderer; + vertexArray = renderer.driver.createVertexArray(); + + defaultProgram = new Program(); + useProgram(defaultProgram); + } + + function setupAttributes(program:Program) { + renderer.driver.selectVertexArray(vertexArray); + for (atti in 0...program.attributes.length) { + final attr = program.attributes[atti]; + renderer.driver.setupVertexArray(atti, attr.size, attr.type, attr.stride, attr.offset); + renderer.driver.toggleVertexArrayAttr(atti, true); + } + } +} + +/** + * renderer of lemons, basically a front end for the driver backends +**/ +class Renderer { + /** + * driver used to render the game + **/ + public var driver:Driver; + + /** + * window that the renderer is drawing to + **/ + public var window:Window; + + var _data:RendererData; + + /** + * creates a new `Renderer` + * @param renderer renderer type + * @param width width + * @param height height + * @param window window to render to + **/ + public function new(renderer:RendererType, width:Int, height:Int, window:Window) { + this.window = window; + + driver = switch (renderer) { + case OPENGL: new OpenGLDriver(); + default: null; + } + + driver.selectWindow(window); + var successs:Bool = driver.init(); + + if (!successs) throw 'unable to initialize driver'; + + driver.setViewport(0, 0, width, height); + + this._data = new RendererData(this); + } + + /** + * prepares the renderer to start drawing a frame + **/ + public function prepare():RendererData { + driver.prepare(); + _data.clear(); + return _data; + } + + + /** + * checks if a given `Program` needs allocation and if needed, checks both vertex and pixel shaders and compiles the program + * @param prog program to check + **/ + public function checkProgram(prog:Program) { + checkShader(prog.vertexShader); + checkShader(prog.pixelShader); + + if (!prog._needsAllocation) { + if (prog._uniformQueue != null) { + driver.selectProgram(prog._nativeHandle); + var curUniform = prog._uniformQueue; + while (curUniform != null) { + final func = switch(curUniform.type) { + case MATRIX: driver.shaderWriteMatrix; + default: throw 'not implemented'; + } + + func(prog._nativeHandle, curUniform.uniform, curUniform.value); + + curUniform = curUniform.next; + } + } + prog._uniformQueue = null; + return; + } + + if (prog._nativeHandle > -1) driver.deleteProgram(prog._nativeHandle); + + prog._nativeHandle = driver.createProgram(); + driver.addToProgram(prog._nativeHandle, prog.pixelShader._nativeHandle); + driver.addToProgram(prog._nativeHandle, prog.vertexShader._nativeHandle); + + var result = driver.compileProgram(prog._nativeHandle); + if (!result.success) throw 'shader compilation error:\n' + result.error; + + prog._needsAllocation = false; + } + + /** + * checks if a given `Shader` needs compilatrion + * @param shad shader to check + **/ + public function checkShader(shad:Shader) { + if (!shad._compiled) { + shad._nativeHandle = driver.createShader(shad.shaderType); + var result = driver.compileShader(shad._nativeHandle, shad._source); + if (!result.success) throw 'shader compilation error:\n' + result.error; + shad._compiled = true; + } + } + + public extern inline overload function checkBuffer(buf:Buffer, type:BufferType) { + if (!buf._needsAllocation && !buf._needsReupload) return; + if (buf._needsAllocation) { + buf._nativeHandle = driver.createBuffer(); + buf._needsAllocation = false; + } + + if (buf._needsReupload) { + driver.bufferData(buf._nativeHandle, type, buf.data, buf.data.length * 4, buf._bufferMode); + // TODO: error handling + buf._needsReupload = false; + } + } + + public extern inline overload function checkBuffer(buf:Buffer, type:BufferType) { + if (!buf._needsAllocation && !buf._needsReupload) return; + if (buf._needsAllocation) { + buf._nativeHandle = driver.createBuffer(); + buf._needsAllocation = false; + } + + if (buf._needsReupload) { + driver.bufferDataInt(buf._nativeHandle, type, buf.data, buf.data.length * 4, buf._bufferMode); + buf._needsReupload = false; + } + } +} \ No newline at end of file diff --git a/src/lemons/display/render/Window.hx b/src/lemons/display/render/Window.hx new file mode 100644 index 0000000..5d16f4a --- /dev/null +++ b/src/lemons/display/render/Window.hx @@ -0,0 +1,44 @@ +package lemons.display.render; + +/** + * base type for a window +**/ +class Window { + @:isVar public var width(get, set):Int; + @:isVar public var height(get, set):Int; + @:isVar public var x(get, set):Int; + @:isVar public var y(get, set):Int; + @:isVar public var title(get, set):String; + @:isVar public var minimized(get, set):Bool; + @:isVar public var maximized(get, set):Bool; + @:isVar public var live(get, never):Bool; + + @:isVar public var time(get, set):Float; + + public function new(width:Int, height:Int, title:String):Void {} + + public function close():Void {} + + public function update():Void {} + + function get_width():Int return 0; + function get_height():Int return 0; + function get_x():Int return 0; + function get_y():Int return 0; + function get_title():String return ''; + function get_minimized():Bool return false; + function get_maximized():Bool return false; + function get_live():Bool return false; + + function get_time():Float return 0; + + function set_width(_:Int):Int return 0; + function set_height(_:Int):Int return 0; + function set_x(_:Int):Int return 0; + function set_y(_:Int):Int return 0; + function set_title(_:String):String return ''; + function set_minimized(_:Bool):Bool return false; + function set_maximized(_:Bool):Bool return false; + + function set_time(_:Float):Float return 0; +} \ No newline at end of file diff --git a/src/lemons/display/render/_internal/GLFW.hx b/src/lemons/display/render/_internal/GLFW.hx new file mode 100644 index 0000000..8be9020 --- /dev/null +++ b/src/lemons/display/render/_internal/GLFW.hx @@ -0,0 +1,430 @@ +package lemons.display.render._internal; + +typedef NativeGLFWMonitor = hl.I64; +typedef NativeGLFWWindow = hl.I64; +typedef NativeGLFWCursor = hl.I64; + +@:structInit +class JoystickState { + var buttons:hl.NativeArray = new hl.NativeArray(15); + var axes:hl.NativeArray = new hl.NativeArray(6); +} + +@SuppressWarnings("checkstyle:CodeSimilarity") +@:hlNative('lemons', 'glfw_') +class GLFW { + public static final GLFW_VERSION_MAJOR:Int = 3; + public static final GLFW_VERSION_MINOR:Int = 4; + public static final GLFW_VERSION_REVISION:Int = 0; + public static final GLFW_TRUE:Int = 1; + public static final GLFW_FALSE:Int = 0; + public static final GLFW_RELEASE:Int = 0; + public static final GLFW_PRESS:Int = 1; + public static final GLFW_REPEAT:Int = 2; + public static final GLFW_HAT_CENTERED:Int = 0; + public static final GLFW_HAT_UP:Int = 1; + public static final GLFW_HAT_RIGHT:Int = 2; + public static final GLFW_HAT_DOWN:Int = 4; + public static final GLFW_HAT_LEFT:Int = 8; + public static final GLFW_HAT_RIGHT_UP:Int = (GLFW_HAT_RIGHT | GLFW_HAT_UP); + public static final GLFW_HAT_RIGHT_DOWN:Int = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN); + public static final GLFW_HAT_LEFT_UP:Int = (GLFW_HAT_LEFT | GLFW_HAT_UP); + public static final GLFW_HAT_LEFT_DOWN:Int = (GLFW_HAT_LEFT | GLFW_HAT_DOWN); + public static final GLFW_KEY_UNKNOWN:Int = -1; + public static final GLFW_KEY_SPACE:Int = 32; + public static final GLFW_KEY_APOSTROPHE:Int = 39; + public static final GLFW_KEY_COMMA:Int = 44; + public static final GLFW_KEY_MINUS:Int = 45; + public static final GLFW_KEY_PERIOD:Int = 46; + public static final GLFW_KEY_SLASH:Int = 47; + public static final GLFW_KEY_0:Int = 48; + public static final GLFW_KEY_1:Int = 49; + public static final GLFW_KEY_2:Int = 50; + public static final GLFW_KEY_3:Int = 51; + public static final GLFW_KEY_4:Int = 52; + public static final GLFW_KEY_5:Int = 53; + public static final GLFW_KEY_6:Int = 54; + public static final GLFW_KEY_7:Int = 55; + public static final GLFW_KEY_8:Int = 56; + public static final GLFW_KEY_9:Int = 57; + public static final GLFW_KEY_SEMICOLON:Int = 59; + public static final GLFW_KEY_EQUAL:Int = 61; + public static final GLFW_KEY_A:Int = 65; + public static final GLFW_KEY_B:Int = 66; + public static final GLFW_KEY_C:Int = 67; + public static final GLFW_KEY_D:Int = 68; + public static final GLFW_KEY_E:Int = 69; + public static final GLFW_KEY_F:Int = 70; + public static final GLFW_KEY_G:Int = 71; + public static final GLFW_KEY_H:Int = 72; + public static final GLFW_KEY_I:Int = 73; + public static final GLFW_KEY_J:Int = 74; + public static final GLFW_KEY_K:Int = 75; + public static final GLFW_KEY_L:Int = 76; + public static final GLFW_KEY_M:Int = 77; + public static final GLFW_KEY_N:Int = 78; + public static final GLFW_KEY_O:Int = 79; + public static final GLFW_KEY_P:Int = 80; + public static final GLFW_KEY_Q:Int = 81; + public static final GLFW_KEY_R:Int = 82; + public static final GLFW_KEY_S:Int = 83; + public static final GLFW_KEY_T:Int = 84; + public static final GLFW_KEY_U:Int = 85; + public static final GLFW_KEY_V:Int = 86; + public static final GLFW_KEY_W:Int = 87; + public static final GLFW_KEY_X:Int = 88; + public static final GLFW_KEY_Y:Int = 89; + public static final GLFW_KEY_Z:Int = 90; + public static final GLFW_KEY_LEFT_BRACKET:Int = 91; + public static final GLFW_KEY_BACKSLASH:Int = 92; + public static final GLFW_KEY_RIGHT_BRACKET:Int = 93; + public static final GLFW_KEY_GRAVE_ACCENT:Int = 96; + public static final GLFW_KEY_WORLD_1:Int = 161; + public static final GLFW_KEY_WORLD_2:Int = 162; + public static final GLFW_KEY_ESCAPE:Int = 256; + public static final GLFW_KEY_ENTER:Int = 257; + public static final GLFW_KEY_TAB:Int = 258; + public static final GLFW_KEY_BACKSPACE:Int = 259; + public static final GLFW_KEY_INSERT:Int = 260; + public static final GLFW_KEY_DELETE:Int = 261; + public static final GLFW_KEY_RIGHT:Int = 262; + public static final GLFW_KEY_LEFT:Int = 263; + public static final GLFW_KEY_DOWN:Int = 264; + public static final GLFW_KEY_UP:Int = 265; + public static final GLFW_KEY_PAGE_UP:Int = 266; + public static final GLFW_KEY_PAGE_DOWN:Int = 267; + public static final GLFW_KEY_HOME:Int = 268; + public static final GLFW_KEY_END:Int = 269; + public static final GLFW_KEY_CAPS_LOCK:Int = 280; + public static final GLFW_KEY_SCROLL_LOCK:Int = 281; + public static final GLFW_KEY_NUM_LOCK:Int = 282; + public static final GLFW_KEY_PRINT_SCREEN:Int = 283; + public static final GLFW_KEY_PAUSE:Int = 284; + public static final GLFW_KEY_F1:Int = 290; + public static final GLFW_KEY_F2:Int = 291; + public static final GLFW_KEY_F3:Int = 292; + public static final GLFW_KEY_F4:Int = 293; + public static final GLFW_KEY_F5:Int = 294; + public static final GLFW_KEY_F6:Int = 295; + public static final GLFW_KEY_F7:Int = 296; + public static final GLFW_KEY_F8:Int = 297; + public static final GLFW_KEY_F9:Int = 298; + public static final GLFW_KEY_F10:Int = 299; + public static final GLFW_KEY_F11:Int = 300; + public static final GLFW_KEY_F12:Int = 301; + public static final GLFW_KEY_F13:Int = 302; + public static final GLFW_KEY_F14:Int = 303; + public static final GLFW_KEY_F15:Int = 304; + public static final GLFW_KEY_F16:Int = 305; + public static final GLFW_KEY_F17:Int = 306; + public static final GLFW_KEY_F18:Int = 307; + public static final GLFW_KEY_F19:Int = 308; + public static final GLFW_KEY_F20:Int = 309; + public static final GLFW_KEY_F21:Int = 310; + public static final GLFW_KEY_F22:Int = 311; + public static final GLFW_KEY_F23:Int = 312; + public static final GLFW_KEY_F24:Int = 313; + public static final GLFW_KEY_F25:Int = 314; + public static final GLFW_KEY_KP_0:Int = 320; + public static final GLFW_KEY_KP_1:Int = 321; + public static final GLFW_KEY_KP_2:Int = 322; + public static final GLFW_KEY_KP_3:Int = 323; + public static final GLFW_KEY_KP_4:Int = 324; + public static final GLFW_KEY_KP_5:Int = 325; + public static final GLFW_KEY_KP_6:Int = 326; + public static final GLFW_KEY_KP_7:Int = 327; + public static final GLFW_KEY_KP_8:Int = 328; + public static final GLFW_KEY_KP_9:Int = 329; + public static final GLFW_KEY_KP_DECIMAL:Int = 330; + public static final GLFW_KEY_KP_DIVIDE:Int = 331; + public static final GLFW_KEY_KP_MULTIPLY:Int = 332; + public static final GLFW_KEY_KP_SUBTRACT:Int = 333; + public static final GLFW_KEY_KP_ADD:Int = 334; + public static final GLFW_KEY_KP_ENTER:Int = 335; + public static final GLFW_KEY_KP_EQUAL:Int = 336; + public static final GLFW_KEY_LEFT_SHIFT:Int = 340; + public static final GLFW_KEY_LEFT_CONTROL:Int = 341; + public static final GLFW_KEY_LEFT_ALT:Int = 342; + public static final GLFW_KEY_LEFT_SUPER:Int = 343; + public static final GLFW_KEY_RIGHT_SHIFT:Int = 344; + public static final GLFW_KEY_RIGHT_CONTROL:Int = 345; + public static final GLFW_KEY_RIGHT_ALT:Int = 346; + public static final GLFW_KEY_RIGHT_SUPER:Int = 347; + public static final GLFW_KEY_MENU:Int = 348; + public static final GLFW_KEY_LAST:Int = GLFW_KEY_MENU; + public static final GLFW_MOD_SHIFT:Int = 0x0001; + public static final GLFW_MOD_CONTROL:Int = 0x0002; + public static final GLFW_MOD_ALT:Int = 0x0004; + public static final GLFW_MOD_SUPER:Int = 0x0008; + public static final GLFW_MOD_CAPS_LOCK:Int = 0x0010; + public static final GLFW_MOD_NUM_LOCK:Int = 0x0020; + public static final GLFW_MOUSE_BUTTON_1:Int = 0; + public static final GLFW_MOUSE_BUTTON_2:Int = 1; + public static final GLFW_MOUSE_BUTTON_3:Int = 2; + public static final GLFW_MOUSE_BUTTON_4:Int = 3; + public static final GLFW_MOUSE_BUTTON_5:Int = 4; + public static final GLFW_MOUSE_BUTTON_6:Int = 5; + public static final GLFW_MOUSE_BUTTON_7:Int = 6; + public static final GLFW_MOUSE_BUTTON_8:Int = 7; + public static final GLFW_MOUSE_BUTTON_LAST:Int = GLFW_MOUSE_BUTTON_8; + public static final GLFW_MOUSE_BUTTON_LEFT:Int = GLFW_MOUSE_BUTTON_1; + public static final GLFW_MOUSE_BUTTON_RIGHT:Int = GLFW_MOUSE_BUTTON_2; + public static final GLFW_MOUSE_BUTTON_MIDDLE:Int = GLFW_MOUSE_BUTTON_3; + public static final GLFW_JOYSTICK_1:Int = 0; + public static final GLFW_JOYSTICK_2:Int = 1; + public static final GLFW_JOYSTICK_3:Int = 2; + public static final GLFW_JOYSTICK_4:Int = 3; + public static final GLFW_JOYSTICK_5:Int = 4; + public static final GLFW_JOYSTICK_6:Int = 5; + public static final GLFW_JOYSTICK_7:Int = 6; + public static final GLFW_JOYSTICK_8:Int = 7; + public static final GLFW_JOYSTICK_9:Int = 8; + public static final GLFW_JOYSTICK_10:Int = 9; + public static final GLFW_JOYSTICK_11:Int = 10; + public static final GLFW_JOYSTICK_12:Int = 11; + public static final GLFW_JOYSTICK_13:Int = 12; + public static final GLFW_JOYSTICK_14:Int = 13; + public static final GLFW_JOYSTICK_15:Int = 14; + public static final GLFW_JOYSTICK_16:Int = 15; + public static final GLFW_JOYSTICK_LAST:Int = GLFW_JOYSTICK_16; + public static final GLFW_GAMEPAD_BUTTON_A:Int = 0; + public static final GLFW_GAMEPAD_BUTTON_B:Int = 1; + public static final GLFW_GAMEPAD_BUTTON_X:Int = 2; + public static final GLFW_GAMEPAD_BUTTON_Y:Int = 3; + public static final GLFW_GAMEPAD_BUTTON_LEFT_BUMPER:Int = 4; + public static final GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER:Int = 5; + public static final GLFW_GAMEPAD_BUTTON_BACK:Int = 6; + public static final GLFW_GAMEPAD_BUTTON_START:Int = 7; + public static final GLFW_GAMEPAD_BUTTON_GUIDE:Int = 8; + public static final GLFW_GAMEPAD_BUTTON_LEFT_THUMB:Int = 9; + public static final GLFW_GAMEPAD_BUTTON_RIGHT_THUMB:Int = 10; + public static final GLFW_GAMEPAD_BUTTON_DPAD_UP:Int = 11; + public static final GLFW_GAMEPAD_BUTTON_DPAD_RIGHT:Int = 12; + public static final GLFW_GAMEPAD_BUTTON_DPAD_DOWN:Int = 13; + public static final GLFW_GAMEPAD_BUTTON_DPAD_LEFT:Int = 14; + public static final GLFW_GAMEPAD_BUTTON_LAST:Int = GLFW_GAMEPAD_BUTTON_DPAD_LEFT; + public static final GLFW_GAMEPAD_BUTTON_CROSS:Int = GLFW_GAMEPAD_BUTTON_A; + public static final GLFW_GAMEPAD_BUTTON_CIRCLE:Int = GLFW_GAMEPAD_BUTTON_B; + public static final GLFW_GAMEPAD_BUTTON_SQUARE:Int = GLFW_GAMEPAD_BUTTON_X; + public static final GLFW_GAMEPAD_BUTTON_TRIANGLE:Int = GLFW_GAMEPAD_BUTTON_Y; + public static final GLFW_GAMEPAD_AXIS_LEFT_X:Int = 0; + public static final GLFW_GAMEPAD_AXIS_LEFT_Y:Int = 1; + public static final GLFW_GAMEPAD_AXIS_RIGHT_X:Int = 2; + public static final GLFW_GAMEPAD_AXIS_RIGHT_Y:Int = 3; + public static final GLFW_GAMEPAD_AXIS_LEFT_TRIGGER:Int = 4; + public static final GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER:Int = 5; + public static final GLFW_GAMEPAD_AXIS_LAST:Int = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER; + public static final GLFW_NO_ERROR:Int = 0; + public static final GLFW_NOT_INITIALIZED:Int = 0x00010001; + public static final GLFW_NO_CURRENT_CONTEXT:Int = 0x00010002; + public static final GLFW_INVALID_ENUM:Int = 0x00010003; + public static final GLFW_INVALID_VALUE:Int = 0x00010004; + public static final GLFW_OUT_OF_MEMORY:Int = 0x00010005; + public static final GLFW_API_UNAVAILABLE:Int = 0x00010006; + public static final GLFW_VERSION_UNAVAILABLE:Int = 0x00010007; + public static final GLFW_PLATFORM_ERROR:Int = 0x00010008; + public static final GLFW_FORMAT_UNAVAILABLE:Int = 0x00010009; + public static final GLFW_NO_WINDOW_CONTEXT:Int = 0x0001000A; + public static final GLFW_CURSOR_UNAVAILABLE:Int = 0x0001000B; + public static final GLFW_FEATURE_UNAVAILABLE:Int = 0x0001000C; + public static final GLFW_FEATURE_UNIMPLEMENTED:Int = 0x0001000D; + public static final GLFW_PLATFORM_UNAVAILABLE:Int = 0x0001000E; + public static final GLFW_FOCUSED:Int = 0x00020001; + public static final GLFW_ICONIFIED:Int = 0x00020002; + public static final GLFW_RESIZABLE:Int = 0x00020003; + public static final GLFW_VISIBLE:Int = 0x00020004; + public static final GLFW_DECORATED:Int = 0x00020005; + public static final GLFW_AUTO_ICONIFY:Int = 0x00020006; + public static final GLFW_FLOATING:Int = 0x00020007; + public static final GLFW_MAXIMIZED:Int = 0x00020008; + public static final GLFW_CENTER_CURSOR:Int = 0x00020009; + public static final GLFW_TRANSPARENT_FRAMEBUFFER:Int = 0x0002000A; + public static final GLFW_HOVERED:Int = 0x0002000B; + public static final GLFW_FOCUS_ON_SHOW:Int = 0x0002000C; + public static final GLFW_MOUSE_PASSTHROUGH:Int = 0x0002000D; + public static final GLFW_POSITION_X:Int = 0x0002000E; + public static final GLFW_POSITION_Y:Int = 0x0002000F; + public static final GLFW_RED_BITS:Int = 0x00021001; + public static final GLFW_GREEN_BITS:Int = 0x00021002; + public static final GLFW_BLUE_BITS:Int = 0x00021003; + public static final GLFW_ALPHA_BITS:Int = 0x00021004; + public static final GLFW_DEPTH_BITS:Int = 0x00021005; + public static final GLFW_STENCIL_BITS:Int = 0x00021006; + public static final GLFW_ACCUM_RED_BITS:Int = 0x00021007; + public static final GLFW_ACCUM_GREEN_BITS:Int = 0x00021008; + public static final GLFW_ACCUM_BLUE_BITS:Int = 0x00021009; + public static final GLFW_ACCUM_ALPHA_BITS:Int = 0x0002100A; + public static final GLFW_AUX_BUFFERS:Int = 0x0002100B; + public static final GLFW_STEREO:Int = 0x0002100C; + public static final GLFW_SAMPLES:Int = 0x0002100D; + public static final GLFW_SRGB_CAPABLE:Int = 0x0002100E; + public static final GLFW_REFRESH_RATE:Int = 0x0002100F; + public static final GLFW_DOUBLEBUFFER:Int = 0x00021010; + public static final GLFW_CLIENT_API:Int = 0x00022001; + public static final GLFW_CONTEXT_VERSION_MAJOR:Int = 0x00022002; + public static final GLFW_CONTEXT_VERSION_MINOR:Int = 0x00022003; + public static final GLFW_CONTEXT_REVISION:Int = 0x00022004; + public static final GLFW_CONTEXT_ROBUSTNESS:Int = 0x00022005; + public static final GLFW_OPENGL_FORWARD_COMPAT:Int = 0x00022006; + public static final GLFW_CONTEXT_DEBUG:Int = 0x00022007; + public static final GLFW_OPENGL_DEBUG_CONTEXT:Int = GLFW_CONTEXT_DEBUG; + public static final GLFW_OPENGL_PROFILE:Int = 0x00022008; + public static final GLFW_CONTEXT_RELEASE_BEHAVIOR:Int = 0x00022009; + public static final GLFW_CONTEXT_NO_ERROR:Int = 0x0002200A; + public static final GLFW_CONTEXT_CREATION_API:Int = 0x0002200B; + public static final GLFW_SCALE_TO_MONITOR:Int = 0x0002200C; + public static final GLFW_SCALE_FRAMEBUFFER:Int = 0x0002200D; + public static final GLFW_COCOA_RETINA_FRAMEBUFFER:Int = 0x00023001; + public static final GLFW_COCOA_FRAME_NAME:Int = 0x00023002; + public static final GLFW_COCOA_GRAPHICS_SWITCHING:Int = 0x00023003; + public static final GLFW_X11_CLASS_NAME:Int = 0x00024001; + public static final GLFW_X11_INSTANCE_NAME:Int = 0x00024002; + public static final GLFW_WIN32_KEYBOARD_MENU:Int = 0x00025001; + public static final GLFW_WIN32_SHOWDEFAULT:Int = 0x00025002; + public static final GLFW_WAYLAND_APP_ID:Int = 0x00026001; + public static final GLFW_NO_API:Int = 0; + public static final GLFW_OPENGL_API:Int = 0x00030001; + public static final GLFW_OPENGL_ES_API:Int = 0x00030002; + public static final GLFW_NO_ROBUSTNESS:Int = 0; + public static final GLFW_NO_RESET_NOTIFICATION:Int = 0x00031001; + public static final GLFW_LOSE_CONTEXT_ON_RESET:Int = 0x00031002; + public static final GLFW_OPENGL_ANY_PROFILE:Int = 0; + public static final GLFW_OPENGL_CORE_PROFILE:Int = 0x00032001; + public static final GLFW_OPENGL_COMPAT_PROFILE:Int = 0x00032002; + public static final GLFW_CURSOR:Int = 0x00033001; + public static final GLFW_STICKY_KEYS:Int = 0x00033002; + public static final GLFW_STICKY_MOUSE_BUTTONS:Int = 0x00033003; + public static final GLFW_LOCK_KEY_MODS:Int = 0x00033004; + public static final GLFW_RAW_MOUSE_MOTION:Int = 0x00033005; + public static final GLFW_CURSOR_NORMAL:Int = 0x00034001; + public static final GLFW_CURSOR_HIDDEN:Int = 0x00034002; + public static final GLFW_CURSOR_DISABLED:Int = 0x00034003; + public static final GLFW_CURSOR_CAPTURED:Int = 0x00034004; + public static final GLFW_ANY_RELEASE_BEHAVIOR:Int = 0; + public static final GLFW_RELEASE_BEHAVIOR_FLUSH:Int = 0x00035001; + public static final GLFW_RELEASE_BEHAVIOR_NONE:Int = 0x00035002; + public static final GLFW_NATIVE_CONTEXT_API:Int = 0x00036001; + public static final GLFW_EGL_CONTEXT_API:Int = 0x00036002; + public static final GLFW_OSMESA_CONTEXT_API:Int = 0x00036003; + public static final GLFW_ANGLE_PLATFORM_TYPE_NONE:Int = 0x00037001; + public static final GLFW_ANGLE_PLATFORM_TYPE_OPENGL:Int = 0x00037002; + public static final GLFW_ANGLE_PLATFORM_TYPE_OPENGLES:Int = 0x00037003; + public static final GLFW_ANGLE_PLATFORM_TYPE_D3D9:Int = 0x00037004; + public static final GLFW_ANGLE_PLATFORM_TYPE_D3D11:Int = 0x00037005; + public static final GLFW_ANGLE_PLATFORM_TYPE_VULKAN:Int = 0x00037007; + public static final GLFW_ANGLE_PLATFORM_TYPE_METAL:Int = 0x00037008; + public static final GLFW_WAYLAND_PREFER_LIBDECOR:Int = 0x00038001; + public static final GLFW_WAYLAND_DISABLE_LIBDECOR:Int = 0x00038002; + public static final GLFW_ANY_POSITION:Int = 0x80000000; + public static final GLFW_ARROW_CURSOR:Int = 0x00036001; + public static final GLFW_IBEAM_CURSOR:Int = 0x00036002; + public static final GLFW_CROSSHAIR_CURSOR:Int = 0x00036003; + public static final GLFW_POINTING_HAND_CURSOR:Int = 0x00036004; + public static final GLFW_RESIZE_EW_CURSOR:Int = 0x00036005; + public static final GLFW_RESIZE_NS_CURSOR:Int = 0x00036006; + public static final GLFW_RESIZE_NWSE_CURSOR:Int = 0x00036007; + public static final GLFW_RESIZE_NESW_CURSOR:Int = 0x00036008; + public static final GLFW_RESIZE_ALL_CURSOR:Int = 0x00036009; + public static final GLFW_NOT_ALLOWED_CURSOR:Int = 0x0003600A; + public static final GLFW_HRESIZE_CURSOR:Int = GLFW_RESIZE_EW_CURSOR; + public static final GLFW_VRESIZE_CURSOR:Int = GLFW_RESIZE_NS_CURSOR; + public static final GLFW_HAND_CURSOR:Int = GLFW_POINTING_HAND_CURSOR; + public static final GLFW_CONNECTED:Int = 0x00040001; + public static final GLFW_DISCONNECTED:Int = 0x00040002; + public static final GLFW_JOYSTICK_HAT_BUTTONS:Int = 0x00050001; + public static final GLFW_ANGLE_PLATFORM_TYPE:Int = 0x00050002; + public static final GLFW_PLATFORM:Int = 0x00050003; + public static final GLFW_COCOA_CHDIR_RESOURCES:Int = 0x00051001; + public static final GLFW_COCOA_MENUBAR:Int = 0x00051002; + public static final GLFW_X11_XCB_VULKAN_SURFACE:Int = 0x00052001; + public static final GLFW_WAYLAND_LIBDECOR:Int = 0x00053001; + public static final GLFW_ANY_PLATFORM:Int = 0x00060000; + public static final GLFW_PLATFORM_WIN32:Int = 0x00060001; + public static final GLFW_PLATFORM_COCOA:Int = 0x00060002; + public static final GLFW_PLATFORM_WAYLAND:Int = 0x00060003; + public static final GLFW_PLATFORM_X11:Int = 0x00060004; + public static final GLFW_PLATFORM_NULL:Int = 0x00060005; + public static final GLFW_DONT_CARE:Int = -1; + + public static function glfwInit():Int { return 0; } + public static function glfwTerminate():Void {} + public static function glfwInitHint(hint:Int, value:Int):Void {} + public static function glfwWindowHintString(hint:Int, value:String):Void {} + public static function glfwPollEvents():Void {} + public static function glfwWaitEvents():Void {} + public static function glfwWaitEventsTimeout(timeout:hl.F64):Void {} + public static function glfwPostEmptyEvent():Void {} + public static function glfwGetTime():hl.F64 { return 0; } + public static function glfwSetTime(time:hl.F64):Void {} + public static function glfwGetTimerValue():hl.I64 { return 0; } + public static function glfwGetTimerFrequency():hl.I64 { return 0; } + public static function glfwSwapInterval(interval:Int):Void {} + public static function glfwExtensionSupported(extension:String):Int { return 0; } + + public static function glfwGetPrimaryMonitor():NativeGLFWMonitor { return 0; } + public static function glfwGetMonitorPos(monitor:NativeGLFWMonitor, xPos:hl.Ref, yPos:hl.Ref):Void {} + public static function glfwGetMonitorWorkarea(monitor:NativeGLFWMonitor, xPos:hl.Ref, yPos:hl.Ref, width:hl.Ref, height:hl.Ref):Void {} + public static function glfwGetMonitorPhysicalSize(monitor:NativeGLFWMonitor, widthMM:hl.Ref, heightMM:hl.Ref):Void {} + public static function glfwGetMonitorContentScale(monitor:NativeGLFWMonitor, xScale:hl.Ref, yScale:hl.Ref):Void {} + public static function glfwGetMonitorName(monitor:NativeGLFWMonitor):hl.Bytes { return null; } + + public static function glfwCreateWindow(width:Int, height:Int, title:String, monitor:NativeGLFWMonitor, share:NativeGLFWWindow):NativeGLFWWindow { return 0; } + public static function glfwDestroyWindow(window:NativeGLFWWindow):Void {} + public static function glfwWindowShouldClose(window:NativeGLFWWindow):Int { return 0; } + public static function glfwSetWindowShouldClose(window:NativeGLFWWindow, value:Int):Void {} + public static function glfwGetWindowTitle(window:NativeGLFWWindow):hl.Bytes { return null; } + public static function glfwSetWindowTitle(window:NativeGLFWWindow, title:String):Void {} + + public static function glfwGetWindowPos(window:NativeGLFWWindow, xPos:hl.Ref, yPos:hl.Ref):Void {} + public static function glfwSetWindowPos(window:NativeGLFWWindow, xPos:Int, yPos:Int):Void {} + public static function glfwGetWindowSize(window:NativeGLFWWindow, width:hl.Ref, height:hl.Ref):Void {} + public static function glfwSetWindowSizeLimits(window:NativeGLFWWindow, minWidth:Int, minHeight:Int, maxWidth:Int, maxHeight:Int):Void {} + public static function glfwSetWindowAspectRatio(window:NativeGLFWWindow, numer:Int, denom:Int):Void {} + public static function glfwSetWindowSize(window:NativeGLFWWindow, width:Int, height:Int):Void {} + public static function glfwGetFramebufferSize(window:NativeGLFWWindow, xPos:hl.Ref, yPos:hl.Ref):Void {} + public static function glfwGetWindowFrameSize(window:NativeGLFWWindow, left:hl.Ref, top:hl.Ref, right:hl.Ref, bottom:hl.Ref):Void {} + public static function glfwGetWindowContentScale(window:NativeGLFWWindow, xScale:hl.Ref, yScale:hl.Ref):Void {} + public static function glfwGetWindowOpacity(window:NativeGLFWWindow):hl.F32 { return 0; } + public static function glfwSetWindowOpacity(window:NativeGLFWWindow, opacity:hl.F32):Void {} + public static function glfwIconifyWindow(window:NativeGLFWWindow):Void {} + public static function glfwRestoreWindow(window:NativeGLFWWindow):Void {} + public static function glfwMaximizeWindow(window:NativeGLFWWindow):Void {} + public static function glfwShowWindow(window:NativeGLFWWindow):Void {} + public static function glfwHideWindow(window:NativeGLFWWindow):Void {} + public static function glfwFocusWindow(window:NativeGLFWWindow):Void {} + public static function glfwRequestWindowAttention(window:NativeGLFWWindow):Void {} + public static function glfwGetWindowMonitor(window:NativeGLFWWindow):NativeGLFWMonitor { return 0; } + public static function glfwSetWindowMonitor(window:NativeGLFWWindow, monitor:NativeGLFWMonitor, xPos:Int, yPos:Int, width:Int, height:Int, refreshRate:Int):Void {} + public static function glfwGetWindowAttrib(window:NativeGLFWWindow, attrib:Int):Int { return 0; } + public static function glfwSetWindowAttrib(window:NativeGLFWWindow, attrib:Int, value:Int):Void {} + public static function glfwGetInputMode(window:NativeGLFWWindow, mode:Int):Int { return 0; } + public static function glfwSetInputMode(window:NativeGLFWWindow, mode:Int, value:Int):Void {} + public static function glfwMakeContextCurrent(window:NativeGLFWWindow):Void {} + public static function glfwGetCurrentContext():NativeGLFWWindow { return 0; } + public static function glfwSetClipboardString(window:NativeGLFWWindow, string:String):Void {} + public static function glfwGetClipboardString(window:NativeGLFWWindow):hl.Bytes { return null; } + public static function glfwSwapBuffers(window:NativeGLFWWindow):Void {} + + public static function glfwCreateStandardCursor(shape:Int):NativeGLFWCursor { return 0; } + public static function glfwDestroyCursor(cursor:NativeGLFWCursor):Void {} + public static function glfwSetCursor(window:NativeGLFWWindow, cursor:NativeGLFWCursor):Void {} + public static function glfwRawMouseMotionSupported():Int { return 0; } + public static function glfwGetMouseButton(window:NativeGLFWWindow, button:Int):Int { return 0; } + public static function glfwGetCursorPos(window:NativeGLFWWindow, xPos:hl.Ref, yPos:hl.Ref):Void {} + public static function glfwSetCursorPos(window:NativeGLFWWindow, xPos:hl.F64, yPos:hl.F64):Void {} + + public static function glfwGetKeyName(key:Int, scancode:Int):hl.Bytes { return null; } + public static function glfwGetKeyScancode(key:Int):Int { return 0; } + public static function glfwGetKey(window:NativeGLFWWindow, key:Int):Int { return 0; } + + public static function glfwJoystickPresent(jid:Int):Int { return 0; } + public static function glfwGetJoystickAxes(jid:Int):hl.NativeArray { return null; } + public static function glfwGetJoystickButtons(jid:Int):hl.NativeArray { return null; } + public static function glfwGetJoystickHats(jid:Int):hl.NativeArray { return null; } + public static function glfwGetJoystickName(jid:Int):hl.Bytes { return null; } + public static function glfwGetJoystickGuid(jid:Int):hl.Bytes { return null; } + public static function glfwJoystickIsGamepad(jid:Int):Int { return 0; } + public static function glfwUpdateGamepadMappings(string:String):Int { return 0; } + public static function glfwGetGamepadName(jid:Int):hl.Bytes { return null; } + public static function glfwGetGamepadState(jid:Int, state:Dynamic):Void {} +} \ No newline at end of file diff --git a/src/lemons/display/render/_internal/OpenGL.hx b/src/lemons/display/render/_internal/OpenGL.hx new file mode 100644 index 0000000..ea91bbb --- /dev/null +++ b/src/lemons/display/render/_internal/OpenGL.hx @@ -0,0 +1,1891 @@ +/* + Generated with liblemons' GLADGenerator https://github.com/LemonsFramework/liblemons +*/ + +package lemons.display.render._internal; + +@:hlNative('lemons', 'gl_') +class OpenGL { + public static final GL_DEPTH_BUFFER_BIT:Int = 0x00000100; + public static final GL_STENCIL_BUFFER_BIT:Int = 0x00000400; + public static final GL_COLOR_BUFFER_BIT:Int = 0x00004000; + public static final GL_DYNAMIC_STORAGE_BIT:Int = 0x0100; + public static final GL_CLIENT_STORAGE_BIT:Int = 0x0200; + public static final GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT:Int = 0x00000001; + public static final GL_CONTEXT_FLAG_DEBUG_BIT:Int = 0x00000002; + public static final GL_CONTEXT_CORE_PROFILE_BIT:Int = 0x00000001; + public static final GL_CONTEXT_COMPATIBILITY_PROFILE_BIT:Int = 0x00000002; + public static final GL_MAP_READ_BIT:Int = 0x0001; + public static final GL_MAP_WRITE_BIT:Int = 0x0002; + public static final GL_MAP_INVALIDATE_RANGE_BIT:Int = 0x0004; + public static final GL_MAP_INVALIDATE_BUFFER_BIT:Int = 0x0008; + public static final GL_MAP_FLUSH_EXPLICIT_BIT:Int = 0x0010; + public static final GL_MAP_UNSYNCHRONIZED_BIT:Int = 0x0020; + public static final GL_MAP_PERSISTENT_BIT:Int = 0x0040; + public static final GL_MAP_COHERENT_BIT:Int = 0x0080; + public static final GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT:Int = 0x00000001; + public static final GL_ELEMENT_ARRAY_BARRIER_BIT:Int = 0x00000002; + public static final GL_UNIFORM_BARRIER_BIT:Int = 0x00000004; + public static final GL_TEXTURE_FETCH_BARRIER_BIT:Int = 0x00000008; + public static final GL_SHADER_IMAGE_ACCESS_BARRIER_BIT:Int = 0x00000020; + public static final GL_COMMAND_BARRIER_BIT:Int = 0x00000040; + public static final GL_PIXEL_BUFFER_BARRIER_BIT:Int = 0x00000080; + public static final GL_TEXTURE_UPDATE_BARRIER_BIT:Int = 0x00000100; + public static final GL_BUFFER_UPDATE_BARRIER_BIT:Int = 0x00000200; + public static final GL_FRAMEBUFFER_BARRIER_BIT:Int = 0x00000400; + public static final GL_TRANSFORM_FEEDBACK_BARRIER_BIT:Int = 0x00000800; + public static final GL_ATOMIC_COUNTER_BARRIER_BIT:Int = 0x00001000; + public static final GL_SHADER_STORAGE_BARRIER_BIT:Int = 0x00002000; + public static final GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT:Int = 0x00004000; + public static final GL_QUERY_BUFFER_BARRIER_BIT:Int = 0x00008000; + public static final GL_ALL_BARRIER_BITS:Int = 0xFFFFFFFF; + public static final GL_SYNC_FLUSH_COMMANDS_BIT:Int = 0x00000001; + public static final GL_VERTEX_SHADER_BIT:Int = 0x00000001; + public static final GL_FRAGMENT_SHADER_BIT:Int = 0x00000002; + public static final GL_GEOMETRY_SHADER_BIT:Int = 0x00000004; + public static final GL_TESS_CONTROL_SHADER_BIT:Int = 0x00000008; + public static final GL_TESS_EVALUATION_SHADER_BIT:Int = 0x00000010; + public static final GL_COMPUTE_SHADER_BIT:Int = 0x00000020; + public static final GL_ALL_SHADER_BITS:Int = 0xFFFFFFFF; + public static final GL_FALSE:Int = 0; + public static final GL_NO_ERROR:Int = 0; + public static final GL_ZERO:Int = 0; + public static final GL_NONE:Int = 0; + public static final GL_TRUE:Int = 1; + public static final GL_ONE:Int = 1; + public static final GL_INVALID_INDEX:Int = 0xFFFFFFFF; + // public static final GL_TIMEOUT_IGNORED:haxe.Int64 = 0xFFFFFFFFFFFFFFFF; + public static final GL_POINTS:Int = 0x0000; + public static final GL_LINES:Int = 0x0001; + public static final GL_LINE_LOOP:Int = 0x0002; + public static final GL_LINE_STRIP:Int = 0x0003; + public static final GL_TRIANGLES:Int = 0x0004; + public static final GL_TRIANGLE_STRIP:Int = 0x0005; + public static final GL_TRIANGLE_FAN:Int = 0x0006; + public static final GL_QUADS:Int = 0x0007; + public static final GL_LINES_ADJACENCY:Int = 0x000A; + public static final GL_LINE_STRIP_ADJACENCY:Int = 0x000B; + public static final GL_TRIANGLES_ADJACENCY:Int = 0x000C; + public static final GL_TRIANGLE_STRIP_ADJACENCY:Int = 0x000D; + public static final GL_PATCHES:Int = 0x000E; + public static final GL_NEVER:Int = 0x0200; + public static final GL_LESS:Int = 0x0201; + public static final GL_EQUAL:Int = 0x0202; + public static final GL_LEQUAL:Int = 0x0203; + public static final GL_GREATER:Int = 0x0204; + public static final GL_NOTEQUAL:Int = 0x0205; + public static final GL_GEQUAL:Int = 0x0206; + public static final GL_ALWAYS:Int = 0x0207; + public static final GL_SRC_COLOR:Int = 0x0300; + public static final GL_ONE_MINUS_SRC_COLOR:Int = 0x0301; + public static final GL_SRC_ALPHA:Int = 0x0302; + public static final GL_ONE_MINUS_SRC_ALPHA:Int = 0x0303; + public static final GL_DST_ALPHA:Int = 0x0304; + public static final GL_ONE_MINUS_DST_ALPHA:Int = 0x0305; + public static final GL_DST_COLOR:Int = 0x0306; + public static final GL_ONE_MINUS_DST_COLOR:Int = 0x0307; + public static final GL_SRC_ALPHA_SATURATE:Int = 0x0308; + public static final GL_FRONT_LEFT:Int = 0x0400; + public static final GL_FRONT_RIGHT:Int = 0x0401; + public static final GL_BACK_LEFT:Int = 0x0402; + public static final GL_BACK_RIGHT:Int = 0x0403; + public static final GL_FRONT:Int = 0x0404; + public static final GL_BACK:Int = 0x0405; + public static final GL_LEFT:Int = 0x0406; + public static final GL_RIGHT:Int = 0x0407; + public static final GL_FRONT_AND_BACK:Int = 0x0408; + public static final GL_INVALID_ENUM:Int = 0x0500; + public static final GL_INVALID_VALUE:Int = 0x0501; + public static final GL_INVALID_OPERATION:Int = 0x0502; + public static final GL_STACK_OVERFLOW:Int = 0x0503; + public static final GL_STACK_UNDERFLOW:Int = 0x0504; + public static final GL_OUT_OF_MEMORY:Int = 0x0505; + public static final GL_INVALID_FRAMEBUFFER_OPERATION:Int = 0x0506; + public static final GL_CW:Int = 0x0900; + public static final GL_CCW:Int = 0x0901; + public static final GL_POINT_SIZE:Int = 0x0B11; + public static final GL_POINT_SIZE_RANGE:Int = 0x0B12; + public static final GL_SMOOTH_POINT_SIZE_RANGE:Int = 0x0B12; + public static final GL_POINT_SIZE_GRANULARITY:Int = 0x0B13; + public static final GL_SMOOTH_POINT_SIZE_GRANULARITY:Int = 0x0B13; + public static final GL_LINE_SMOOTH:Int = 0x0B20; + public static final GL_LINE_WIDTH:Int = 0x0B21; + public static final GL_LINE_WIDTH_RANGE:Int = 0x0B22; + public static final GL_SMOOTH_LINE_WIDTH_RANGE:Int = 0x0B22; + public static final GL_LINE_WIDTH_GRANULARITY:Int = 0x0B23; + public static final GL_SMOOTH_LINE_WIDTH_GRANULARITY:Int = 0x0B23; + public static final GL_POLYGON_MODE:Int = 0x0B40; + public static final GL_POLYGON_SMOOTH:Int = 0x0B41; + public static final GL_CULL_FACE:Int = 0x0B44; + public static final GL_CULL_FACE_MODE:Int = 0x0B45; + public static final GL_FRONT_FACE:Int = 0x0B46; + public static final GL_DEPTH_RANGE:Int = 0x0B70; + public static final GL_DEPTH_TEST:Int = 0x0B71; + public static final GL_DEPTH_WRITEMASK:Int = 0x0B72; + public static final GL_DEPTH_CLEAR_VALUE:Int = 0x0B73; + public static final GL_DEPTH_FUNC:Int = 0x0B74; + public static final GL_STENCIL_TEST:Int = 0x0B90; + public static final GL_STENCIL_CLEAR_VALUE:Int = 0x0B91; + public static final GL_STENCIL_FUNC:Int = 0x0B92; + public static final GL_STENCIL_VALUE_MASK:Int = 0x0B93; + public static final GL_STENCIL_FAIL:Int = 0x0B94; + public static final GL_STENCIL_PASS_DEPTH_FAIL:Int = 0x0B95; + public static final GL_STENCIL_PASS_DEPTH_PASS:Int = 0x0B96; + public static final GL_STENCIL_REF:Int = 0x0B97; + public static final GL_STENCIL_WRITEMASK:Int = 0x0B98; + public static final GL_VIEWPORT:Int = 0x0BA2; + public static final GL_DITHER:Int = 0x0BD0; + public static final GL_BLEND_DST:Int = 0x0BE0; + public static final GL_BLEND_SRC:Int = 0x0BE1; + public static final GL_BLEND:Int = 0x0BE2; + public static final GL_LOGIC_OP_MODE:Int = 0x0BF0; + public static final GL_COLOR_LOGIC_OP:Int = 0x0BF2; + public static final GL_DRAW_BUFFER:Int = 0x0C01; + public static final GL_READ_BUFFER:Int = 0x0C02; + public static final GL_SCISSOR_BOX:Int = 0x0C10; + public static final GL_SCISSOR_TEST:Int = 0x0C11; + public static final GL_COLOR_CLEAR_VALUE:Int = 0x0C22; + public static final GL_COLOR_WRITEMASK:Int = 0x0C23; + public static final GL_DOUBLEBUFFER:Int = 0x0C32; + public static final GL_STEREO:Int = 0x0C33; + public static final GL_LINE_SMOOTH_HINT:Int = 0x0C52; + public static final GL_POLYGON_SMOOTH_HINT:Int = 0x0C53; + public static final GL_UNPACK_SWAP_BYTES:Int = 0x0CF0; + public static final GL_UNPACK_LSB_FIRST:Int = 0x0CF1; + public static final GL_UNPACK_ROW_LENGTH:Int = 0x0CF2; + public static final GL_UNPACK_SKIP_ROWS:Int = 0x0CF3; + public static final GL_UNPACK_SKIP_PIXELS:Int = 0x0CF4; + public static final GL_UNPACK_ALIGNMENT:Int = 0x0CF5; + public static final GL_PACK_SWAP_BYTES:Int = 0x0D00; + public static final GL_PACK_LSB_FIRST:Int = 0x0D01; + public static final GL_PACK_ROW_LENGTH:Int = 0x0D02; + public static final GL_PACK_SKIP_ROWS:Int = 0x0D03; + public static final GL_PACK_SKIP_PIXELS:Int = 0x0D04; + public static final GL_PACK_ALIGNMENT:Int = 0x0D05; + public static final GL_MAX_CLIP_DISTANCES:Int = 0x0D32; + public static final GL_MAX_TEXTURE_SIZE:Int = 0x0D33; + public static final GL_MAX_VIEWPORT_DIMS:Int = 0x0D3A; + public static final GL_SUBPIXEL_BITS:Int = 0x0D50; + public static final GL_TEXTURE_1D:Int = 0x0DE0; + public static final GL_TEXTURE_2D:Int = 0x0DE1; + public static final GL_TEXTURE_WIDTH:Int = 0x1000; + public static final GL_TEXTURE_HEIGHT:Int = 0x1001; + public static final GL_TEXTURE_INTERNAL_FORMAT:Int = 0x1003; + public static final GL_TEXTURE_BORDER_COLOR:Int = 0x1004; + public static final GL_DONT_CARE:Int = 0x1100; + public static final GL_FASTEST:Int = 0x1101; + public static final GL_NICEST:Int = 0x1102; + public static final GL_BYTE:Int = 0x1400; + public static final GL_UNSIGNED_BYTE:Int = 0x1401; + public static final GL_SHORT:Int = 0x1402; + public static final GL_UNSIGNED_SHORT:Int = 0x1403; + public static final GL_INT:Int = 0x1404; + public static final GL_UNSIGNED_INT:Int = 0x1405; + public static final GL_FLOAT:Int = 0x1406; + public static final GL_DOUBLE:Int = 0x140A; + public static final GL_HALF_FLOAT:Int = 0x140B; + public static final GL_FIXED:Int = 0x140C; + public static final GL_CLEAR:Int = 0x1500; + public static final GL_AND:Int = 0x1501; + public static final GL_AND_REVERSE:Int = 0x1502; + public static final GL_COPY:Int = 0x1503; + public static final GL_AND_INVERTED:Int = 0x1504; + public static final GL_NOOP:Int = 0x1505; + public static final GL_XOR:Int = 0x1506; + public static final GL_OR:Int = 0x1507; + public static final GL_NOR:Int = 0x1508; + public static final GL_EQUIV:Int = 0x1509; + public static final GL_INVERT:Int = 0x150A; + public static final GL_OR_REVERSE:Int = 0x150B; + public static final GL_COPY_INVERTED:Int = 0x150C; + public static final GL_OR_INVERTED:Int = 0x150D; + public static final GL_NAND:Int = 0x150E; + public static final GL_SET:Int = 0x150F; + public static final GL_TEXTURE:Int = 0x1702; + public static final GL_COLOR:Int = 0x1800; + public static final GL_DEPTH:Int = 0x1801; + public static final GL_STENCIL:Int = 0x1802; + public static final GL_STENCIL_INDEX:Int = 0x1901; + public static final GL_DEPTH_COMPONENT:Int = 0x1902; + public static final GL_RED:Int = 0x1903; + public static final GL_GREEN:Int = 0x1904; + public static final GL_BLUE:Int = 0x1905; + public static final GL_ALPHA:Int = 0x1906; + public static final GL_RGB:Int = 0x1907; + public static final GL_RGBA:Int = 0x1908; + public static final GL_POINT:Int = 0x1B00; + public static final GL_LINE:Int = 0x1B01; + public static final GL_FILL:Int = 0x1B02; + public static final GL_KEEP:Int = 0x1E00; + public static final GL_REPLACE:Int = 0x1E01; + public static final GL_INCR:Int = 0x1E02; + public static final GL_DECR:Int = 0x1E03; + public static final GL_VENDOR:Int = 0x1F00; + public static final GL_RENDERER:Int = 0x1F01; + public static final GL_VERSION:Int = 0x1F02; + public static final GL_EXTENSIONS:Int = 0x1F03; + public static final GL_NEAREST:Int = 0x2600; + public static final GL_LINEAR:Int = 0x2601; + public static final GL_NEAREST_MIPMAP_NEAREST:Int = 0x2700; + public static final GL_LINEAR_MIPMAP_NEAREST:Int = 0x2701; + public static final GL_NEAREST_MIPMAP_LINEAR:Int = 0x2702; + public static final GL_LINEAR_MIPMAP_LINEAR:Int = 0x2703; + public static final GL_TEXTURE_MAG_FILTER:Int = 0x2800; + public static final GL_TEXTURE_MIN_FILTER:Int = 0x2801; + public static final GL_TEXTURE_WRAP_S:Int = 0x2802; + public static final GL_TEXTURE_WRAP_T:Int = 0x2803; + public static final GL_REPEAT:Int = 0x2901; + public static final GL_POLYGON_OFFSET_UNITS:Int = 0x2A00; + public static final GL_POLYGON_OFFSET_POINT:Int = 0x2A01; + public static final GL_POLYGON_OFFSET_LINE:Int = 0x2A02; + public static final GL_R3_G3_B2:Int = 0x2A10; + public static final GL_CLIP_DISTANCE0:Int = 0x3000; + public static final GL_CLIP_DISTANCE1:Int = 0x3001; + public static final GL_CLIP_DISTANCE2:Int = 0x3002; + public static final GL_CLIP_DISTANCE3:Int = 0x3003; + public static final GL_CLIP_DISTANCE4:Int = 0x3004; + public static final GL_CLIP_DISTANCE5:Int = 0x3005; + public static final GL_CLIP_DISTANCE6:Int = 0x3006; + public static final GL_CLIP_DISTANCE7:Int = 0x3007; + public static final GL_CONSTANT_COLOR:Int = 0x8001; + public static final GL_ONE_MINUS_CONSTANT_COLOR:Int = 0x8002; + public static final GL_CONSTANT_ALPHA:Int = 0x8003; + public static final GL_ONE_MINUS_CONSTANT_ALPHA:Int = 0x8004; + public static final GL_BLEND_COLOR:Int = 0x8005; + public static final GL_FUNC_ADD:Int = 0x8006; + public static final GL_MIN:Int = 0x8007; + public static final GL_MAX:Int = 0x8008; + public static final GL_BLEND_EQUATION:Int = 0x8009; + public static final GL_BLEND_EQUATION_RGB:Int = 0x8009; + public static final GL_FUNC_SUBTRACT:Int = 0x800A; + public static final GL_FUNC_REVERSE_SUBTRACT:Int = 0x800B; + public static final GL_UNSIGNED_BYTE_3_3_2:Int = 0x8032; + public static final GL_UNSIGNED_SHORT_4_4_4_4:Int = 0x8033; + public static final GL_UNSIGNED_SHORT_5_5_5_1:Int = 0x8034; + public static final GL_UNSIGNED_INT_8_8_8_8:Int = 0x8035; + public static final GL_UNSIGNED_INT_10_10_10_2:Int = 0x8036; + public static final GL_POLYGON_OFFSET_FILL:Int = 0x8037; + public static final GL_POLYGON_OFFSET_FACTOR:Int = 0x8038; + public static final GL_RGB4:Int = 0x804F; + public static final GL_RGB5:Int = 0x8050; + public static final GL_RGB8:Int = 0x8051; + public static final GL_RGB10:Int = 0x8052; + public static final GL_RGB12:Int = 0x8053; + public static final GL_RGB16:Int = 0x8054; + public static final GL_RGBA2:Int = 0x8055; + public static final GL_RGBA4:Int = 0x8056; + public static final GL_RGB5_A1:Int = 0x8057; + public static final GL_RGBA8:Int = 0x8058; + public static final GL_RGB10_A2:Int = 0x8059; + public static final GL_RGBA12:Int = 0x805A; + public static final GL_RGBA16:Int = 0x805B; + public static final GL_TEXTURE_RED_SIZE:Int = 0x805C; + public static final GL_TEXTURE_GREEN_SIZE:Int = 0x805D; + public static final GL_TEXTURE_BLUE_SIZE:Int = 0x805E; + public static final GL_TEXTURE_ALPHA_SIZE:Int = 0x805F; + public static final GL_PROXY_TEXTURE_1D:Int = 0x8063; + public static final GL_PROXY_TEXTURE_2D:Int = 0x8064; + public static final GL_TEXTURE_BINDING_1D:Int = 0x8068; + public static final GL_TEXTURE_BINDING_2D:Int = 0x8069; + public static final GL_TEXTURE_BINDING_3D:Int = 0x806A; + public static final GL_PACK_SKIP_IMAGES:Int = 0x806B; + public static final GL_PACK_IMAGE_HEIGHT:Int = 0x806C; + public static final GL_UNPACK_SKIP_IMAGES:Int = 0x806D; + public static final GL_UNPACK_IMAGE_HEIGHT:Int = 0x806E; + public static final GL_TEXTURE_3D:Int = 0x806F; + public static final GL_PROXY_TEXTURE_3D:Int = 0x8070; + public static final GL_TEXTURE_DEPTH:Int = 0x8071; + public static final GL_TEXTURE_WRAP_R:Int = 0x8072; + public static final GL_MAX_3D_TEXTURE_SIZE:Int = 0x8073; + public static final GL_VERTEX_ARRAY:Int = 0x8074; + public static final GL_MULTISAMPLE:Int = 0x809D; + public static final GL_SAMPLE_ALPHA_TO_COVERAGE:Int = 0x809E; + public static final GL_SAMPLE_ALPHA_TO_ONE:Int = 0x809F; + public static final GL_SAMPLE_COVERAGE:Int = 0x80A0; + public static final GL_SAMPLE_BUFFERS:Int = 0x80A8; + public static final GL_SAMPLES:Int = 0x80A9; + public static final GL_SAMPLE_COVERAGE_VALUE:Int = 0x80AA; + public static final GL_SAMPLE_COVERAGE_INVERT:Int = 0x80AB; + public static final GL_BLEND_DST_RGB:Int = 0x80C8; + public static final GL_BLEND_SRC_RGB:Int = 0x80C9; + public static final GL_BLEND_DST_ALPHA:Int = 0x80CA; + public static final GL_BLEND_SRC_ALPHA:Int = 0x80CB; + public static final GL_BGR:Int = 0x80E0; + public static final GL_BGRA:Int = 0x80E1; + public static final GL_MAX_ELEMENTS_VERTICES:Int = 0x80E8; + public static final GL_MAX_ELEMENTS_INDICES:Int = 0x80E9; + public static final GL_POINT_FADE_THRESHOLD_SIZE:Int = 0x8128; + public static final GL_CLAMP_TO_BORDER:Int = 0x812D; + public static final GL_CLAMP_TO_EDGE:Int = 0x812F; + public static final GL_TEXTURE_MIN_LOD:Int = 0x813A; + public static final GL_TEXTURE_MAX_LOD:Int = 0x813B; + public static final GL_TEXTURE_BASE_LEVEL:Int = 0x813C; + public static final GL_TEXTURE_MAX_LEVEL:Int = 0x813D; + public static final GL_DEPTH_COMPONENT16:Int = 0x81A5; + public static final GL_DEPTH_COMPONENT24:Int = 0x81A6; + public static final GL_DEPTH_COMPONENT32:Int = 0x81A7; + public static final GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:Int = 0x8210; + public static final GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:Int = 0x8211; + public static final GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:Int = 0x8212; + public static final GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:Int = 0x8213; + public static final GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:Int = 0x8214; + public static final GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:Int = 0x8215; + public static final GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:Int = 0x8216; + public static final GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:Int = 0x8217; + public static final GL_FRAMEBUFFER_DEFAULT:Int = 0x8218; + public static final GL_FRAMEBUFFER_UNDEFINED:Int = 0x8219; + public static final GL_DEPTH_STENCIL_ATTACHMENT:Int = 0x821A; + public static final GL_MAJOR_VERSION:Int = 0x821B; + public static final GL_MINOR_VERSION:Int = 0x821C; + public static final GL_NUM_EXTENSIONS:Int = 0x821D; + public static final GL_CONTEXT_FLAGS:Int = 0x821E; + public static final GL_BUFFER_IMMUTABLE_STORAGE:Int = 0x821F; + public static final GL_BUFFER_STORAGE_FLAGS:Int = 0x8220; + public static final GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED:Int = 0x8221; + public static final GL_COMPRESSED_RED:Int = 0x8225; + public static final GL_COMPRESSED_RG:Int = 0x8226; + public static final GL_RG:Int = 0x8227; + public static final GL_RG_INTEGER:Int = 0x8228; + public static final GL_R8:Int = 0x8229; + public static final GL_R16:Int = 0x822A; + public static final GL_RG8:Int = 0x822B; + public static final GL_RG16:Int = 0x822C; + public static final GL_R16F:Int = 0x822D; + public static final GL_R32F:Int = 0x822E; + public static final GL_RG16F:Int = 0x822F; + public static final GL_RG32F:Int = 0x8230; + public static final GL_R8I:Int = 0x8231; + public static final GL_R8UI:Int = 0x8232; + public static final GL_R16I:Int = 0x8233; + public static final GL_R16UI:Int = 0x8234; + public static final GL_R32I:Int = 0x8235; + public static final GL_R32UI:Int = 0x8236; + public static final GL_RG8I:Int = 0x8237; + public static final GL_RG8UI:Int = 0x8238; + public static final GL_RG16I:Int = 0x8239; + public static final GL_RG16UI:Int = 0x823A; + public static final GL_RG32I:Int = 0x823B; + public static final GL_RG32UI:Int = 0x823C; + public static final GL_DEBUG_OUTPUT_SYNCHRONOUS:Int = 0x8242; + public static final GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH:Int = 0x8243; + public static final GL_DEBUG_CALLBACK_FUNCTION:Int = 0x8244; + public static final GL_DEBUG_CALLBACK_USER_PARAM:Int = 0x8245; + public static final GL_DEBUG_SOURCE_API:Int = 0x8246; + public static final GL_DEBUG_SOURCE_WINDOW_SYSTEM:Int = 0x8247; + public static final GL_DEBUG_SOURCE_SHADER_COMPILER:Int = 0x8248; + public static final GL_DEBUG_SOURCE_THIRD_PARTY:Int = 0x8249; + public static final GL_DEBUG_SOURCE_APPLICATION:Int = 0x824A; + public static final GL_DEBUG_SOURCE_OTHER:Int = 0x824B; + public static final GL_DEBUG_TYPE_ERROR:Int = 0x824C; + public static final GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:Int = 0x824D; + public static final GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:Int = 0x824E; + public static final GL_DEBUG_TYPE_PORTABILITY:Int = 0x824F; + public static final GL_DEBUG_TYPE_PERFORMANCE:Int = 0x8250; + public static final GL_DEBUG_TYPE_OTHER:Int = 0x8251; + public static final GL_PROGRAM_BINARY_RETRIEVABLE_HINT:Int = 0x8257; + public static final GL_PROGRAM_SEPARABLE:Int = 0x8258; + public static final GL_ACTIVE_PROGRAM:Int = 0x8259; + public static final GL_PROGRAM_PIPELINE_BINDING:Int = 0x825A; + public static final GL_MAX_VIEWPORTS:Int = 0x825B; + public static final GL_VIEWPORT_SUBPIXEL_BITS:Int = 0x825C; + public static final GL_VIEWPORT_BOUNDS_RANGE:Int = 0x825D; + public static final GL_LAYER_PROVOKING_VERTEX:Int = 0x825E; + public static final GL_VIEWPORT_INDEX_PROVOKING_VERTEX:Int = 0x825F; + public static final GL_UNDEFINED_VERTEX:Int = 0x8260; + public static final GL_MAX_COMPUTE_SHARED_MEMORY_SIZE:Int = 0x8262; + public static final GL_MAX_COMPUTE_UNIFORM_COMPONENTS:Int = 0x8263; + public static final GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS:Int = 0x8264; + public static final GL_MAX_COMPUTE_ATOMIC_COUNTERS:Int = 0x8265; + public static final GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS:Int = 0x8266; + public static final GL_COMPUTE_WORK_GROUP_SIZE:Int = 0x8267; + public static final GL_DEBUG_TYPE_MARKER:Int = 0x8268; + public static final GL_DEBUG_TYPE_PUSH_GROUP:Int = 0x8269; + public static final GL_DEBUG_TYPE_POP_GROUP:Int = 0x826A; + public static final GL_DEBUG_SEVERITY_NOTIFICATION:Int = 0x826B; + public static final GL_MAX_DEBUG_GROUP_STACK_DEPTH:Int = 0x826C; + public static final GL_DEBUG_GROUP_STACK_DEPTH:Int = 0x826D; + public static final GL_MAX_UNIFORM_LOCATIONS:Int = 0x826E; + public static final GL_INTERNALFORMAT_SUPPORTED:Int = 0x826F; + public static final GL_INTERNALFORMAT_PREFERRED:Int = 0x8270; + public static final GL_INTERNALFORMAT_RED_SIZE:Int = 0x8271; + public static final GL_INTERNALFORMAT_GREEN_SIZE:Int = 0x8272; + public static final GL_INTERNALFORMAT_BLUE_SIZE:Int = 0x8273; + public static final GL_INTERNALFORMAT_ALPHA_SIZE:Int = 0x8274; + public static final GL_INTERNALFORMAT_DEPTH_SIZE:Int = 0x8275; + public static final GL_INTERNALFORMAT_STENCIL_SIZE:Int = 0x8276; + public static final GL_INTERNALFORMAT_SHARED_SIZE:Int = 0x8277; + public static final GL_INTERNALFORMAT_RED_TYPE:Int = 0x8278; + public static final GL_INTERNALFORMAT_GREEN_TYPE:Int = 0x8279; + public static final GL_INTERNALFORMAT_BLUE_TYPE:Int = 0x827A; + public static final GL_INTERNALFORMAT_ALPHA_TYPE:Int = 0x827B; + public static final GL_INTERNALFORMAT_DEPTH_TYPE:Int = 0x827C; + public static final GL_INTERNALFORMAT_STENCIL_TYPE:Int = 0x827D; + public static final GL_MAX_WIDTH:Int = 0x827E; + public static final GL_MAX_HEIGHT:Int = 0x827F; + public static final GL_MAX_DEPTH:Int = 0x8280; + public static final GL_MAX_LAYERS:Int = 0x8281; + public static final GL_MAX_COMBINED_DIMENSIONS:Int = 0x8282; + public static final GL_COLOR_COMPONENTS:Int = 0x8283; + public static final GL_DEPTH_COMPONENTS:Int = 0x8284; + public static final GL_STENCIL_COMPONENTS:Int = 0x8285; + public static final GL_COLOR_RENDERABLE:Int = 0x8286; + public static final GL_DEPTH_RENDERABLE:Int = 0x8287; + public static final GL_STENCIL_RENDERABLE:Int = 0x8288; + public static final GL_FRAMEBUFFER_RENDERABLE:Int = 0x8289; + public static final GL_FRAMEBUFFER_RENDERABLE_LAYERED:Int = 0x828A; + public static final GL_FRAMEBUFFER_BLEND:Int = 0x828B; + public static final GL_READ_PIXELS:Int = 0x828C; + public static final GL_READ_PIXELS_FORMAT:Int = 0x828D; + public static final GL_READ_PIXELS_TYPE:Int = 0x828E; + public static final GL_TEXTURE_IMAGE_FORMAT:Int = 0x828F; + public static final GL_TEXTURE_IMAGE_TYPE:Int = 0x8290; + public static final GL_GET_TEXTURE_IMAGE_FORMAT:Int = 0x8291; + public static final GL_GET_TEXTURE_IMAGE_TYPE:Int = 0x8292; + public static final GL_MIPMAP:Int = 0x8293; + public static final GL_MANUAL_GENERATE_MIPMAP:Int = 0x8294; + public static final GL_AUTO_GENERATE_MIPMAP:Int = 0x8295; + public static final GL_COLOR_ENCODING:Int = 0x8296; + public static final GL_SRGB_READ:Int = 0x8297; + public static final GL_SRGB_WRITE:Int = 0x8298; + public static final GL_FILTER:Int = 0x829A; + public static final GL_VERTEX_TEXTURE:Int = 0x829B; + public static final GL_TESS_CONTROL_TEXTURE:Int = 0x829C; + public static final GL_TESS_EVALUATION_TEXTURE:Int = 0x829D; + public static final GL_GEOMETRY_TEXTURE:Int = 0x829E; + public static final GL_FRAGMENT_TEXTURE:Int = 0x829F; + public static final GL_COMPUTE_TEXTURE:Int = 0x82A0; + public static final GL_TEXTURE_SHADOW:Int = 0x82A1; + public static final GL_TEXTURE_GATHER:Int = 0x82A2; + public static final GL_TEXTURE_GATHER_SHADOW:Int = 0x82A3; + public static final GL_SHADER_IMAGE_LOAD:Int = 0x82A4; + public static final GL_SHADER_IMAGE_STORE:Int = 0x82A5; + public static final GL_SHADER_IMAGE_ATOMIC:Int = 0x82A6; + public static final GL_IMAGE_TEXEL_SIZE:Int = 0x82A7; + public static final GL_IMAGE_COMPATIBILITY_CLASS:Int = 0x82A8; + public static final GL_IMAGE_PIXEL_FORMAT:Int = 0x82A9; + public static final GL_IMAGE_PIXEL_TYPE:Int = 0x82AA; + public static final GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST:Int = 0x82AC; + public static final GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST:Int = 0x82AD; + public static final GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE:Int = 0x82AE; + public static final GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE:Int = 0x82AF; + public static final GL_TEXTURE_COMPRESSED_BLOCK_WIDTH:Int = 0x82B1; + public static final GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT:Int = 0x82B2; + public static final GL_TEXTURE_COMPRESSED_BLOCK_SIZE:Int = 0x82B3; + public static final GL_CLEAR_BUFFER:Int = 0x82B4; + public static final GL_TEXTURE_VIEW:Int = 0x82B5; + public static final GL_VIEW_COMPATIBILITY_CLASS:Int = 0x82B6; + public static final GL_FULL_SUPPORT:Int = 0x82B7; + public static final GL_CAVEAT_SUPPORT:Int = 0x82B8; + public static final GL_IMAGE_CLASS_4_X_32:Int = 0x82B9; + public static final GL_IMAGE_CLASS_2_X_32:Int = 0x82BA; + public static final GL_IMAGE_CLASS_1_X_32:Int = 0x82BB; + public static final GL_IMAGE_CLASS_4_X_16:Int = 0x82BC; + public static final GL_IMAGE_CLASS_2_X_16:Int = 0x82BD; + public static final GL_IMAGE_CLASS_1_X_16:Int = 0x82BE; + public static final GL_IMAGE_CLASS_4_X_8:Int = 0x82BF; + public static final GL_IMAGE_CLASS_2_X_8:Int = 0x82C0; + public static final GL_IMAGE_CLASS_1_X_8:Int = 0x82C1; + public static final GL_IMAGE_CLASS_11_11_10:Int = 0x82C2; + public static final GL_IMAGE_CLASS_10_10_10_2:Int = 0x82C3; + public static final GL_VIEW_CLASS_128_BITS:Int = 0x82C4; + public static final GL_VIEW_CLASS_96_BITS:Int = 0x82C5; + public static final GL_VIEW_CLASS_64_BITS:Int = 0x82C6; + public static final GL_VIEW_CLASS_48_BITS:Int = 0x82C7; + public static final GL_VIEW_CLASS_32_BITS:Int = 0x82C8; + public static final GL_VIEW_CLASS_24_BITS:Int = 0x82C9; + public static final GL_VIEW_CLASS_16_BITS:Int = 0x82CA; + public static final GL_VIEW_CLASS_8_BITS:Int = 0x82CB; + public static final GL_VIEW_CLASS_S3TC_DXT1_RGB:Int = 0x82CC; + public static final GL_VIEW_CLASS_S3TC_DXT1_RGBA:Int = 0x82CD; + public static final GL_VIEW_CLASS_S3TC_DXT3_RGBA:Int = 0x82CE; + public static final GL_VIEW_CLASS_S3TC_DXT5_RGBA:Int = 0x82CF; + public static final GL_VIEW_CLASS_RGTC1_RED:Int = 0x82D0; + public static final GL_VIEW_CLASS_RGTC2_RG:Int = 0x82D1; + public static final GL_VIEW_CLASS_BPTC_UNORM:Int = 0x82D2; + public static final GL_VIEW_CLASS_BPTC_FLOAT:Int = 0x82D3; + public static final GL_VERTEX_ATTRIB_BINDING:Int = 0x82D4; + public static final GL_VERTEX_ATTRIB_RELATIVE_OFFSET:Int = 0x82D5; + public static final GL_VERTEX_BINDING_DIVISOR:Int = 0x82D6; + public static final GL_VERTEX_BINDING_OFFSET:Int = 0x82D7; + public static final GL_VERTEX_BINDING_STRIDE:Int = 0x82D8; + public static final GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET:Int = 0x82D9; + public static final GL_MAX_VERTEX_ATTRIB_BINDINGS:Int = 0x82DA; + public static final GL_TEXTURE_VIEW_MIN_LEVEL:Int = 0x82DB; + public static final GL_TEXTURE_VIEW_NUM_LEVELS:Int = 0x82DC; + public static final GL_TEXTURE_VIEW_MIN_LAYER:Int = 0x82DD; + public static final GL_TEXTURE_VIEW_NUM_LAYERS:Int = 0x82DE; + public static final GL_TEXTURE_IMMUTABLE_LEVELS:Int = 0x82DF; + public static final GL_BUFFER:Int = 0x82E0; + public static final GL_SHADER:Int = 0x82E1; + public static final GL_PROGRAM:Int = 0x82E2; + public static final GL_QUERY:Int = 0x82E3; + public static final GL_PROGRAM_PIPELINE:Int = 0x82E4; + public static final GL_MAX_VERTEX_ATTRIB_STRIDE:Int = 0x82E5; + public static final GL_SAMPLER:Int = 0x82E6; + public static final GL_DISPLAY_LIST:Int = 0x82E7; + public static final GL_MAX_LABEL_LENGTH:Int = 0x82E8; + public static final GL_NUM_SHADING_LANGUAGE_VERSIONS:Int = 0x82E9; + public static final GL_UNSIGNED_BYTE_2_3_3_REV:Int = 0x8362; + public static final GL_UNSIGNED_SHORT_5_6_5:Int = 0x8363; + public static final GL_UNSIGNED_SHORT_5_6_5_REV:Int = 0x8364; + public static final GL_UNSIGNED_SHORT_4_4_4_4_REV:Int = 0x8365; + public static final GL_UNSIGNED_SHORT_1_5_5_5_REV:Int = 0x8366; + public static final GL_UNSIGNED_INT_8_8_8_8_REV:Int = 0x8367; + public static final GL_UNSIGNED_INT_2_10_10_10_REV:Int = 0x8368; + public static final GL_MIRRORED_REPEAT:Int = 0x8370; + public static final GL_ALIASED_LINE_WIDTH_RANGE:Int = 0x846E; + public static final GL_TEXTURE0:Int = 0x84C0; + public static final GL_TEXTURE1:Int = 0x84C1; + public static final GL_TEXTURE2:Int = 0x84C2; + public static final GL_TEXTURE3:Int = 0x84C3; + public static final GL_TEXTURE4:Int = 0x84C4; + public static final GL_TEXTURE5:Int = 0x84C5; + public static final GL_TEXTURE6:Int = 0x84C6; + public static final GL_TEXTURE7:Int = 0x84C7; + public static final GL_TEXTURE8:Int = 0x84C8; + public static final GL_TEXTURE9:Int = 0x84C9; + public static final GL_TEXTURE10:Int = 0x84CA; + public static final GL_TEXTURE11:Int = 0x84CB; + public static final GL_TEXTURE12:Int = 0x84CC; + public static final GL_TEXTURE13:Int = 0x84CD; + public static final GL_TEXTURE14:Int = 0x84CE; + public static final GL_TEXTURE15:Int = 0x84CF; + public static final GL_TEXTURE16:Int = 0x84D0; + public static final GL_TEXTURE17:Int = 0x84D1; + public static final GL_TEXTURE18:Int = 0x84D2; + public static final GL_TEXTURE19:Int = 0x84D3; + public static final GL_TEXTURE20:Int = 0x84D4; + public static final GL_TEXTURE21:Int = 0x84D5; + public static final GL_TEXTURE22:Int = 0x84D6; + public static final GL_TEXTURE23:Int = 0x84D7; + public static final GL_TEXTURE24:Int = 0x84D8; + public static final GL_TEXTURE25:Int = 0x84D9; + public static final GL_TEXTURE26:Int = 0x84DA; + public static final GL_TEXTURE27:Int = 0x84DB; + public static final GL_TEXTURE28:Int = 0x84DC; + public static final GL_TEXTURE29:Int = 0x84DD; + public static final GL_TEXTURE30:Int = 0x84DE; + public static final GL_TEXTURE31:Int = 0x84DF; + public static final GL_ACTIVE_TEXTURE:Int = 0x84E0; + public static final GL_MAX_RENDERBUFFER_SIZE:Int = 0x84E8; + public static final GL_COMPRESSED_RGB:Int = 0x84ED; + public static final GL_COMPRESSED_RGBA:Int = 0x84EE; + public static final GL_TEXTURE_COMPRESSION_HINT:Int = 0x84EF; + public static final GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER:Int = 0x84F0; + public static final GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER:Int = 0x84F1; + public static final GL_TEXTURE_RECTANGLE:Int = 0x84F5; + public static final GL_TEXTURE_BINDING_RECTANGLE:Int = 0x84F6; + public static final GL_PROXY_TEXTURE_RECTANGLE:Int = 0x84F7; + public static final GL_MAX_RECTANGLE_TEXTURE_SIZE:Int = 0x84F8; + public static final GL_DEPTH_STENCIL:Int = 0x84F9; + public static final GL_UNSIGNED_INT_24_8:Int = 0x84FA; + public static final GL_MAX_TEXTURE_LOD_BIAS:Int = 0x84FD; + public static final GL_TEXTURE_LOD_BIAS:Int = 0x8501; + public static final GL_INCR_WRAP:Int = 0x8507; + public static final GL_DECR_WRAP:Int = 0x8508; + public static final GL_TEXTURE_CUBE_MAP:Int = 0x8513; + public static final GL_TEXTURE_BINDING_CUBE_MAP:Int = 0x8514; + public static final GL_TEXTURE_CUBE_MAP_POSITIVE_X:Int = 0x8515; + public static final GL_TEXTURE_CUBE_MAP_NEGATIVE_X:Int = 0x8516; + public static final GL_TEXTURE_CUBE_MAP_POSITIVE_Y:Int = 0x8517; + public static final GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:Int = 0x8518; + public static final GL_TEXTURE_CUBE_MAP_POSITIVE_Z:Int = 0x8519; + public static final GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:Int = 0x851A; + public static final GL_PROXY_TEXTURE_CUBE_MAP:Int = 0x851B; + public static final GL_MAX_CUBE_MAP_TEXTURE_SIZE:Int = 0x851C; + public static final GL_SRC1_ALPHA:Int = 0x8589; + public static final GL_VERTEX_ARRAY_BINDING:Int = 0x85B5; + public static final GL_VERTEX_ATTRIB_ARRAY_ENABLED:Int = 0x8622; + public static final GL_VERTEX_ATTRIB_ARRAY_SIZE:Int = 0x8623; + public static final GL_VERTEX_ATTRIB_ARRAY_STRIDE:Int = 0x8624; + public static final GL_VERTEX_ATTRIB_ARRAY_TYPE:Int = 0x8625; + public static final GL_CURRENT_VERTEX_ATTRIB:Int = 0x8626; + public static final GL_VERTEX_PROGRAM_POINT_SIZE:Int = 0x8642; + public static final GL_PROGRAM_POINT_SIZE:Int = 0x8642; + public static final GL_VERTEX_ATTRIB_ARRAY_POINTER:Int = 0x8645; + public static final GL_DEPTH_CLAMP:Int = 0x864F; + public static final GL_TEXTURE_COMPRESSED_IMAGE_SIZE:Int = 0x86A0; + public static final GL_TEXTURE_COMPRESSED:Int = 0x86A1; + public static final GL_NUM_COMPRESSED_TEXTURE_FORMATS:Int = 0x86A2; + public static final GL_COMPRESSED_TEXTURE_FORMATS:Int = 0x86A3; + public static final GL_PROGRAM_BINARY_LENGTH:Int = 0x8741; + public static final GL_MIRROR_CLAMP_TO_EDGE:Int = 0x8743; + public static final GL_VERTEX_ATTRIB_ARRAY_LONG:Int = 0x874E; + public static final GL_BUFFER_SIZE:Int = 0x8764; + public static final GL_BUFFER_USAGE:Int = 0x8765; + public static final GL_NUM_PROGRAM_BINARY_FORMATS:Int = 0x87FE; + public static final GL_PROGRAM_BINARY_FORMATS:Int = 0x87FF; + public static final GL_STENCIL_BACK_FUNC:Int = 0x8800; + public static final GL_STENCIL_BACK_FAIL:Int = 0x8801; + public static final GL_STENCIL_BACK_PASS_DEPTH_FAIL:Int = 0x8802; + public static final GL_STENCIL_BACK_PASS_DEPTH_PASS:Int = 0x8803; + public static final GL_RGBA32F:Int = 0x8814; + public static final GL_RGB32F:Int = 0x8815; + public static final GL_RGBA16F:Int = 0x881A; + public static final GL_RGB16F:Int = 0x881B; + public static final GL_MAX_DRAW_BUFFERS:Int = 0x8824; + public static final GL_DRAW_BUFFER0:Int = 0x8825; + public static final GL_DRAW_BUFFER1:Int = 0x8826; + public static final GL_DRAW_BUFFER2:Int = 0x8827; + public static final GL_DRAW_BUFFER3:Int = 0x8828; + public static final GL_DRAW_BUFFER4:Int = 0x8829; + public static final GL_DRAW_BUFFER5:Int = 0x882A; + public static final GL_DRAW_BUFFER6:Int = 0x882B; + public static final GL_DRAW_BUFFER7:Int = 0x882C; + public static final GL_DRAW_BUFFER8:Int = 0x882D; + public static final GL_DRAW_BUFFER9:Int = 0x882E; + public static final GL_DRAW_BUFFER10:Int = 0x882F; + public static final GL_DRAW_BUFFER11:Int = 0x8830; + public static final GL_DRAW_BUFFER12:Int = 0x8831; + public static final GL_DRAW_BUFFER13:Int = 0x8832; + public static final GL_DRAW_BUFFER14:Int = 0x8833; + public static final GL_DRAW_BUFFER15:Int = 0x8834; + public static final GL_BLEND_EQUATION_ALPHA:Int = 0x883D; + public static final GL_TEXTURE_DEPTH_SIZE:Int = 0x884A; + public static final GL_TEXTURE_COMPARE_MODE:Int = 0x884C; + public static final GL_TEXTURE_COMPARE_FUNC:Int = 0x884D; + public static final GL_COMPARE_REF_TO_TEXTURE:Int = 0x884E; + public static final GL_TEXTURE_CUBE_MAP_SEAMLESS:Int = 0x884F; + public static final GL_QUERY_COUNTER_BITS:Int = 0x8864; + public static final GL_CURRENT_QUERY:Int = 0x8865; + public static final GL_QUERY_RESULT:Int = 0x8866; + public static final GL_QUERY_RESULT_AVAILABLE:Int = 0x8867; + public static final GL_MAX_VERTEX_ATTRIBS:Int = 0x8869; + public static final GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:Int = 0x886A; + public static final GL_MAX_TESS_CONTROL_INPUT_COMPONENTS:Int = 0x886C; + public static final GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS:Int = 0x886D; + public static final GL_MAX_TEXTURE_IMAGE_UNITS:Int = 0x8872; + public static final GL_GEOMETRY_SHADER_INVOCATIONS:Int = 0x887F; + public static final GL_ARRAY_BUFFER:Int = 0x8892; + public static final GL_ELEMENT_ARRAY_BUFFER:Int = 0x8893; + public static final GL_ARRAY_BUFFER_BINDING:Int = 0x8894; + public static final GL_ELEMENT_ARRAY_BUFFER_BINDING:Int = 0x8895; + public static final GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:Int = 0x889F; + public static final GL_READ_ONLY:Int = 0x88B8; + public static final GL_WRITE_ONLY:Int = 0x88B9; + public static final GL_READ_WRITE:Int = 0x88BA; + public static final GL_BUFFER_ACCESS:Int = 0x88BB; + public static final GL_BUFFER_MAPPED:Int = 0x88BC; + public static final GL_BUFFER_MAP_POINTER:Int = 0x88BD; + public static final GL_TIME_ELAPSED:Int = 0x88BF; + public static final GL_STREAM_DRAW:Int = 0x88E0; + public static final GL_STREAM_READ:Int = 0x88E1; + public static final GL_STREAM_COPY:Int = 0x88E2; + public static final GL_STATIC_DRAW:Int = 0x88E4; + public static final GL_STATIC_READ:Int = 0x88E5; + public static final GL_STATIC_COPY:Int = 0x88E6; + public static final GL_DYNAMIC_DRAW:Int = 0x88E8; + public static final GL_DYNAMIC_READ:Int = 0x88E9; + public static final GL_DYNAMIC_COPY:Int = 0x88EA; + public static final GL_PIXEL_PACK_BUFFER:Int = 0x88EB; + public static final GL_PIXEL_UNPACK_BUFFER:Int = 0x88EC; + public static final GL_PIXEL_PACK_BUFFER_BINDING:Int = 0x88ED; + public static final GL_PIXEL_UNPACK_BUFFER_BINDING:Int = 0x88EF; + public static final GL_DEPTH24_STENCIL8:Int = 0x88F0; + public static final GL_TEXTURE_STENCIL_SIZE:Int = 0x88F1; + public static final GL_SRC1_COLOR:Int = 0x88F9; + public static final GL_ONE_MINUS_SRC1_COLOR:Int = 0x88FA; + public static final GL_ONE_MINUS_SRC1_ALPHA:Int = 0x88FB; + public static final GL_MAX_DUAL_SOURCE_DRAW_BUFFERS:Int = 0x88FC; + public static final GL_VERTEX_ATTRIB_ARRAY_INTEGER:Int = 0x88FD; + public static final GL_VERTEX_ATTRIB_ARRAY_DIVISOR:Int = 0x88FE; + public static final GL_MAX_ARRAY_TEXTURE_LAYERS:Int = 0x88FF; + public static final GL_MIN_PROGRAM_TEXEL_OFFSET:Int = 0x8904; + public static final GL_MAX_PROGRAM_TEXEL_OFFSET:Int = 0x8905; + public static final GL_SAMPLES_PASSED:Int = 0x8914; + public static final GL_GEOMETRY_VERTICES_OUT:Int = 0x8916; + public static final GL_GEOMETRY_INPUT_TYPE:Int = 0x8917; + public static final GL_GEOMETRY_OUTPUT_TYPE:Int = 0x8918; + public static final GL_SAMPLER_BINDING:Int = 0x8919; + public static final GL_CLAMP_READ_COLOR:Int = 0x891C; + public static final GL_FIXED_ONLY:Int = 0x891D; + public static final GL_UNIFORM_BUFFER:Int = 0x8A11; + public static final GL_UNIFORM_BUFFER_BINDING:Int = 0x8A28; + public static final GL_UNIFORM_BUFFER_START:Int = 0x8A29; + public static final GL_UNIFORM_BUFFER_SIZE:Int = 0x8A2A; + public static final GL_MAX_VERTEX_UNIFORM_BLOCKS:Int = 0x8A2B; + public static final GL_MAX_GEOMETRY_UNIFORM_BLOCKS:Int = 0x8A2C; + public static final GL_MAX_FRAGMENT_UNIFORM_BLOCKS:Int = 0x8A2D; + public static final GL_MAX_COMBINED_UNIFORM_BLOCKS:Int = 0x8A2E; + public static final GL_MAX_UNIFORM_BUFFER_BINDINGS:Int = 0x8A2F; + public static final GL_MAX_UNIFORM_BLOCK_SIZE:Int = 0x8A30; + public static final GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:Int = 0x8A31; + public static final GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS:Int = 0x8A32; + public static final GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:Int = 0x8A33; + public static final GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:Int = 0x8A34; + public static final GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH:Int = 0x8A35; + public static final GL_ACTIVE_UNIFORM_BLOCKS:Int = 0x8A36; + public static final GL_UNIFORM_TYPE:Int = 0x8A37; + public static final GL_UNIFORM_SIZE:Int = 0x8A38; + public static final GL_UNIFORM_NAME_LENGTH:Int = 0x8A39; + public static final GL_UNIFORM_BLOCK_INDEX:Int = 0x8A3A; + public static final GL_UNIFORM_OFFSET:Int = 0x8A3B; + public static final GL_UNIFORM_ARRAY_STRIDE:Int = 0x8A3C; + public static final GL_UNIFORM_MATRIX_STRIDE:Int = 0x8A3D; + public static final GL_UNIFORM_IS_ROW_MAJOR:Int = 0x8A3E; + public static final GL_UNIFORM_BLOCK_BINDING:Int = 0x8A3F; + public static final GL_UNIFORM_BLOCK_DATA_SIZE:Int = 0x8A40; + public static final GL_UNIFORM_BLOCK_NAME_LENGTH:Int = 0x8A41; + public static final GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:Int = 0x8A42; + public static final GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:Int = 0x8A43; + public static final GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:Int = 0x8A44; + public static final GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER:Int = 0x8A45; + public static final GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:Int = 0x8A46; + public static final GL_FRAGMENT_SHADER:Int = 0x8B30; + public static final GL_VERTEX_SHADER:Int = 0x8B31; + public static final GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:Int = 0x8B49; + public static final GL_MAX_VERTEX_UNIFORM_COMPONENTS:Int = 0x8B4A; + public static final GL_MAX_VARYING_FLOATS:Int = 0x8B4B; + public static final GL_MAX_VARYING_COMPONENTS:Int = 0x8B4B; + public static final GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:Int = 0x8B4C; + public static final GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:Int = 0x8B4D; + public static final GL_SHADER_TYPE:Int = 0x8B4F; + public static final GL_FLOAT_VEC2:Int = 0x8B50; + public static final GL_FLOAT_VEC3:Int = 0x8B51; + public static final GL_FLOAT_VEC4:Int = 0x8B52; + public static final GL_INT_VEC2:Int = 0x8B53; + public static final GL_INT_VEC3:Int = 0x8B54; + public static final GL_INT_VEC4:Int = 0x8B55; + public static final GL_BOOL:Int = 0x8B56; + public static final GL_BOOL_VEC2:Int = 0x8B57; + public static final GL_BOOL_VEC3:Int = 0x8B58; + public static final GL_BOOL_VEC4:Int = 0x8B59; + public static final GL_FLOAT_MAT2:Int = 0x8B5A; + public static final GL_FLOAT_MAT3:Int = 0x8B5B; + public static final GL_FLOAT_MAT4:Int = 0x8B5C; + public static final GL_SAMPLER_1D:Int = 0x8B5D; + public static final GL_SAMPLER_2D:Int = 0x8B5E; + public static final GL_SAMPLER_3D:Int = 0x8B5F; + public static final GL_SAMPLER_CUBE:Int = 0x8B60; + public static final GL_SAMPLER_1D_SHADOW:Int = 0x8B61; + public static final GL_SAMPLER_2D_SHADOW:Int = 0x8B62; + public static final GL_SAMPLER_2D_RECT:Int = 0x8B63; + public static final GL_SAMPLER_2D_RECT_SHADOW:Int = 0x8B64; + public static final GL_FLOAT_MAT2x3:Int = 0x8B65; + public static final GL_FLOAT_MAT2x4:Int = 0x8B66; + public static final GL_FLOAT_MAT3x2:Int = 0x8B67; + public static final GL_FLOAT_MAT3x4:Int = 0x8B68; + public static final GL_FLOAT_MAT4x2:Int = 0x8B69; + public static final GL_FLOAT_MAT4x3:Int = 0x8B6A; + public static final GL_DELETE_STATUS:Int = 0x8B80; + public static final GL_COMPILE_STATUS:Int = 0x8B81; + public static final GL_LINK_STATUS:Int = 0x8B82; + public static final GL_VALIDATE_STATUS:Int = 0x8B83; + public static final GL_INFO_LOG_LENGTH:Int = 0x8B84; + public static final GL_ATTACHED_SHADERS:Int = 0x8B85; + public static final GL_ACTIVE_UNIFORMS:Int = 0x8B86; + public static final GL_ACTIVE_UNIFORM_MAX_LENGTH:Int = 0x8B87; + public static final GL_SHADER_SOURCE_LENGTH:Int = 0x8B88; + public static final GL_ACTIVE_ATTRIBUTES:Int = 0x8B89; + public static final GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:Int = 0x8B8A; + public static final GL_FRAGMENT_SHADER_DERIVATIVE_HINT:Int = 0x8B8B; + public static final GL_SHADING_LANGUAGE_VERSION:Int = 0x8B8C; + public static final GL_CURRENT_PROGRAM:Int = 0x8B8D; + public static final GL_IMPLEMENTATION_COLOR_READ_TYPE:Int = 0x8B9A; + public static final GL_IMPLEMENTATION_COLOR_READ_FORMAT:Int = 0x8B9B; + public static final GL_TEXTURE_RED_TYPE:Int = 0x8C10; + public static final GL_TEXTURE_GREEN_TYPE:Int = 0x8C11; + public static final GL_TEXTURE_BLUE_TYPE:Int = 0x8C12; + public static final GL_TEXTURE_ALPHA_TYPE:Int = 0x8C13; + public static final GL_TEXTURE_DEPTH_TYPE:Int = 0x8C16; + public static final GL_UNSIGNED_NORMALIZED:Int = 0x8C17; + public static final GL_TEXTURE_1D_ARRAY:Int = 0x8C18; + public static final GL_PROXY_TEXTURE_1D_ARRAY:Int = 0x8C19; + public static final GL_TEXTURE_2D_ARRAY:Int = 0x8C1A; + public static final GL_PROXY_TEXTURE_2D_ARRAY:Int = 0x8C1B; + public static final GL_TEXTURE_BINDING_1D_ARRAY:Int = 0x8C1C; + public static final GL_TEXTURE_BINDING_2D_ARRAY:Int = 0x8C1D; + public static final GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS:Int = 0x8C29; + public static final GL_TEXTURE_BUFFER:Int = 0x8C2A; + public static final GL_TEXTURE_BUFFER_BINDING:Int = 0x8C2A; + public static final GL_MAX_TEXTURE_BUFFER_SIZE:Int = 0x8C2B; + public static final GL_TEXTURE_BINDING_BUFFER:Int = 0x8C2C; + public static final GL_TEXTURE_BUFFER_DATA_STORE_BINDING:Int = 0x8C2D; + public static final GL_ANY_SAMPLES_PASSED:Int = 0x8C2F; + public static final GL_SAMPLE_SHADING:Int = 0x8C36; + public static final GL_MIN_SAMPLE_SHADING_VALUE:Int = 0x8C37; + public static final GL_R11F_G11F_B10F:Int = 0x8C3A; + public static final GL_UNSIGNED_INT_10F_11F_11F_REV:Int = 0x8C3B; + public static final GL_RGB9_E5:Int = 0x8C3D; + public static final GL_UNSIGNED_INT_5_9_9_9_REV:Int = 0x8C3E; + public static final GL_TEXTURE_SHARED_SIZE:Int = 0x8C3F; + public static final GL_SRGB:Int = 0x8C40; + public static final GL_SRGB8:Int = 0x8C41; + public static final GL_SRGB_ALPHA:Int = 0x8C42; + public static final GL_SRGB8_ALPHA8:Int = 0x8C43; + public static final GL_COMPRESSED_SRGB:Int = 0x8C48; + public static final GL_COMPRESSED_SRGB_ALPHA:Int = 0x8C49; + public static final GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH:Int = 0x8C76; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_MODE:Int = 0x8C7F; + public static final GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:Int = 0x8C80; + public static final GL_TRANSFORM_FEEDBACK_VARYINGS:Int = 0x8C83; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_START:Int = 0x8C84; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:Int = 0x8C85; + public static final GL_PRIMITIVES_GENERATED:Int = 0x8C87; + public static final GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:Int = 0x8C88; + public static final GL_RASTERIZER_DISCARD:Int = 0x8C89; + public static final GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:Int = 0x8C8A; + public static final GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:Int = 0x8C8B; + public static final GL_INTERLEAVED_ATTRIBS:Int = 0x8C8C; + public static final GL_SEPARATE_ATTRIBS:Int = 0x8C8D; + public static final GL_TRANSFORM_FEEDBACK_BUFFER:Int = 0x8C8E; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:Int = 0x8C8F; + public static final GL_POINT_SPRITE_COORD_ORIGIN:Int = 0x8CA0; + public static final GL_LOWER_LEFT:Int = 0x8CA1; + public static final GL_UPPER_LEFT:Int = 0x8CA2; + public static final GL_STENCIL_BACK_REF:Int = 0x8CA3; + public static final GL_STENCIL_BACK_VALUE_MASK:Int = 0x8CA4; + public static final GL_STENCIL_BACK_WRITEMASK:Int = 0x8CA5; + public static final GL_DRAW_FRAMEBUFFER_BINDING:Int = 0x8CA6; + public static final GL_FRAMEBUFFER_BINDING:Int = 0x8CA6; + public static final GL_RENDERBUFFER_BINDING:Int = 0x8CA7; + public static final GL_READ_FRAMEBUFFER:Int = 0x8CA8; + public static final GL_DRAW_FRAMEBUFFER:Int = 0x8CA9; + public static final GL_READ_FRAMEBUFFER_BINDING:Int = 0x8CAA; + public static final GL_RENDERBUFFER_SAMPLES:Int = 0x8CAB; + public static final GL_DEPTH_COMPONENT32F:Int = 0x8CAC; + public static final GL_DEPTH32F_STENCIL8:Int = 0x8CAD; + public static final GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:Int = 0x8CD0; + public static final GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:Int = 0x8CD1; + public static final GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:Int = 0x8CD2; + public static final GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:Int = 0x8CD3; + public static final GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:Int = 0x8CD4; + public static final GL_FRAMEBUFFER_COMPLETE:Int = 0x8CD5; + public static final GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:Int = 0x8CD6; + public static final GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:Int = 0x8CD7; + public static final GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:Int = 0x8CDB; + public static final GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:Int = 0x8CDC; + public static final GL_FRAMEBUFFER_UNSUPPORTED:Int = 0x8CDD; + public static final GL_MAX_COLOR_ATTACHMENTS:Int = 0x8CDF; + public static final GL_COLOR_ATTACHMENT0:Int = 0x8CE0; + public static final GL_COLOR_ATTACHMENT1:Int = 0x8CE1; + public static final GL_COLOR_ATTACHMENT2:Int = 0x8CE2; + public static final GL_COLOR_ATTACHMENT3:Int = 0x8CE3; + public static final GL_COLOR_ATTACHMENT4:Int = 0x8CE4; + public static final GL_COLOR_ATTACHMENT5:Int = 0x8CE5; + public static final GL_COLOR_ATTACHMENT6:Int = 0x8CE6; + public static final GL_COLOR_ATTACHMENT7:Int = 0x8CE7; + public static final GL_COLOR_ATTACHMENT8:Int = 0x8CE8; + public static final GL_COLOR_ATTACHMENT9:Int = 0x8CE9; + public static final GL_COLOR_ATTACHMENT10:Int = 0x8CEA; + public static final GL_COLOR_ATTACHMENT11:Int = 0x8CEB; + public static final GL_COLOR_ATTACHMENT12:Int = 0x8CEC; + public static final GL_COLOR_ATTACHMENT13:Int = 0x8CED; + public static final GL_COLOR_ATTACHMENT14:Int = 0x8CEE; + public static final GL_COLOR_ATTACHMENT15:Int = 0x8CEF; + public static final GL_COLOR_ATTACHMENT16:Int = 0x8CF0; + public static final GL_COLOR_ATTACHMENT17:Int = 0x8CF1; + public static final GL_COLOR_ATTACHMENT18:Int = 0x8CF2; + public static final GL_COLOR_ATTACHMENT19:Int = 0x8CF3; + public static final GL_COLOR_ATTACHMENT20:Int = 0x8CF4; + public static final GL_COLOR_ATTACHMENT21:Int = 0x8CF5; + public static final GL_COLOR_ATTACHMENT22:Int = 0x8CF6; + public static final GL_COLOR_ATTACHMENT23:Int = 0x8CF7; + public static final GL_COLOR_ATTACHMENT24:Int = 0x8CF8; + public static final GL_COLOR_ATTACHMENT25:Int = 0x8CF9; + public static final GL_COLOR_ATTACHMENT26:Int = 0x8CFA; + public static final GL_COLOR_ATTACHMENT27:Int = 0x8CFB; + public static final GL_COLOR_ATTACHMENT28:Int = 0x8CFC; + public static final GL_COLOR_ATTACHMENT29:Int = 0x8CFD; + public static final GL_COLOR_ATTACHMENT30:Int = 0x8CFE; + public static final GL_COLOR_ATTACHMENT31:Int = 0x8CFF; + public static final GL_DEPTH_ATTACHMENT:Int = 0x8D00; + public static final GL_STENCIL_ATTACHMENT:Int = 0x8D20; + public static final GL_FRAMEBUFFER:Int = 0x8D40; + public static final GL_RENDERBUFFER:Int = 0x8D41; + public static final GL_RENDERBUFFER_WIDTH:Int = 0x8D42; + public static final GL_RENDERBUFFER_HEIGHT:Int = 0x8D43; + public static final GL_RENDERBUFFER_INTERNAL_FORMAT:Int = 0x8D44; + public static final GL_STENCIL_INDEX1:Int = 0x8D46; + public static final GL_STENCIL_INDEX4:Int = 0x8D47; + public static final GL_STENCIL_INDEX8:Int = 0x8D48; + public static final GL_STENCIL_INDEX16:Int = 0x8D49; + public static final GL_RENDERBUFFER_RED_SIZE:Int = 0x8D50; + public static final GL_RENDERBUFFER_GREEN_SIZE:Int = 0x8D51; + public static final GL_RENDERBUFFER_BLUE_SIZE:Int = 0x8D52; + public static final GL_RENDERBUFFER_ALPHA_SIZE:Int = 0x8D53; + public static final GL_RENDERBUFFER_DEPTH_SIZE:Int = 0x8D54; + public static final GL_RENDERBUFFER_STENCIL_SIZE:Int = 0x8D55; + public static final GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:Int = 0x8D56; + public static final GL_MAX_SAMPLES:Int = 0x8D57; + public static final GL_RGB565:Int = 0x8D62; + public static final GL_PRIMITIVE_RESTART_FIXED_INDEX:Int = 0x8D69; + public static final GL_ANY_SAMPLES_PASSED_CONSERVATIVE:Int = 0x8D6A; + public static final GL_MAX_ELEMENT_INDEX:Int = 0x8D6B; + public static final GL_RGBA32UI:Int = 0x8D70; + public static final GL_RGB32UI:Int = 0x8D71; + public static final GL_RGBA16UI:Int = 0x8D76; + public static final GL_RGB16UI:Int = 0x8D77; + public static final GL_RGBA8UI:Int = 0x8D7C; + public static final GL_RGB8UI:Int = 0x8D7D; + public static final GL_RGBA32I:Int = 0x8D82; + public static final GL_RGB32I:Int = 0x8D83; + public static final GL_RGBA16I:Int = 0x8D88; + public static final GL_RGB16I:Int = 0x8D89; + public static final GL_RGBA8I:Int = 0x8D8E; + public static final GL_RGB8I:Int = 0x8D8F; + public static final GL_RED_INTEGER:Int = 0x8D94; + public static final GL_GREEN_INTEGER:Int = 0x8D95; + public static final GL_BLUE_INTEGER:Int = 0x8D96; + public static final GL_RGB_INTEGER:Int = 0x8D98; + public static final GL_RGBA_INTEGER:Int = 0x8D99; + public static final GL_BGR_INTEGER:Int = 0x8D9A; + public static final GL_BGRA_INTEGER:Int = 0x8D9B; + public static final GL_INT_2_10_10_10_REV:Int = 0x8D9F; + public static final GL_FRAMEBUFFER_ATTACHMENT_LAYERED:Int = 0x8DA7; + public static final GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:Int = 0x8DA8; + public static final GL_FLOAT_32_UNSIGNED_INT_24_8_REV:Int = 0x8DAD; + public static final GL_FRAMEBUFFER_SRGB:Int = 0x8DB9; + public static final GL_COMPRESSED_RED_RGTC1:Int = 0x8DBB; + public static final GL_COMPRESSED_SIGNED_RED_RGTC1:Int = 0x8DBC; + public static final GL_COMPRESSED_RG_RGTC2:Int = 0x8DBD; + public static final GL_COMPRESSED_SIGNED_RG_RGTC2:Int = 0x8DBE; + public static final GL_SAMPLER_1D_ARRAY:Int = 0x8DC0; + public static final GL_SAMPLER_2D_ARRAY:Int = 0x8DC1; + public static final GL_SAMPLER_BUFFER:Int = 0x8DC2; + public static final GL_SAMPLER_1D_ARRAY_SHADOW:Int = 0x8DC3; + public static final GL_SAMPLER_2D_ARRAY_SHADOW:Int = 0x8DC4; + public static final GL_SAMPLER_CUBE_SHADOW:Int = 0x8DC5; + public static final GL_UNSIGNED_INT_VEC2:Int = 0x8DC6; + public static final GL_UNSIGNED_INT_VEC3:Int = 0x8DC7; + public static final GL_UNSIGNED_INT_VEC4:Int = 0x8DC8; + public static final GL_INT_SAMPLER_1D:Int = 0x8DC9; + public static final GL_INT_SAMPLER_2D:Int = 0x8DCA; + public static final GL_INT_SAMPLER_3D:Int = 0x8DCB; + public static final GL_INT_SAMPLER_CUBE:Int = 0x8DCC; + public static final GL_INT_SAMPLER_2D_RECT:Int = 0x8DCD; + public static final GL_INT_SAMPLER_1D_ARRAY:Int = 0x8DCE; + public static final GL_INT_SAMPLER_2D_ARRAY:Int = 0x8DCF; + public static final GL_INT_SAMPLER_BUFFER:Int = 0x8DD0; + public static final GL_UNSIGNED_INT_SAMPLER_1D:Int = 0x8DD1; + public static final GL_UNSIGNED_INT_SAMPLER_2D:Int = 0x8DD2; + public static final GL_UNSIGNED_INT_SAMPLER_3D:Int = 0x8DD3; + public static final GL_UNSIGNED_INT_SAMPLER_CUBE:Int = 0x8DD4; + public static final GL_UNSIGNED_INT_SAMPLER_2D_RECT:Int = 0x8DD5; + public static final GL_UNSIGNED_INT_SAMPLER_1D_ARRAY:Int = 0x8DD6; + public static final GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:Int = 0x8DD7; + public static final GL_UNSIGNED_INT_SAMPLER_BUFFER:Int = 0x8DD8; + public static final GL_GEOMETRY_SHADER:Int = 0x8DD9; + public static final GL_MAX_GEOMETRY_UNIFORM_COMPONENTS:Int = 0x8DDF; + public static final GL_MAX_GEOMETRY_OUTPUT_VERTICES:Int = 0x8DE0; + public static final GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:Int = 0x8DE1; + public static final GL_ACTIVE_SUBROUTINES:Int = 0x8DE5; + public static final GL_ACTIVE_SUBROUTINE_UNIFORMS:Int = 0x8DE6; + public static final GL_MAX_SUBROUTINES:Int = 0x8DE7; + public static final GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS:Int = 0x8DE8; + public static final GL_LOW_FLOAT:Int = 0x8DF0; + public static final GL_MEDIUM_FLOAT:Int = 0x8DF1; + public static final GL_HIGH_FLOAT:Int = 0x8DF2; + public static final GL_LOW_INT:Int = 0x8DF3; + public static final GL_MEDIUM_INT:Int = 0x8DF4; + public static final GL_HIGH_INT:Int = 0x8DF5; + public static final GL_SHADER_BINARY_FORMATS:Int = 0x8DF8; + public static final GL_NUM_SHADER_BINARY_FORMATS:Int = 0x8DF9; + public static final GL_SHADER_COMPILER:Int = 0x8DFA; + public static final GL_MAX_VERTEX_UNIFORM_VECTORS:Int = 0x8DFB; + public static final GL_MAX_VARYING_VECTORS:Int = 0x8DFC; + public static final GL_MAX_FRAGMENT_UNIFORM_VECTORS:Int = 0x8DFD; + public static final GL_QUERY_WAIT:Int = 0x8E13; + public static final GL_QUERY_NO_WAIT:Int = 0x8E14; + public static final GL_QUERY_BY_REGION_WAIT:Int = 0x8E15; + public static final GL_QUERY_BY_REGION_NO_WAIT:Int = 0x8E16; + public static final GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS:Int = 0x8E1E; + public static final GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS:Int = 0x8E1F; + public static final GL_TRANSFORM_FEEDBACK:Int = 0x8E22; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED:Int = 0x8E23; + public static final GL_TRANSFORM_FEEDBACK_PAUSED:Int = 0x8E23; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE:Int = 0x8E24; + public static final GL_TRANSFORM_FEEDBACK_ACTIVE:Int = 0x8E24; + public static final GL_TRANSFORM_FEEDBACK_BINDING:Int = 0x8E25; + public static final GL_TIMESTAMP:Int = 0x8E28; + public static final GL_TEXTURE_SWIZZLE_R:Int = 0x8E42; + public static final GL_TEXTURE_SWIZZLE_G:Int = 0x8E43; + public static final GL_TEXTURE_SWIZZLE_B:Int = 0x8E44; + public static final GL_TEXTURE_SWIZZLE_A:Int = 0x8E45; + public static final GL_TEXTURE_SWIZZLE_RGBA:Int = 0x8E46; + public static final GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS:Int = 0x8E47; + public static final GL_ACTIVE_SUBROUTINE_MAX_LENGTH:Int = 0x8E48; + public static final GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH:Int = 0x8E49; + public static final GL_NUM_COMPATIBLE_SUBROUTINES:Int = 0x8E4A; + public static final GL_COMPATIBLE_SUBROUTINES:Int = 0x8E4B; + public static final GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:Int = 0x8E4C; + public static final GL_FIRST_VERTEX_CONVENTION:Int = 0x8E4D; + public static final GL_LAST_VERTEX_CONVENTION:Int = 0x8E4E; + public static final GL_PROVOKING_VERTEX:Int = 0x8E4F; + public static final GL_SAMPLE_POSITION:Int = 0x8E50; + public static final GL_SAMPLE_MASK:Int = 0x8E51; + public static final GL_SAMPLE_MASK_VALUE:Int = 0x8E52; + public static final GL_MAX_SAMPLE_MASK_WORDS:Int = 0x8E59; + public static final GL_MAX_GEOMETRY_SHADER_INVOCATIONS:Int = 0x8E5A; + public static final GL_MIN_FRAGMENT_INTERPOLATION_OFFSET:Int = 0x8E5B; + public static final GL_MAX_FRAGMENT_INTERPOLATION_OFFSET:Int = 0x8E5C; + public static final GL_FRAGMENT_INTERPOLATION_OFFSET_BITS:Int = 0x8E5D; + public static final GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET:Int = 0x8E5E; + public static final GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET:Int = 0x8E5F; + public static final GL_MAX_TRANSFORM_FEEDBACK_BUFFERS:Int = 0x8E70; + public static final GL_MAX_VERTEX_STREAMS:Int = 0x8E71; + public static final GL_PATCH_VERTICES:Int = 0x8E72; + public static final GL_PATCH_DEFAULT_INNER_LEVEL:Int = 0x8E73; + public static final GL_PATCH_DEFAULT_OUTER_LEVEL:Int = 0x8E74; + public static final GL_TESS_CONTROL_OUTPUT_VERTICES:Int = 0x8E75; + public static final GL_TESS_GEN_MODE:Int = 0x8E76; + public static final GL_TESS_GEN_SPACING:Int = 0x8E77; + public static final GL_TESS_GEN_VERTEX_ORDER:Int = 0x8E78; + public static final GL_TESS_GEN_POINT_MODE:Int = 0x8E79; + public static final GL_ISOLINES:Int = 0x8E7A; + public static final GL_FRACTIONAL_ODD:Int = 0x8E7B; + public static final GL_FRACTIONAL_EVEN:Int = 0x8E7C; + public static final GL_MAX_PATCH_VERTICES:Int = 0x8E7D; + public static final GL_MAX_TESS_GEN_LEVEL:Int = 0x8E7E; + public static final GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS:Int = 0x8E7F; + public static final GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS:Int = 0x8E80; + public static final GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS:Int = 0x8E81; + public static final GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS:Int = 0x8E82; + public static final GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS:Int = 0x8E83; + public static final GL_MAX_TESS_PATCH_COMPONENTS:Int = 0x8E84; + public static final GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS:Int = 0x8E85; + public static final GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS:Int = 0x8E86; + public static final GL_TESS_EVALUATION_SHADER:Int = 0x8E87; + public static final GL_TESS_CONTROL_SHADER:Int = 0x8E88; + public static final GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS:Int = 0x8E89; + public static final GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS:Int = 0x8E8A; + public static final GL_COMPRESSED_RGBA_BPTC_UNORM:Int = 0x8E8C; + public static final GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:Int = 0x8E8D; + public static final GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT:Int = 0x8E8E; + public static final GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT:Int = 0x8E8F; + public static final GL_COPY_READ_BUFFER:Int = 0x8F36; + public static final GL_COPY_READ_BUFFER_BINDING:Int = 0x8F36; + public static final GL_COPY_WRITE_BUFFER:Int = 0x8F37; + public static final GL_COPY_WRITE_BUFFER_BINDING:Int = 0x8F37; + public static final GL_MAX_IMAGE_UNITS:Int = 0x8F38; + public static final GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS:Int = 0x8F39; + public static final GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:Int = 0x8F39; + public static final GL_IMAGE_BINDING_NAME:Int = 0x8F3A; + public static final GL_IMAGE_BINDING_LEVEL:Int = 0x8F3B; + public static final GL_IMAGE_BINDING_LAYERED:Int = 0x8F3C; + public static final GL_IMAGE_BINDING_LAYER:Int = 0x8F3D; + public static final GL_IMAGE_BINDING_ACCESS:Int = 0x8F3E; + public static final GL_DRAW_INDIRECT_BUFFER:Int = 0x8F3F; + public static final GL_DRAW_INDIRECT_BUFFER_BINDING:Int = 0x8F43; + public static final GL_DOUBLE_MAT2:Int = 0x8F46; + public static final GL_DOUBLE_MAT3:Int = 0x8F47; + public static final GL_DOUBLE_MAT4:Int = 0x8F48; + public static final GL_DOUBLE_MAT2x3:Int = 0x8F49; + public static final GL_DOUBLE_MAT2x4:Int = 0x8F4A; + public static final GL_DOUBLE_MAT3x2:Int = 0x8F4B; + public static final GL_DOUBLE_MAT3x4:Int = 0x8F4C; + public static final GL_DOUBLE_MAT4x2:Int = 0x8F4D; + public static final GL_DOUBLE_MAT4x3:Int = 0x8F4E; + public static final GL_VERTEX_BINDING_BUFFER:Int = 0x8F4F; + public static final GL_R8_SNORM:Int = 0x8F94; + public static final GL_RG8_SNORM:Int = 0x8F95; + public static final GL_RGB8_SNORM:Int = 0x8F96; + public static final GL_RGBA8_SNORM:Int = 0x8F97; + public static final GL_R16_SNORM:Int = 0x8F98; + public static final GL_RG16_SNORM:Int = 0x8F99; + public static final GL_RGB16_SNORM:Int = 0x8F9A; + public static final GL_RGBA16_SNORM:Int = 0x8F9B; + public static final GL_SIGNED_NORMALIZED:Int = 0x8F9C; + public static final GL_PRIMITIVE_RESTART:Int = 0x8F9D; + public static final GL_PRIMITIVE_RESTART_INDEX:Int = 0x8F9E; + public static final GL_DOUBLE_VEC2:Int = 0x8FFC; + public static final GL_DOUBLE_VEC3:Int = 0x8FFD; + public static final GL_DOUBLE_VEC4:Int = 0x8FFE; + public static final GL_TEXTURE_CUBE_MAP_ARRAY:Int = 0x9009; + public static final GL_TEXTURE_BINDING_CUBE_MAP_ARRAY:Int = 0x900A; + public static final GL_PROXY_TEXTURE_CUBE_MAP_ARRAY:Int = 0x900B; + public static final GL_SAMPLER_CUBE_MAP_ARRAY:Int = 0x900C; + public static final GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:Int = 0x900D; + public static final GL_INT_SAMPLER_CUBE_MAP_ARRAY:Int = 0x900E; + public static final GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:Int = 0x900F; + public static final GL_IMAGE_1D:Int = 0x904C; + public static final GL_IMAGE_2D:Int = 0x904D; + public static final GL_IMAGE_3D:Int = 0x904E; + public static final GL_IMAGE_2D_RECT:Int = 0x904F; + public static final GL_IMAGE_CUBE:Int = 0x9050; + public static final GL_IMAGE_BUFFER:Int = 0x9051; + public static final GL_IMAGE_1D_ARRAY:Int = 0x9052; + public static final GL_IMAGE_2D_ARRAY:Int = 0x9053; + public static final GL_IMAGE_CUBE_MAP_ARRAY:Int = 0x9054; + public static final GL_IMAGE_2D_MULTISAMPLE:Int = 0x9055; + public static final GL_IMAGE_2D_MULTISAMPLE_ARRAY:Int = 0x9056; + public static final GL_INT_IMAGE_1D:Int = 0x9057; + public static final GL_INT_IMAGE_2D:Int = 0x9058; + public static final GL_INT_IMAGE_3D:Int = 0x9059; + public static final GL_INT_IMAGE_2D_RECT:Int = 0x905A; + public static final GL_INT_IMAGE_CUBE:Int = 0x905B; + public static final GL_INT_IMAGE_BUFFER:Int = 0x905C; + public static final GL_INT_IMAGE_1D_ARRAY:Int = 0x905D; + public static final GL_INT_IMAGE_2D_ARRAY:Int = 0x905E; + public static final GL_INT_IMAGE_CUBE_MAP_ARRAY:Int = 0x905F; + public static final GL_INT_IMAGE_2D_MULTISAMPLE:Int = 0x9060; + public static final GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY:Int = 0x9061; + public static final GL_UNSIGNED_INT_IMAGE_1D:Int = 0x9062; + public static final GL_UNSIGNED_INT_IMAGE_2D:Int = 0x9063; + public static final GL_UNSIGNED_INT_IMAGE_3D:Int = 0x9064; + public static final GL_UNSIGNED_INT_IMAGE_2D_RECT:Int = 0x9065; + public static final GL_UNSIGNED_INT_IMAGE_CUBE:Int = 0x9066; + public static final GL_UNSIGNED_INT_IMAGE_BUFFER:Int = 0x9067; + public static final GL_UNSIGNED_INT_IMAGE_1D_ARRAY:Int = 0x9068; + public static final GL_UNSIGNED_INT_IMAGE_2D_ARRAY:Int = 0x9069; + public static final GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:Int = 0x906A; + public static final GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE:Int = 0x906B; + public static final GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY:Int = 0x906C; + public static final GL_MAX_IMAGE_SAMPLES:Int = 0x906D; + public static final GL_IMAGE_BINDING_FORMAT:Int = 0x906E; + public static final GL_RGB10_A2UI:Int = 0x906F; + public static final GL_MIN_MAP_BUFFER_ALIGNMENT:Int = 0x90BC; + public static final GL_IMAGE_FORMAT_COMPATIBILITY_TYPE:Int = 0x90C7; + public static final GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE:Int = 0x90C8; + public static final GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS:Int = 0x90C9; + public static final GL_MAX_VERTEX_IMAGE_UNIFORMS:Int = 0x90CA; + public static final GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS:Int = 0x90CB; + public static final GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS:Int = 0x90CC; + public static final GL_MAX_GEOMETRY_IMAGE_UNIFORMS:Int = 0x90CD; + public static final GL_MAX_FRAGMENT_IMAGE_UNIFORMS:Int = 0x90CE; + public static final GL_MAX_COMBINED_IMAGE_UNIFORMS:Int = 0x90CF; + public static final GL_SHADER_STORAGE_BUFFER:Int = 0x90D2; + public static final GL_SHADER_STORAGE_BUFFER_BINDING:Int = 0x90D3; + public static final GL_SHADER_STORAGE_BUFFER_START:Int = 0x90D4; + public static final GL_SHADER_STORAGE_BUFFER_SIZE:Int = 0x90D5; + public static final GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS:Int = 0x90D6; + public static final GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS:Int = 0x90D7; + public static final GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS:Int = 0x90D8; + public static final GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS:Int = 0x90D9; + public static final GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS:Int = 0x90DA; + public static final GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS:Int = 0x90DB; + public static final GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS:Int = 0x90DC; + public static final GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:Int = 0x90DD; + public static final GL_MAX_SHADER_STORAGE_BLOCK_SIZE:Int = 0x90DE; + public static final GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:Int = 0x90DF; + public static final GL_DEPTH_STENCIL_TEXTURE_MODE:Int = 0x90EA; + public static final GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS:Int = 0x90EB; + public static final GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER:Int = 0x90EC; + public static final GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER:Int = 0x90ED; + public static final GL_DISPATCH_INDIRECT_BUFFER:Int = 0x90EE; + public static final GL_DISPATCH_INDIRECT_BUFFER_BINDING:Int = 0x90EF; + public static final GL_TEXTURE_2D_MULTISAMPLE:Int = 0x9100; + public static final GL_PROXY_TEXTURE_2D_MULTISAMPLE:Int = 0x9101; + public static final GL_TEXTURE_2D_MULTISAMPLE_ARRAY:Int = 0x9102; + public static final GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY:Int = 0x9103; + public static final GL_TEXTURE_BINDING_2D_MULTISAMPLE:Int = 0x9104; + public static final GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY:Int = 0x9105; + public static final GL_TEXTURE_SAMPLES:Int = 0x9106; + public static final GL_TEXTURE_FIXED_SAMPLE_LOCATIONS:Int = 0x9107; + public static final GL_SAMPLER_2D_MULTISAMPLE:Int = 0x9108; + public static final GL_INT_SAMPLER_2D_MULTISAMPLE:Int = 0x9109; + public static final GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:Int = 0x910A; + public static final GL_SAMPLER_2D_MULTISAMPLE_ARRAY:Int = 0x910B; + public static final GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:Int = 0x910C; + public static final GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:Int = 0x910D; + public static final GL_MAX_COLOR_TEXTURE_SAMPLES:Int = 0x910E; + public static final GL_MAX_DEPTH_TEXTURE_SAMPLES:Int = 0x910F; + public static final GL_MAX_INTEGER_SAMPLES:Int = 0x9110; + public static final GL_MAX_SERVER_WAIT_TIMEOUT:Int = 0x9111; + public static final GL_OBJECT_TYPE:Int = 0x9112; + public static final GL_SYNC_CONDITION:Int = 0x9113; + public static final GL_SYNC_STATUS:Int = 0x9114; + public static final GL_SYNC_FLAGS:Int = 0x9115; + public static final GL_SYNC_FENCE:Int = 0x9116; + public static final GL_SYNC_GPU_COMMANDS_COMPLETE:Int = 0x9117; + public static final GL_UNSIGNALED:Int = 0x9118; + public static final GL_SIGNALED:Int = 0x9119; + public static final GL_ALREADY_SIGNALED:Int = 0x911A; + public static final GL_TIMEOUT_EXPIRED:Int = 0x911B; + public static final GL_CONDITION_SATISFIED:Int = 0x911C; + public static final GL_WAIT_FAILED:Int = 0x911D; + public static final GL_BUFFER_ACCESS_FLAGS:Int = 0x911F; + public static final GL_BUFFER_MAP_LENGTH:Int = 0x9120; + public static final GL_BUFFER_MAP_OFFSET:Int = 0x9121; + public static final GL_MAX_VERTEX_OUTPUT_COMPONENTS:Int = 0x9122; + public static final GL_MAX_GEOMETRY_INPUT_COMPONENTS:Int = 0x9123; + public static final GL_MAX_GEOMETRY_OUTPUT_COMPONENTS:Int = 0x9124; + public static final GL_MAX_FRAGMENT_INPUT_COMPONENTS:Int = 0x9125; + public static final GL_CONTEXT_PROFILE_MASK:Int = 0x9126; + public static final GL_UNPACK_COMPRESSED_BLOCK_WIDTH:Int = 0x9127; + public static final GL_UNPACK_COMPRESSED_BLOCK_HEIGHT:Int = 0x9128; + public static final GL_UNPACK_COMPRESSED_BLOCK_DEPTH:Int = 0x9129; + public static final GL_UNPACK_COMPRESSED_BLOCK_SIZE:Int = 0x912A; + public static final GL_PACK_COMPRESSED_BLOCK_WIDTH:Int = 0x912B; + public static final GL_PACK_COMPRESSED_BLOCK_HEIGHT:Int = 0x912C; + public static final GL_PACK_COMPRESSED_BLOCK_DEPTH:Int = 0x912D; + public static final GL_PACK_COMPRESSED_BLOCK_SIZE:Int = 0x912E; + public static final GL_TEXTURE_IMMUTABLE_FORMAT:Int = 0x912F; + public static final GL_MAX_DEBUG_MESSAGE_LENGTH:Int = 0x9143; + public static final GL_MAX_DEBUG_LOGGED_MESSAGES:Int = 0x9144; + public static final GL_DEBUG_LOGGED_MESSAGES:Int = 0x9145; + public static final GL_DEBUG_SEVERITY_HIGH:Int = 0x9146; + public static final GL_DEBUG_SEVERITY_MEDIUM:Int = 0x9147; + public static final GL_DEBUG_SEVERITY_LOW:Int = 0x9148; + public static final GL_QUERY_BUFFER:Int = 0x9192; + public static final GL_QUERY_BUFFER_BINDING:Int = 0x9193; + public static final GL_QUERY_RESULT_NO_WAIT:Int = 0x9194; + public static final GL_TEXTURE_BUFFER_OFFSET:Int = 0x919D; + public static final GL_TEXTURE_BUFFER_SIZE:Int = 0x919E; + public static final GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT:Int = 0x919F; + public static final GL_COMPUTE_SHADER:Int = 0x91B9; + public static final GL_MAX_COMPUTE_UNIFORM_BLOCKS:Int = 0x91BB; + public static final GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS:Int = 0x91BC; + public static final GL_MAX_COMPUTE_IMAGE_UNIFORMS:Int = 0x91BD; + public static final GL_MAX_COMPUTE_WORK_GROUP_COUNT:Int = 0x91BE; + public static final GL_MAX_COMPUTE_WORK_GROUP_SIZE:Int = 0x91BF; + public static final GL_COMPRESSED_R11_EAC:Int = 0x9270; + public static final GL_COMPRESSED_SIGNED_R11_EAC:Int = 0x9271; + public static final GL_COMPRESSED_RG11_EAC:Int = 0x9272; + public static final GL_COMPRESSED_SIGNED_RG11_EAC:Int = 0x9273; + public static final GL_COMPRESSED_RGB8_ETC2:Int = 0x9274; + public static final GL_COMPRESSED_SRGB8_ETC2:Int = 0x9275; + public static final GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:Int = 0x9276; + public static final GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:Int = 0x9277; + public static final GL_COMPRESSED_RGBA8_ETC2_EAC:Int = 0x9278; + public static final GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:Int = 0x9279; + public static final GL_ATOMIC_COUNTER_BUFFER:Int = 0x92C0; + public static final GL_ATOMIC_COUNTER_BUFFER_BINDING:Int = 0x92C1; + public static final GL_ATOMIC_COUNTER_BUFFER_START:Int = 0x92C2; + public static final GL_ATOMIC_COUNTER_BUFFER_SIZE:Int = 0x92C3; + public static final GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE:Int = 0x92C4; + public static final GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS:Int = 0x92C5; + public static final GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES:Int = 0x92C6; + public static final GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER:Int = 0x92C7; + public static final GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER:Int = 0x92C8; + public static final GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER:Int = 0x92C9; + public static final GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER:Int = 0x92CA; + public static final GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER:Int = 0x92CB; + public static final GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS:Int = 0x92CC; + public static final GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS:Int = 0x92CD; + public static final GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS:Int = 0x92CE; + public static final GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS:Int = 0x92CF; + public static final GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS:Int = 0x92D0; + public static final GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS:Int = 0x92D1; + public static final GL_MAX_VERTEX_ATOMIC_COUNTERS:Int = 0x92D2; + public static final GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS:Int = 0x92D3; + public static final GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS:Int = 0x92D4; + public static final GL_MAX_GEOMETRY_ATOMIC_COUNTERS:Int = 0x92D5; + public static final GL_MAX_FRAGMENT_ATOMIC_COUNTERS:Int = 0x92D6; + public static final GL_MAX_COMBINED_ATOMIC_COUNTERS:Int = 0x92D7; + public static final GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE:Int = 0x92D8; + public static final GL_ACTIVE_ATOMIC_COUNTER_BUFFERS:Int = 0x92D9; + public static final GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX:Int = 0x92DA; + public static final GL_UNSIGNED_INT_ATOMIC_COUNTER:Int = 0x92DB; + public static final GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS:Int = 0x92DC; + public static final GL_DEBUG_OUTPUT:Int = 0x92E0; + public static final GL_UNIFORM:Int = 0x92E1; + public static final GL_UNIFORM_BLOCK:Int = 0x92E2; + public static final GL_PROGRAM_INPUT:Int = 0x92E3; + public static final GL_PROGRAM_OUTPUT:Int = 0x92E4; + public static final GL_BUFFER_VARIABLE:Int = 0x92E5; + public static final GL_SHADER_STORAGE_BLOCK:Int = 0x92E6; + public static final GL_IS_PER_PATCH:Int = 0x92E7; + public static final GL_VERTEX_SUBROUTINE:Int = 0x92E8; + public static final GL_TESS_CONTROL_SUBROUTINE:Int = 0x92E9; + public static final GL_TESS_EVALUATION_SUBROUTINE:Int = 0x92EA; + public static final GL_GEOMETRY_SUBROUTINE:Int = 0x92EB; + public static final GL_FRAGMENT_SUBROUTINE:Int = 0x92EC; + public static final GL_COMPUTE_SUBROUTINE:Int = 0x92ED; + public static final GL_VERTEX_SUBROUTINE_UNIFORM:Int = 0x92EE; + public static final GL_TESS_CONTROL_SUBROUTINE_UNIFORM:Int = 0x92EF; + public static final GL_TESS_EVALUATION_SUBROUTINE_UNIFORM:Int = 0x92F0; + public static final GL_GEOMETRY_SUBROUTINE_UNIFORM:Int = 0x92F1; + public static final GL_FRAGMENT_SUBROUTINE_UNIFORM:Int = 0x92F2; + public static final GL_COMPUTE_SUBROUTINE_UNIFORM:Int = 0x92F3; + public static final GL_TRANSFORM_FEEDBACK_VARYING:Int = 0x92F4; + public static final GL_ACTIVE_RESOURCES:Int = 0x92F5; + public static final GL_MAX_NAME_LENGTH:Int = 0x92F6; + public static final GL_MAX_NUM_ACTIVE_VARIABLES:Int = 0x92F7; + public static final GL_MAX_NUM_COMPATIBLE_SUBROUTINES:Int = 0x92F8; + public static final GL_NAME_LENGTH:Int = 0x92F9; + public static final GL_TYPE:Int = 0x92FA; + public static final GL_ARRAY_SIZE:Int = 0x92FB; + public static final GL_OFFSET:Int = 0x92FC; + public static final GL_BLOCK_INDEX:Int = 0x92FD; + public static final GL_ARRAY_STRIDE:Int = 0x92FE; + public static final GL_MATRIX_STRIDE:Int = 0x92FF; + public static final GL_IS_ROW_MAJOR:Int = 0x9300; + public static final GL_ATOMIC_COUNTER_BUFFER_INDEX:Int = 0x9301; + public static final GL_BUFFER_BINDING:Int = 0x9302; + public static final GL_BUFFER_DATA_SIZE:Int = 0x9303; + public static final GL_NUM_ACTIVE_VARIABLES:Int = 0x9304; + public static final GL_ACTIVE_VARIABLES:Int = 0x9305; + public static final GL_REFERENCED_BY_VERTEX_SHADER:Int = 0x9306; + public static final GL_REFERENCED_BY_TESS_CONTROL_SHADER:Int = 0x9307; + public static final GL_REFERENCED_BY_TESS_EVALUATION_SHADER:Int = 0x9308; + public static final GL_REFERENCED_BY_GEOMETRY_SHADER:Int = 0x9309; + public static final GL_REFERENCED_BY_FRAGMENT_SHADER:Int = 0x930A; + public static final GL_REFERENCED_BY_COMPUTE_SHADER:Int = 0x930B; + public static final GL_TOP_LEVEL_ARRAY_SIZE:Int = 0x930C; + public static final GL_TOP_LEVEL_ARRAY_STRIDE:Int = 0x930D; + public static final GL_LOCATION:Int = 0x930E; + public static final GL_LOCATION_INDEX:Int = 0x930F; + public static final GL_FRAMEBUFFER_DEFAULT_WIDTH:Int = 0x9310; + public static final GL_FRAMEBUFFER_DEFAULT_HEIGHT:Int = 0x9311; + public static final GL_FRAMEBUFFER_DEFAULT_LAYERS:Int = 0x9312; + public static final GL_FRAMEBUFFER_DEFAULT_SAMPLES:Int = 0x9313; + public static final GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:Int = 0x9314; + public static final GL_MAX_FRAMEBUFFER_WIDTH:Int = 0x9315; + public static final GL_MAX_FRAMEBUFFER_HEIGHT:Int = 0x9316; + public static final GL_MAX_FRAMEBUFFER_LAYERS:Int = 0x9317; + public static final GL_MAX_FRAMEBUFFER_SAMPLES:Int = 0x9318; + public static final GL_LOCATION_COMPONENT:Int = 0x934A; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_INDEX:Int = 0x934B; + public static final GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE:Int = 0x934C; + public static final GL_CLEAR_TEXTURE:Int = 0x9365; + public static final GL_NUM_SAMPLE_COUNTS:Int = 0x9380; + + public static function glActiveShaderProgram(pipeline:Int, program:Int):Void {} + public static function glActiveTexture(texture:Int):Void {} + public static function glAttachShader(program:Int, shader:Int):Void {} + public static function glBeginConditionalRender(id:Int, mode:Int):Void {} + public static function glBeginQuery(target:Int, id:Int):Void {} + public static function glBeginQueryIndexed(target:Int, index:Int, id:Int):Void {} + public static function glBeginTransformFeedback(primitiveMode:Int):Void {} + public static function glBindAttribLocation(program:Int, index:Int, name:String):Void {} + public static function glBindBuffer(target:Int, buffer:Int):Void {} + public static function glBindBufferBase(target:Int, index:Int, buffer:Int):Void {} + public static function glBindBufferRange(target:Int, index:Int, buffer:Int, offset:hl.Ref, size:hl.Ref):Void {} + public static function glBindBuffersBase(target:Int, first:Int, count:Int, buffers:hl.Ref):Void {} + public static function glBindBuffersRange(target:Int, first:Int, count:Int, buffers:hl.Ref, offsets:hl.NativeArray>, sizes:hl.NativeArray>):Void {} + public static function glBindFragDataLocation(program:Int, color:Int, name:String):Void {} + public static function glBindFragDataLocationIndexed(program:Int, colorNumber:Int, index:Int, name:String):Void {} + public static function glBindFramebuffer(target:Int, framebuffer:Int):Void {} + public static function glBindImageTexture(unit:Int, texture:Int, level:Int, layered:Int, layer:Int, access:Int, format:Int):Void {} + public static function glBindImageTextures(first:Int, count:Int, textures:hl.Ref):Void {} + public static function glBindProgramPipeline(pipeline:Int):Void {} + public static function glBindRenderbuffer(target:Int, renderbuffer:Int):Void {} + public static function glBindSampler(unit:Int, sampler:Int):Void {} + public static function glBindSamplers(first:Int, count:Int, samplers:hl.Ref):Void {} + public static function glBindTexture(target:Int, texture:Int):Void {} + public static function glBindTextures(first:Int, count:Int, textures:hl.Ref):Void {} + public static function glBindTransformFeedback(target:Int, id:Int):Void {} + public static function glBindVertexArray(array:Int):Void {} + public static function glBindVertexBuffer(bindingindex:Int, buffer:Int, offset:hl.Ref, stride:Int):Void {} + public static function glBindVertexBuffers(first:Int, count:Int, buffers:hl.Ref, offsets:hl.NativeArray>, strides:hl.Ref):Void {} + public static function glBlendColor(red:hl.F32, green:hl.F32, blue:hl.F32, alpha:hl.F32):Void {} + public static function glBlendEquation(mode:Int):Void {} + public static function glBlendEquationSeparate(modeRGB:Int, modeAlpha:Int):Void {} + public static function glBlendEquationSeparatei(buf:Int, modeRGB:Int, modeAlpha:Int):Void {} + public static function glBlendEquationi(buf:Int, mode:Int):Void {} + public static function glBlendFunc(sfactor:Int, dfactor:Int):Void {} + public static function glBlendFuncSeparate(sfactorRGB:Int, dfactorRGB:Int, sfactorAlpha:Int, dfactorAlpha:Int):Void {} + public static function glBlendFuncSeparatei(buf:Int, srcRGB:Int, dstRGB:Int, srcAlpha:Int, dstAlpha:Int):Void {} + public static function glBlendFunci(buf:Int, src:Int, dst:Int):Void {} + public static function glBlitFramebuffer(srcX0:Int, srcY0:Int, srcX1:Int, srcY1:Int, dstX0:Int, dstY0:Int, dstX1:Int, dstY1:Int, mask:Int, filter:Int):Void {} + public static function glBufferData(target:Int, size:Int, data:hl.Bytes, usage:Int):Void {} + public static function glBufferStorage(target:Int, size:hl.Ref, data:hl.Bytes, flags:Int):Void {} + public static function glBufferSubData(target:Int, offset:hl.Ref, size:hl.Ref, data:hl.Bytes):Void {} + public static function glCheckFramebufferStatus(target:Int):Int { return 0; } + public static function glClampColor(target:Int, clamp:Int):Void {} + public static function glClear(mask:Int):Void {} + public static function glClearBufferData(target:Int, internalformat:Int, format:Int, type:Int, data:hl.Bytes):Void {} + public static function glClearBufferSubData(target:Int, internalformat:Int, offset:hl.Ref, size:hl.Ref, format:Int, type:Int, data:hl.Bytes):Void {} + public static function glClearBufferfi(buffer:Int, drawbuffer:Int, depth:hl.F32, stencil:Int):Void {} + public static function glClearBufferfv(buffer:Int, drawbuffer:Int, value:hl.Ref):Void {} + public static function glClearBufferiv(buffer:Int, drawbuffer:Int, value:hl.Ref):Void {} + public static function glClearBufferuiv(buffer:Int, drawbuffer:Int, value:hl.Ref):Void {} + public static function glClearColor(red:hl.F32, green:hl.F32, blue:hl.F32, alpha:hl.F32):Void {} + public static function glClearDepth(depth:hl.F64):Void {} + public static function glClearDepthf(d:hl.F32):Void {} + public static function glClearStencil(s:Int):Void {} + public static function glClearTexImage(texture:Int, level:Int, format:Int, type:Int, data:hl.Bytes):Void {} + public static function glClearTexSubImage(texture:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int, format:Int, type:Int, data:hl.Bytes):Void {} + public static function glClientWaitSync(sync:hl.Abstract<"GLSync">, flags:Int, timeout:hl.I64):Int { return 0; } + public static function glColorMask(red:Int, green:Int, blue:Int, alpha:Int):Void {} + public static function glColorMaski(index:Int, r:Int, g:Int, b:Int, a:Int):Void {} + public static function glColorP3ui(type:Int, color:Int):Void {} + public static function glColorP3uiv(type:Int, color:hl.Ref):Void {} + public static function glColorP4ui(type:Int, color:Int):Void {} + public static function glColorP4uiv(type:Int, color:hl.Ref):Void {} + public static function glCompileShader(shader:Int):Void {} + public static function glCompressedTexImage1D(target:Int, level:Int, internalformat:Int, width:Int, border:Int, imageSize:Int, data:hl.Bytes):Void {} + public static function glCompressedTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, imageSize:Int, data:hl.Bytes):Void {} + public static function glCompressedTexImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, imageSize:Int, data:hl.Bytes):Void {} + public static function glCompressedTexSubImage1D(target:Int, level:Int, xoffset:Int, width:Int, format:Int, imageSize:Int, data:hl.Bytes):Void {} + public static function glCompressedTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, imageSize:Int, data:hl.Bytes):Void {} + public static function glCompressedTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int, format:Int, imageSize:Int, data:hl.Bytes):Void {} + public static function glCopyBufferSubData(readTarget:Int, writeTarget:Int, readOffset:hl.Ref, writeOffset:hl.Ref, size:hl.Ref):Void {} + public static function glCopyImageSubData(srcName:Int, srcTarget:Int, srcLevel:Int, srcX:Int, srcY:Int, srcZ:Int, dstName:Int, dstTarget:Int, dstLevel:Int, dstX:Int, dstY:Int, dstZ:Int, srcWidth:Int, srcHeight:Int, srcDepth:Int):Void {} + public static function glCopyTexImage1D(target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, border:Int):Void {} + public static function glCopyTexImage2D(target:Int, level:Int, internalformat:Int, x:Int, y:Int, width:Int, height:Int, border:Int):Void {} + public static function glCopyTexSubImage1D(target:Int, level:Int, xoffset:Int, x:Int, y:Int, width:Int):Void {} + public static function glCopyTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, x:Int, y:Int, width:Int, height:Int):Void {} + public static function glCopyTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, x:Int, y:Int, width:Int, height:Int):Void {} + public static function glCreateProgram():Int { return 0; } + public static function glCreateShader(type:Int):Int { return 0; } + public static function glCreateShaderProgramv(type:Int, count:Int, strings:hl.NativeArray):Int { return 0; } + public static function glCullFace(mode:Int):Void {} + // public static function glDebugMessageCallback(callback:(Int->Int->Int->Int->Int->hl.Bytes), userParam:hl.Bytes):Void {} + // public static function glDebugMessageControl(source:Int, type:Int, severity:Int, count:Int, ids:hl.Ref, enabled:Int):Void {} + // public static function glDebugMessageInsert(source:Int, type:Int, id:Int, severity:Int, length:Int, buf:String):Void {} + public static function glDeleteBuffers(n:Int, buffers:hl.Ref):Void {} + public static function glDeleteFramebuffers(n:Int, framebuffers:hl.Ref):Void {} + public static function glDeleteProgram(program:Int):Void {} + public static function glDeleteProgramPipelines(n:Int, pipelines:hl.Ref):Void {} + public static function glDeleteQueries(n:Int, ids:hl.Ref):Void {} + public static function glDeleteRenderbuffers(n:Int, renderbuffers:hl.Ref):Void {} + public static function glDeleteSamplers(count:Int, samplers:hl.Ref):Void {} + public static function glDeleteShader(shader:Int):Void {} + public static function glDeleteSync(sync:hl.Abstract<"GLSync">):Void {} + public static function glDeleteTextures(n:Int, textures:hl.Ref):Void {} + public static function glDeleteTransformFeedbacks(n:Int, ids:hl.Ref):Void {} + public static function glDeleteVertexArrays(n:Int, arrays:hl.Ref):Void {} + public static function glDepthFunc(func:Int):Void {} + public static function glDepthMask(flag:Int):Void {} + public static function glDepthRange(n:hl.F64, f:hl.F64):Void {} + public static function glDepthRangeArrayv(first:Int, count:Int, v:hl.Ref):Void {} + public static function glDepthRangeIndexed(index:Int, n:hl.F64, f:hl.F64):Void {} + public static function glDepthRangef(n:hl.F32, f:hl.F32):Void {} + public static function glDetachShader(program:Int, shader:Int):Void {} + public static function glDisable(cap:Int):Void {} + public static function glDisableVertexAttribArray(index:Int):Void {} + public static function glDisablei(target:Int, index:Int):Void {} + public static function glDispatchCompute(num_groups_x:Int, num_groups_y:Int, num_groups_z:Int):Void {} + public static function glDispatchComputeIndirect(indirect:hl.Ref):Void {} + public static function glDrawArrays(mode:Int, first:Int, count:Int):Void {} + public static function glDrawArraysIndirect(mode:Int, indirect:hl.Bytes):Void {} + public static function glDrawArraysInstanced(mode:Int, first:Int, count:Int, instancecount:Int):Void {} + public static function glDrawArraysInstancedBaseInstance(mode:Int, first:Int, count:Int, instancecount:Int, baseinstance:Int):Void {} + public static function glDrawBuffer(buf:Int):Void {} + public static function glDrawBuffers(n:Int, bufs:hl.Ref):Void {} + public static function glDrawElements(mode:Int, count:Int, type:Int, indices:Int):Void {} + public static function glDrawElementsBaseVertex(mode:Int, count:Int, type:Int, indices:hl.Bytes, basevertex:Int):Void {} + public static function glDrawElementsIndirect(mode:Int, type:Int, indirect:hl.Bytes):Void {} + public static function glDrawElementsInstanced(mode:Int, count:Int, type:Int, indices:hl.Bytes, instancecount:Int):Void {} + public static function glDrawElementsInstancedBaseInstance(mode:Int, count:Int, type:Int, indices:hl.Bytes, instancecount:Int, baseinstance:Int):Void {} + public static function glDrawElementsInstancedBaseVertex(mode:Int, count:Int, type:Int, indices:hl.Bytes, instancecount:Int, basevertex:Int):Void {} + public static function glDrawElementsInstancedBaseVertexBaseInstance(mode:Int, count:Int, type:Int, indices:hl.Bytes, instancecount:Int, basevertex:Int, baseinstance:Int):Void {} + public static function glDrawRangeElements(mode:Int, start:Int, end:Int, count:Int, type:Int, indices:hl.Bytes):Void {} + public static function glDrawRangeElementsBaseVertex(mode:Int, start:Int, end:Int, count:Int, type:Int, indices:hl.Bytes, basevertex:Int):Void {} + public static function glDrawTransformFeedback(mode:Int, id:Int):Void {} + public static function glDrawTransformFeedbackInstanced(mode:Int, id:Int, instancecount:Int):Void {} + public static function glDrawTransformFeedbackStream(mode:Int, id:Int, stream:Int):Void {} + public static function glDrawTransformFeedbackStreamInstanced(mode:Int, id:Int, stream:Int, instancecount:Int):Void {} + public static function glEnable(cap:Int):Void {} + public static function glEnableVertexAttribArray(index:Int):Void {} + public static function glEnablei(target:Int, index:Int):Void {} + public static function glEndConditionalRender():Void {} + public static function glEndQuery(target:Int):Void {} + public static function glEndQueryIndexed(target:Int, index:Int):Void {} + public static function glEndTransformFeedback():Void {} + public static function glFenceSync(condition:Int, flags:Int):hl.Abstract<"GLSync"> { return null; } + public static function glFinish():Void {} + public static function glFlush():Void {} + public static function glFlushMappedBufferRange(target:Int, offset:hl.Ref, length:hl.Ref):Void {} + public static function glFramebufferParameteri(target:Int, pname:Int, param:Int):Void {} + public static function glFramebufferRenderbuffer(target:Int, attachment:Int, renderbuffertarget:Int, renderbuffer:Int):Void {} + public static function glFramebufferTexture(target:Int, attachment:Int, texture:Int, level:Int):Void {} + public static function glFramebufferTexture1D(target:Int, attachment:Int, textarget:Int, texture:Int, level:Int):Void {} + public static function glFramebufferTexture2D(target:Int, attachment:Int, textarget:Int, texture:Int, level:Int):Void {} + public static function glFramebufferTexture3D(target:Int, attachment:Int, textarget:Int, texture:Int, level:Int, zoffset:Int):Void {} + public static function glFramebufferTextureLayer(target:Int, attachment:Int, texture:Int, level:Int, layer:Int):Void {} + public static function glFrontFace(mode:Int):Void {} + public static function glGenBuffers():Int { return 0; } + public static function glGenFramebuffers():Int { return 0; } + public static function glGenProgramPipelines():Int { return 0; } + public static function glGenQueries():Int { return 0; } + public static function glGenRenderbuffers():Int { return 0; } + public static function glGenSamplers():Int { return 0; } + public static function glGenTextures():Int { return 0; } + public static function glGenTransformFeedbacks():Int { return 0; } + public static function glGenVertexArrays():Int { return 0; } + public static function glGenerateMipmap(target:Int):Void {} + public static function glGetActiveAtomicCounterBufferiv(program:Int, bufferIndex:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetActiveAttrib(program:Int, index:Int, bufSize:Int, length:hl.Ref, size:hl.Ref, type:hl.Ref, name:String):Void {} + public static function glGetActiveSubroutineName(program:Int, shadertype:Int, index:Int, bufSize:Int, length:hl.Ref, name:String):Void {} + public static function glGetActiveSubroutineUniformName(program:Int, shadertype:Int, index:Int, bufSize:Int, length:hl.Ref, name:String):Void {} + public static function glGetActiveSubroutineUniformiv(program:Int, shadertype:Int, index:Int, pname:Int, values:hl.Ref):Void {} + public static function glGetActiveUniform(program:Int, index:Int, bufSize:Int, length:hl.Ref, size:hl.Ref, type:hl.Ref, name:String):Void {} + public static function glGetActiveUniformBlockName(program:Int, uniformBlockIndex:Int, bufSize:Int, length:hl.Ref, uniformBlockName:String):Void {} + public static function glGetActiveUniformBlockiv(program:Int, uniformBlockIndex:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetActiveUniformName(program:Int, uniformIndex:Int, bufSize:Int, length:hl.Ref, uniformName:String):Void {} + public static function glGetActiveUniformsiv(program:Int, uniformCount:Int, uniformIndices:hl.Ref, pname:Int, params:hl.Ref):Void {} + public static function glGetAttachedShaders(program:Int, maxCount:Int, count:hl.Ref, shaders:hl.Ref):Void {} + public static function glGetAttribLocation(program:Int, name:String):Int { return 0; } + public static function glGetBooleani_v(target:Int, index:Int, data:hl.Ref):Void {} + public static function glGetBooleanv(pname:Int, data:hl.Ref):Void {} + public static function glGetBufferParameteri64v(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetBufferParameteriv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetBufferPointerv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetBufferSubData(target:Int, offset:hl.Ref, size:hl.Ref, data:hl.Bytes):Void {} + public static function glGetCompressedTexImage(target:Int, level:Int, img:hl.Bytes):Void {} + public static function glGetDebugMessageLog(count:Int, bufSize:Int, sources:hl.Ref, types:hl.Ref, ids:hl.Ref, severities:hl.Ref, lengths:hl.Ref, messageLog:String):Int { return 0; } + public static function glGetDoublei_v(target:Int, index:Int, data:hl.Ref):Void {} + public static function glGetDoublev(pname:Int, data:hl.Ref):Void {} + public static function glGetError():Int { return 0; } + public static function glGetFloati_v(target:Int, index:Int, data:hl.Ref):Void {} + public static function glGetFloatv(pname:Int, data:hl.Ref):Void {} + public static function glGetFragDataIndex(program:Int, name:String):Int { return 0; } + public static function glGetFragDataLocation(program:Int, name:String):Int { return 0; } + public static function glGetFramebufferAttachmentParameteriv(target:Int, attachment:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetFramebufferParameteriv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetInteger64i_v(target:Int, index:Int, data:hl.Ref):Void {} + public static function glGetInteger64v(pname:Int, data:hl.Ref):Void {} + public static function glGetIntegeri_v(target:Int, index:Int, data:hl.Ref):Void {} + public static function glGetIntegerv(pname:Int, data:hl.Ref):Void {} + public static function glGetInternalformati64v(target:Int, internalformat:Int, pname:Int, count:Int, params:hl.Ref):Void {} + public static function glGetInternalformativ(target:Int, internalformat:Int, pname:Int, count:Int, params:hl.Ref):Void {} + public static function glGetMultisamplefv(pname:Int, index:Int, val:hl.Ref):Void {} + public static function glGetObjectLabel(identifier:Int, name:Int, bufSize:Int, length:hl.Ref, label:String):Void {} + public static function glGetObjectPtrLabel(ptr:hl.Bytes, bufSize:Int, length:hl.Ref, label:String):Void {} + public static function glGetPointerv(pname:Int, params:hl.Ref):Void {} + public static function glGetProgramBinary(program:Int, bufSize:Int, length:hl.Ref, binaryFormat:hl.Ref, binary:hl.Bytes):Void {} + public static function glGetProgramInfoLog(program:Int, bufSize:Int, length:hl.Ref, infoLog:String):Void {} + public static function glGetProgramInterfaceiv(program:Int, programInterface:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetProgramPipelineInfoLog(pipeline:Int, bufSize:Int, length:hl.Ref, infoLog:String):Void {} + public static function glGetProgramPipelineiv(pipeline:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetProgramResourceIndex(program:Int, programInterface:Int, name:String):Int { return 0; } + public static function glGetProgramResourceLocation(program:Int, programInterface:Int, name:String):Int { return 0; } + public static function glGetProgramResourceLocationIndex(program:Int, programInterface:Int, name:String):Int { return 0; } + public static function glGetProgramResourceName(program:Int, programInterface:Int, index:Int, bufSize:Int, length:hl.Ref, name:String):Void {} + public static function glGetProgramResourceiv(program:Int, programInterface:Int, index:Int, propCount:Int, props:hl.Ref, count:Int, length:hl.Ref, params:hl.Ref):Void {} + public static function glGetProgramStageiv(program:Int, shadertype:Int, pname:Int, values:hl.Ref):Void {} + public static function glGetProgramiv(program:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetQueryIndexediv(target:Int, index:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetQueryObjecti64v(id:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetQueryObjectiv(id:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetQueryObjectui64v(id:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetQueryObjectuiv(id:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetQueryiv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetRenderbufferParameteriv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetSamplerParameterIiv(sampler:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetSamplerParameterIuiv(sampler:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetSamplerParameterfv(sampler:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetSamplerParameteriv(sampler:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetShaderInfoLog(shader:Int, bufSize:Int, length:hl.Ref, infoLog:String):Void {} + public static function glGetShaderPrecisionFormat(shadertype:Int, precisiontype:Int, range:hl.Ref, precision:hl.Ref):Void {} + public static function glGetShaderSource(shader:Int, bufSize:Int, length:hl.Ref, source:String):Void {} + public static function glGetShaderiv(shader:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetString(name:Int):String { return ''; } + public static function glGetStringi(name:Int, index:Int):String { return ''; } + public static function glGetSubroutineIndex(program:Int, shadertype:Int, name:String):Int { return 0; } + public static function glGetSubroutineUniformLocation(program:Int, shadertype:Int, name:String):Int { return 0; } + public static function glGetSynciv(sync:hl.Abstract<"GLSync">, pname:Int, count:Int, length:hl.Ref, values:hl.Ref):Void {} + public static function glGetTexImage(target:Int, level:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glGetTexLevelParameterfv(target:Int, level:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetTexLevelParameteriv(target:Int, level:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetTexParameterIiv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetTexParameterIuiv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetTexParameterfv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetTexParameteriv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetTransformFeedbackVarying(program:Int, index:Int, bufSize:Int, length:hl.Ref, size:hl.Ref, type:hl.Ref, name:String):Void {} + public static function glGetUniformBlockIndex(program:Int, uniformBlockName:String):Int { return 0; } + public static function glGetUniformIndices(program:Int, uniformCount:Int, uniformNames:hl.NativeArray, uniformIndices:hl.Ref):Void {} + public static function glGetUniformLocation(program:Int, name:String):Int { return 0; } + public static function glGetUniformSubroutineuiv(shadertype:Int, location:Int, params:hl.Ref):Void {} + public static function glGetUniformdv(program:Int, location:Int, params:hl.Ref):Void {} + public static function glGetUniformfv(program:Int, location:Int, params:hl.Ref):Void {} + public static function glGetUniformiv(program:Int, location:Int, params:hl.Ref):Void {} + public static function glGetUniformuiv(program:Int, location:Int, params:hl.Ref):Void {} + public static function glGetVertexAttribIiv(index:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetVertexAttribIuiv(index:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetVertexAttribLdv(index:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetVertexAttribPointerv(index:Int, pname:Int, pointer:hl.Ref):Void {} + public static function glGetVertexAttribdv(index:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetVertexAttribfv(index:Int, pname:Int, params:hl.Ref):Void {} + public static function glGetVertexAttribiv(index:Int, pname:Int, params:hl.Ref):Void {} + public static function glHint(target:Int, mode:Int):Void {} + public static function glInvalidateBufferData(buffer:Int):Void {} + public static function glInvalidateBufferSubData(buffer:Int, offset:hl.Ref, length:hl.Ref):Void {} + public static function glInvalidateFramebuffer(target:Int, numAttachments:Int, attachments:hl.Ref):Void {} + public static function glInvalidateSubFramebuffer(target:Int, numAttachments:Int, attachments:hl.Ref, x:Int, y:Int, width:Int, height:Int):Void {} + public static function glInvalidateTexImage(texture:Int, level:Int):Void {} + public static function glInvalidateTexSubImage(texture:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int):Void {} + public static function glIsBuffer(buffer:Int):Int { return 0; } + public static function glIsEnabled(cap:Int):Int { return 0; } + public static function glIsEnabledi(target:Int, index:Int):Int { return 0; } + public static function glIsFramebuffer(framebuffer:Int):Int { return 0; } + public static function glIsProgram(program:Int):Int { return 0; } + public static function glIsProgramPipeline(pipeline:Int):Int { return 0; } + public static function glIsQuery(id:Int):Int { return 0; } + public static function glIsRenderbuffer(renderbuffer:Int):Int { return 0; } + public static function glIsSampler(sampler:Int):Int { return 0; } + public static function glIsShader(shader:Int):Int { return 0; } + public static function glIsSync(sync:hl.Abstract<"GLSync">):Int { return 0; } + public static function glIsTexture(texture:Int):Int { return 0; } + public static function glIsTransformFeedback(id:Int):Int { return 0; } + public static function glIsVertexArray(array:Int):Int { return 0; } + public static function glLineWidth(width:hl.F32):Void {} + public static function glLinkProgram(program:Int):Void {} + public static function glLogicOp(opcode:Int):Void {} + public static function glMapBuffer(target:Int, access:Int):hl.Bytes { return null; } + public static function glMapBufferRange(target:Int, offset:hl.Ref, length:hl.Ref, access:Int):hl.Bytes { return null; } + public static function glMemoryBarrier(barriers:Int):Void {} + public static function glMinSampleShading(value:hl.F32):Void {} + public static function glMultiDrawArrays(mode:Int, first:hl.Ref, count:hl.Ref, drawcount:Int):Void {} + public static function glMultiDrawArraysIndirect(mode:Int, indirect:hl.Bytes, drawcount:Int, stride:Int):Void {} + public static function glMultiDrawElements(mode:Int, count:hl.Ref, type:Int, indices:hl.Ref, drawcount:Int):Void {} + public static function glMultiDrawElementsBaseVertex(mode:Int, count:hl.Ref, type:Int, indices:hl.Ref, drawcount:Int, basevertex:hl.Ref):Void {} + public static function glMultiDrawElementsIndirect(mode:Int, type:Int, indirect:hl.Bytes, drawcount:Int, stride:Int):Void {} + public static function glMultiTexCoordP1ui(texture:Int, type:Int, coords:Int):Void {} + public static function glMultiTexCoordP1uiv(texture:Int, type:Int, coords:hl.Ref):Void {} + public static function glMultiTexCoordP2ui(texture:Int, type:Int, coords:Int):Void {} + public static function glMultiTexCoordP2uiv(texture:Int, type:Int, coords:hl.Ref):Void {} + public static function glMultiTexCoordP3ui(texture:Int, type:Int, coords:Int):Void {} + public static function glMultiTexCoordP3uiv(texture:Int, type:Int, coords:hl.Ref):Void {} + public static function glMultiTexCoordP4ui(texture:Int, type:Int, coords:Int):Void {} + public static function glMultiTexCoordP4uiv(texture:Int, type:Int, coords:hl.Ref):Void {} + public static function glNormalP3ui(type:Int, coords:Int):Void {} + public static function glNormalP3uiv(type:Int, coords:hl.Ref):Void {} + public static function glObjectLabel(identifier:Int, name:Int, length:Int, label:String):Void {} + public static function glObjectPtrLabel(ptr:hl.Bytes, length:Int, label:String):Void {} + public static function glPatchParameterfv(pname:Int, values:hl.Ref):Void {} + public static function glPatchParameteri(pname:Int, value:Int):Void {} + public static function glPauseTransformFeedback():Void {} + public static function glPixelStoref(pname:Int, param:hl.F32):Void {} + public static function glPixelStorei(pname:Int, param:Int):Void {} + public static function glPointParameterf(pname:Int, param:hl.F32):Void {} + public static function glPointParameterfv(pname:Int, params:hl.Ref):Void {} + public static function glPointParameteri(pname:Int, param:Int):Void {} + public static function glPointParameteriv(pname:Int, params:hl.Ref):Void {} + public static function glPointSize(size:hl.F32):Void {} + public static function glPolygonMode(face:Int, mode:Int):Void {} + public static function glPolygonOffset(factor:hl.F32, units:hl.F32):Void {} + public static function glPopDebugGroup():Void {} + public static function glPrimitiveRestartIndex(index:Int):Void {} + public static function glProgramBinary(program:Int, binaryFormat:Int, binary:hl.Bytes, length:Int):Void {} + public static function glProgramParameteri(program:Int, pname:Int, value:Int):Void {} + public static function glProgramUniform1d(program:Int, location:Int, v0:hl.F64):Void {} + public static function glProgramUniform1dv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform1f(program:Int, location:Int, v0:hl.F32):Void {} + public static function glProgramUniform1fv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform1i(program:Int, location:Int, v0:Int):Void {} + public static function glProgramUniform1iv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform1ui(program:Int, location:Int, v0:Int):Void {} + public static function glProgramUniform1uiv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform2d(program:Int, location:Int, v0:hl.F64, v1:hl.F64):Void {} + public static function glProgramUniform2dv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform2f(program:Int, location:Int, v0:hl.F32, v1:hl.F32):Void {} + public static function glProgramUniform2fv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform2i(program:Int, location:Int, v0:Int, v1:Int):Void {} + public static function glProgramUniform2iv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform2ui(program:Int, location:Int, v0:Int, v1:Int):Void {} + public static function glProgramUniform2uiv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform3d(program:Int, location:Int, v0:hl.F64, v1:hl.F64, v2:hl.F64):Void {} + public static function glProgramUniform3dv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform3f(program:Int, location:Int, v0:hl.F32, v1:hl.F32, v2:hl.F32):Void {} + public static function glProgramUniform3fv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform3i(program:Int, location:Int, v0:Int, v1:Int, v2:Int):Void {} + public static function glProgramUniform3iv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform3ui(program:Int, location:Int, v0:Int, v1:Int, v2:Int):Void {} + public static function glProgramUniform3uiv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform4d(program:Int, location:Int, v0:hl.F64, v1:hl.F64, v2:hl.F64, v3:hl.F64):Void {} + public static function glProgramUniform4dv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform4f(program:Int, location:Int, v0:hl.F32, v1:hl.F32, v2:hl.F32, v3:hl.F32):Void {} + public static function glProgramUniform4fv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform4i(program:Int, location:Int, v0:Int, v1:Int, v2:Int, v3:Int):Void {} + public static function glProgramUniform4iv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniform4ui(program:Int, location:Int, v0:Int, v1:Int, v2:Int, v3:Int):Void {} + public static function glProgramUniform4uiv(program:Int, location:Int, count:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix2dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix2fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix2x3dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix2x3fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix2x4dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix2x4fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix3dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix3fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix3x2dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix3x2fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix3x4dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix3x4fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix4dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix4fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix4x2dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix4x2fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix4x3dv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProgramUniformMatrix4x3fv(program:Int, location:Int, count:Int, transpose:Int, value:hl.Ref):Void {} + public static function glProvokingVertex(mode:Int):Void {} + public static function glPushDebugGroup(source:Int, id:Int, length:Int, message:String):Void {} + public static function glQueryCounter(id:Int, target:Int):Void {} + public static function glReadBuffer(src:Int):Void {} + public static function glReadPixels(x:Int, y:Int, width:Int, height:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glReleaseShaderCompiler():Void {} + public static function glRenderbufferStorage(target:Int, internalformat:Int, width:Int, height:Int):Void {} + public static function glRenderbufferStorageMultisample(target:Int, samples:Int, internalformat:Int, width:Int, height:Int):Void {} + public static function glResumeTransformFeedback():Void {} + public static function glSampleCoverage(value:hl.F32, invert:Int):Void {} + public static function glSampleMaski(maskNumber:Int, mask:Int):Void {} + public static function glSamplerParameterIiv(sampler:Int, pname:Int, param:hl.Ref):Void {} + public static function glSamplerParameterIuiv(sampler:Int, pname:Int, param:hl.Ref):Void {} + public static function glSamplerParameterf(sampler:Int, pname:Int, param:hl.F32):Void {} + public static function glSamplerParameterfv(sampler:Int, pname:Int, param:hl.Ref):Void {} + public static function glSamplerParameteri(sampler:Int, pname:Int, param:Int):Void {} + public static function glSamplerParameteriv(sampler:Int, pname:Int, param:hl.Ref):Void {} + public static function glScissor(x:Int, y:Int, width:Int, height:Int):Void {} + public static function glScissorArrayv(first:Int, count:Int, v:hl.Ref):Void {} + public static function glScissorIndexed(index:Int, left:Int, bottom:Int, width:Int, height:Int):Void {} + public static function glScissorIndexedv(index:Int, v:hl.Ref):Void {} + public static function glSecondaryColorP3ui(type:Int, color:Int):Void {} + public static function glSecondaryColorP3uiv(type:Int, color:hl.Ref):Void {} + public static function glShaderBinary(count:Int, shaders:hl.Ref, binaryFormat:Int, binary:hl.Bytes, length:Int):Void {} + public static function glShaderSource(shader:Int, string:String):Void {} + public static function glShaderStorageBlockBinding(program:Int, storageBlockIndex:Int, storageBlockBinding:Int):Void {} + public static function glStencilFunc(func:Int, ref:Int, mask:Int):Void {} + public static function glStencilFuncSeparate(face:Int, func:Int, ref:Int, mask:Int):Void {} + public static function glStencilMask(mask:Int):Void {} + public static function glStencilMaskSeparate(face:Int, mask:Int):Void {} + public static function glStencilOp(fail:Int, zfail:Int, zpass:Int):Void {} + public static function glStencilOpSeparate(face:Int, sfail:Int, dpfail:Int, dppass:Int):Void {} + public static function glTexBuffer(target:Int, internalformat:Int, buffer:Int):Void {} + public static function glTexBufferRange(target:Int, internalformat:Int, buffer:Int, offset:hl.Ref, size:hl.Ref):Void {} + public static function glTexCoordP1ui(type:Int, coords:Int):Void {} + public static function glTexCoordP1uiv(type:Int, coords:hl.Ref):Void {} + public static function glTexCoordP2ui(type:Int, coords:Int):Void {} + public static function glTexCoordP2uiv(type:Int, coords:hl.Ref):Void {} + public static function glTexCoordP3ui(type:Int, coords:Int):Void {} + public static function glTexCoordP3uiv(type:Int, coords:hl.Ref):Void {} + public static function glTexCoordP4ui(type:Int, coords:Int):Void {} + public static function glTexCoordP4uiv(type:Int, coords:hl.Ref):Void {} + public static function glTexImage1D(target:Int, level:Int, internalformat:Int, width:Int, border:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glTexImage2D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glTexImage2_d_multisample(target:Int, samples:Int, internalformat:Int, width:Int, height:Int, fixedsamplelocations:Int):Void {} + public static function glTexImage3D(target:Int, level:Int, internalformat:Int, width:Int, height:Int, depth:Int, border:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glTexImage3_d_multisample(target:Int, samples:Int, internalformat:Int, width:Int, height:Int, depth:Int, fixedsamplelocations:Int):Void {} + public static function glTexParameterIiv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glTexParameterIuiv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glTexParameterf(target:Int, pname:Int, param:hl.F32):Void {} + public static function glTexParameterfv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glTexParameteri(target:Int, pname:Int, param:Int):Void {} + public static function glTexParameteriv(target:Int, pname:Int, params:hl.Ref):Void {} + public static function glTexStorage1D(target:Int, levels:Int, internalformat:Int, width:Int):Void {} + public static function glTexStorage2D(target:Int, levels:Int, internalformat:Int, width:Int, height:Int):Void {} + public static function glTexStorage2_d_multisample(target:Int, samples:Int, internalformat:Int, width:Int, height:Int, fixedsamplelocations:Int):Void {} + public static function glTexStorage3D(target:Int, levels:Int, internalformat:Int, width:Int, height:Int, depth:Int):Void {} + public static function glTexStorage3_d_multisample(target:Int, samples:Int, internalformat:Int, width:Int, height:Int, depth:Int, fixedsamplelocations:Int):Void {} + public static function glTexSubImage1D(target:Int, level:Int, xoffset:Int, width:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glTexSubImage2D(target:Int, level:Int, xoffset:Int, yoffset:Int, width:Int, height:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glTexSubImage3D(target:Int, level:Int, xoffset:Int, yoffset:Int, zoffset:Int, width:Int, height:Int, depth:Int, format:Int, type:Int, pixels:hl.Bytes):Void {} + public static function glTextureView(texture:Int, target:Int, origtexture:Int, internalformat:Int, minlevel:Int, numlevels:Int, minlayer:Int, numlayers:Int):Void {} + public static function glTransformFeedbackVaryings(program:Int, count:Int, varyings:hl.NativeArray, bufferMode:Int):Void {} + public static function glUniform1d(location:Int, x:hl.F64):Void {} + public static function glUniform1f(location:Int, v0:hl.F32):Void {} + public static function glUniform1i(location:Int, v0:Int):Void {} + public static function glUniform1ui(location:Int, v0:Int):Void {} + public static function glUniform2d(location:Int, x:hl.F64, y:hl.F64):Void {} + public static function glUniform2f(location:Int, v0:hl.F32, v1:hl.F32):Void {} + public static function glUniform2i(location:Int, v0:Int, v1:Int):Void {} + public static function glUniform2ui(location:Int, v0:Int, v1:Int):Void {} + public static function glUniform3d(location:Int, x:hl.F64, y:hl.F64, z:hl.F64):Void {} + public static function glUniform3f(location:Int, v0:hl.F32, v1:hl.F32, v2:hl.F32):Void {} + public static function glUniform3i(location:Int, v0:Int, v1:Int, v2:Int):Void {} + public static function glUniform3ui(location:Int, v0:Int, v1:Int, v2:Int):Void {} + public static function glUniform4d(location:Int, x:hl.F64, y:hl.F64, z:hl.F64, w:hl.F64):Void {} + public static function glUniform4f(location:Int, v0:hl.F32, v1:hl.F32, v2:hl.F32, v3:hl.F32):Void {} + public static function glUniform4i(location:Int, v0:Int, v1:Int, v2:Int, v3:Int):Void {} + public static function glUniform4ui(location:Int, v0:Int, v1:Int, v2:Int, v3:Int):Void {} + public static function glUniformMatrix2dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix2fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix2x3dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix2x3fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix2x4dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix2x4fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix3dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix3fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix3x2dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix3x2fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix3x4dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix3x4fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix4dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix4fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix4x2dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix4x2fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix4x3dv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUniformMatrix4x3fv(location:Int, count:Int, transpose:Int, value:hl.Bytes):Void {} + public static function glUnmapBuffer(target:Int):Int { return 0; } + public static function glUseProgram(program:Int):Void {} + public static function glUseProgramStages(pipeline:Int, stages:Int, program:Int):Void {} + public static function glValidateProgram(program:Int):Void {} + public static function glValidateProgramPipeline(pipeline:Int):Void {} + public static function glVertexAttrib1d(index:Int, x:hl.F64):Void {} + public static function glVertexAttrib1dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib1f(index:Int, x:hl.F32):Void {} + public static function glVertexAttrib1fv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib1s(index:Int, x:Int):Void {} + public static function glVertexAttrib1sv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib2d(index:Int, x:hl.F64, y:hl.F64):Void {} + public static function glVertexAttrib2dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib2f(index:Int, x:hl.F32, y:hl.F32):Void {} + public static function glVertexAttrib2fv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib2s(index:Int, x:Int, y:Int):Void {} + public static function glVertexAttrib2sv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib3d(index:Int, x:hl.F64, y:hl.F64, z:hl.F64):Void {} + public static function glVertexAttrib3dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib3f(index:Int, x:hl.F32, y:hl.F32, z:hl.F32):Void {} + public static function glVertexAttrib3fv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib3s(index:Int, x:Int, y:Int, z:Int):Void {} + public static function glVertexAttrib3sv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4Nbv(index:Int, v:String):Void {} + public static function glVertexAttrib4Niv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4Nsv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4Nub(index:Int, x:Int, y:Int, z:Int, w:Int):Void {} + public static function glVertexAttrib4Nubv(index:Int, v:String):Void {} + public static function glVertexAttrib4Nuiv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4Nusv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4bv(index:Int, v:String):Void {} + public static function glVertexAttrib4d(index:Int, x:hl.F64, y:hl.F64, z:hl.F64, w:hl.F64):Void {} + public static function glVertexAttrib4dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4f(index:Int, x:hl.F32, y:hl.F32, z:hl.F32, w:hl.F32):Void {} + public static function glVertexAttrib4fv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4iv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4s(index:Int, x:Int, y:Int, z:Int, w:Int):Void {} + public static function glVertexAttrib4sv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4ubv(index:Int, v:String):Void {} + public static function glVertexAttrib4uiv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib4usv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribBinding(attribindex:Int, bindingindex:Int):Void {} + public static function glVertexAttribDivisor(index:Int, divisor:Int):Void {} + public static function glVertexAttribFormat(attribindex:Int, size:Int, type:Int, normalized:Int, relativeoffset:Int):Void {} + public static function glVertexAttribI1i(index:Int, x:Int):Void {} + public static function glVertexAttribI1iv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI1ui(index:Int, x:Int):Void {} + public static function glVertexAttribI1uiv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI2i(index:Int, x:Int, y:Int):Void {} + public static function glVertexAttribI2iv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI2ui(index:Int, x:Int, y:Int):Void {} + public static function glVertexAttribI2uiv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI3i(index:Int, x:Int, y:Int, z:Int):Void {} + public static function glVertexAttribI3iv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI3ui(index:Int, x:Int, y:Int, z:Int):Void {} + public static function glVertexAttribI3uiv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI4bv(index:Int, v:String):Void {} + public static function glVertexAttribI4i(index:Int, x:Int, y:Int, z:Int, w:Int):Void {} + public static function glVertexAttribI4iv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI4sv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI4ubv(index:Int, v:String):Void {} + public static function glVertexAttribI4ui(index:Int, x:Int, y:Int, z:Int, w:Int):Void {} + public static function glVertexAttribI4uiv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribI4usv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib_i_format(attribindex:Int, size:Int, type:Int, relativeoffset:Int):Void {} + public static function glVertexAttrib_i_pointer(index:Int, size:Int, type:Int, stride:Int, pointer:hl.Bytes):Void {} + public static function glVertexAttribL1d(index:Int, x:hl.F64):Void {} + public static function glVertexAttribL1dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribL2d(index:Int, x:hl.F64, y:hl.F64):Void {} + public static function glVertexAttribL2dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribL3d(index:Int, x:hl.F64, y:hl.F64, z:hl.F64):Void {} + public static function glVertexAttribL3dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttribL4d(index:Int, x:hl.F64, y:hl.F64, z:hl.F64, w:hl.F64):Void {} + public static function glVertexAttribL4dv(index:Int, v:hl.Ref):Void {} + public static function glVertexAttrib_l_format(attribindex:Int, size:Int, type:Int, relativeoffset:Int):Void {} + public static function glVertexAttrib_l_pointer(index:Int, size:Int, type:Int, stride:Int, pointer:hl.Bytes):Void {} + public static function glVertexAttribP1ui(index:Int, type:Int, normalized:Int, value:Int):Void {} + public static function glVertexAttribP1uiv(index:Int, type:Int, normalized:Int, value:hl.Ref):Void {} + public static function glVertexAttribP2ui(index:Int, type:Int, normalized:Int, value:Int):Void {} + public static function glVertexAttribP2uiv(index:Int, type:Int, normalized:Int, value:hl.Ref):Void {} + public static function glVertexAttribP3ui(index:Int, type:Int, normalized:Int, value:Int):Void {} + public static function glVertexAttribP3uiv(index:Int, type:Int, normalized:Int, value:hl.Ref):Void {} + public static function glVertexAttribP4ui(index:Int, type:Int, normalized:Int, value:Int):Void {} + public static function glVertexAttribP4uiv(index:Int, type:Int, normalized:Int, value:hl.Ref):Void {} + public static function glVertexAttribPointer(index:Int, size:Int, type:Int, normalized:Int, stride:Int, offset:Int):Void {} + public static function glVertexBindingDivisor(bindingindex:Int, divisor:Int):Void {} + public static function glVertexP2ui(type:Int, value:Int):Void {} + public static function glVertexP2uiv(type:Int, value:hl.Ref):Void {} + public static function glVertexP3ui(type:Int, value:Int):Void {} + public static function glVertexP3uiv(type:Int, value:hl.Ref):Void {} + public static function glVertexP4ui(type:Int, value:Int):Void {} + public static function glVertexP4uiv(type:Int, value:hl.Ref):Void {} + public static function glViewport(x:Int, y:Int, width:Int, height:Int):Void {} + public static function glViewportArrayv(first:Int, count:Int, v:hl.Ref):Void {} + public static function glViewportIndexedf(index:Int, x:hl.F32, y:hl.F32, w:hl.F32, h:hl.F32):Void {} + public static function glViewportIndexedfv(index:Int, v:hl.Ref):Void {} + public static function glWaitSync(sync:hl.Abstract<"GLSync">, flags:Int, timeout:hl.I64):Void {} + + public static function gladLoadGl():Int { return 0; } +} \ No newline at end of file diff --git a/src/lemons/display/render/drivers/Driver.hx b/src/lemons/display/render/drivers/Driver.hx new file mode 100644 index 0000000..fcbfe00 --- /dev/null +++ b/src/lemons/display/render/drivers/Driver.hx @@ -0,0 +1,51 @@ +package lemons.display.render.drivers; + +import lemons.display.render.Window; +import lemons.geometry.Matrix; +import lemons.display.shader.Shader; +import lemons.display.render.Buffer; +import lemons.display.render.Renderer.DataType; + +class Driver { + public var backgroundColor:Color = 0x00000000; + public function new() {} + public function init():Bool { return false; } + public function prepare() {} + public function setViewport(x:Int, y:Int, width:Int, height:Int) {} + public function selectWindow(window:Window) {} + public function createBuffer():Int { return 0; } + public function selectBuffer(buf:Int, type:BufferType) {} + + public function createVertexArray():Int { return 0; } + public function setupVertexArray(index:Int, size:Int, type:DataType, stride:Int, offset:Int) {} + public function selectVertexArray(vertArray:Int) {} + public function toggleVertexArrayAttr(index:Int, enabled:Bool) {} + public function deleteVertexArray(arr:Int) {} + + public function drawElements(offset:Int, length:Int) {} + + public function createShader(type:ShaderType):Int { return 0; } + public function compileShader(shader:Int, source:String):{ success:Bool, error:String } { return null; } + public function shaderWriteMatrix(shader:Int, name:String, matrix:Matrix) {} + + // i cant overload these! stupid!!!!!!!!! + public function bufferData(buf:Int, bufferType:BufferType, data:Array, size:Int, mode:BufferUploadMode) {} + public function bufferDataInt(buf:Int, bufferType:BufferType, data:Array, size:Int, mode:BufferUploadMode) {} + + function getBufferUploadMode(type:BufferUploadMode):Int { return 0; } + function getBufferType(type:BufferType):Int { return 0; } + function getDataType(type:DataType):Int { return 0; } + + public function createProgram():Int { return 0; } + public function deleteProgram(prog:Int) {} + public function addToProgram(prog:Int, shad:Int) {} + public function compileProgram(prog:Int):{ success:Bool, ?error:String } { return null; } + public function selectProgram(program:Int) {} + + function getDataSize(type:DataType):Int { + return switch(type) { + case INT | SINGLE: 4; + default: 0; + } + } +} \ No newline at end of file diff --git a/src/lemons/display/render/drivers/OpenGLDriver.hx b/src/lemons/display/render/drivers/OpenGLDriver.hx new file mode 100644 index 0000000..029f121 --- /dev/null +++ b/src/lemons/display/render/drivers/OpenGLDriver.hx @@ -0,0 +1,186 @@ +package lemons.display.render.drivers; + +import lemons.display.render._internal.OpenGL; +import lemons.display.render._internal.GLFW; +import lemons.display.render.Window; +import lemons.display.shader.Shader; +import lemons.display.render.Buffer; +import lemons.display.render.Renderer.DataType; +import lemons.geometry.Matrix; + +import haxe.macro.Expr; +import haxe.macro.Context; + +class OpenGLDriver extends Driver { + var functionCallStack:Array<{name:String, method:String, error:Int}> = []; + inline function pushToStack(name:String, method:String) { + functionCallStack.push({name: name, method: method, error: OpenGL.glGetError()}); + } + + function dump() { + for (call in functionCallStack) trace('Called ${call.name} in ${call.method} and returned ${call.error.hex(4)}'); + functionCallStack = []; + } + + override public function init():Bool { + final result:Int = OpenGL.gladLoadGl(); + OpenGL.glFinish(); + return result != 0; + } + + override public function selectWindow(window:Window) { + GLFW.glfwMakeContextCurrent((cast window).windowHandle); + } + + override public function setViewport(x:Int, y:Int, width:Int, height:Int) { + OpenGL.glViewport(x, y, width, height); + } + + override public function prepare() { + OpenGL.glUseProgram(0); + OpenGL.glColorMask(OpenGL.GL_TRUE, OpenGL.GL_TRUE, OpenGL.GL_TRUE, OpenGL.GL_TRUE); + OpenGL.glClearColor(backgroundColor.redFloat, backgroundColor.greenFloat, backgroundColor.blueFloat, backgroundColor.alphaFloat); + OpenGL.glDepthMask(OpenGL.GL_TRUE); + OpenGL.glClearDepth(1); + OpenGL.glClearStencil(0); + OpenGL.glClear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT | OpenGL.GL_STENCIL_BUFFER_BIT); + } + + override public function createBuffer():Int { + var buf = OpenGL.glGenBuffers(); + return buf; + } + + override public function selectBuffer(buf:Int, type:BufferType) { + OpenGL.glBindBuffer(getBufferType(type), buf); + } + + override public function createVertexArray():Int { + var arr = OpenGL.glGenVertexArrays(); + return arr; + } + + override public function setupVertexArray(index:Int, size:Int, type:DataType, stride:Int, offset:Int) { + OpenGL.glVertexAttribPointer(index, size, getDataType(type), OpenGL.GL_FALSE, stride * getDataSize(type), offset * getDataSize(type)); + } + + override public function selectVertexArray(vertArray:Int) { + OpenGL.glBindVertexArray(vertArray); + } + + override public function toggleVertexArrayAttr(index:Int, enabled:Bool) { + if (enabled) OpenGL.glEnableVertexAttribArray(index); + else OpenGL.glDisableVertexAttribArray(index); + } + + override public function deleteVertexArray(arr:Int) { + var siz:hl.Ref = cast arr; + OpenGL.glDeleteVertexArrays(1, siz); + } + + override public function createShader(type:ShaderType):Int { + var shader = OpenGL.glCreateShader(switch (type) { + case VERTEX: OpenGL.GL_VERTEX_SHADER; + case PIXEL: OpenGL.GL_FRAGMENT_SHADER; + }); + return shader; + } + + override public function compileShader(shader:Int, source:String):{ success:Bool, ?error:String } { + OpenGL.glShaderSource(shader, source); + OpenGL.glCompileShader(shader); // i guess we doin shader compilation error now + var success = 0; + OpenGL.glGetShaderiv(shader, OpenGL.GL_COMPILE_STATUS, success); + if (success == 0) { + var str = ''; + OpenGL.glGetShaderInfoLog(shader, 512, null, str); + + // reencode these int utf16 since string uses utf16 internally + var outLen = 0; + @:privateAccess str.bytes = str.bytes.utf8ToUtf16(0, outLen); + + return {success: false, error: str}; + } + return {success: true}; + } + + override public function createProgram():Int { + final prog = OpenGL.glCreateProgram(); + return prog; + } + + override public function deleteProgram(prog:Int) { + OpenGL.glDeleteProgram(prog); + } + + override public function addToProgram(prog:Int, shad:Int) { + OpenGL.glAttachShader(prog, shad); + } + + override public function compileProgram(prog:Int):{ success:Bool, ?error:String } { + OpenGL.glLinkProgram(prog); + var success = 0; + OpenGL.glGetProgramiv(prog, OpenGL.GL_LINK_STATUS, success); + if (success == 0) { + var str = ''; + OpenGL.glGetProgramInfoLog(prog, 512, null, str); + + // reencode these int utf16 since string uses utf16 internally + var outLen = 0; + @:privateAccess str.bytes = str.bytes.utf8ToUtf16(0, outLen); + + return {success: false, error: str}; + } + return {success: true}; + } + + override public function selectProgram(prog:Int) { + OpenGL.glUseProgram(prog); + } + + override public function drawElements(offset:Int, length:Int) { + OpenGL.glDrawElements(OpenGL.GL_TRIANGLES, length, OpenGL.GL_UNSIGNED_INT, 0); + } + + override public function bufferData(buf:Int, bufferType:BufferType, data:Array, size:Int, mode:BufferUploadMode) { + final type = getBufferType(bufferType); + OpenGL.glBindBuffer(type, buf); + OpenGL.glBufferData(type, size, hl.Bytes.getArray(data), getBufferUploadMode(mode)); + } + + override public function bufferDataInt(buf:Int, bufferType:BufferType, data:Array, size:Int, mode:BufferUploadMode) { + final type = getBufferType(bufferType); + OpenGL.glBindBuffer(type, buf); + OpenGL.glBufferData(type, size, hl.Bytes.getArray(data), getBufferUploadMode(mode)); + } + + override public function shaderWriteMatrix(prog:Int, name:String, matrix:Matrix) { + var loc = OpenGL.glGetUniformLocation(prog, name); + var vector:haxe.ds.Vector = matrix; + OpenGL.glUniformMatrix4fv(loc, 1, OpenGL.GL_FALSE, hl.Bytes.getArray(vector.toData())); + } + + override function getBufferType(type:BufferType):Int { + return switch(type) { + case VERTEX: OpenGL.GL_ARRAY_BUFFER; + case ELEMENT: OpenGL.GL_ELEMENT_ARRAY_BUFFER; + }; + } + + override function getDataType(type:DataType):Int { + return switch(type) { + case INT: OpenGL.GL_UNSIGNED_INT; + case SINGLE: OpenGL.GL_FLOAT; + }; + } + + override function getBufferUploadMode(type:BufferUploadMode):Int { + return switch(type) { + case STREAM: OpenGL.GL_STREAM_DRAW; + case STATIC: OpenGL.GL_STATIC_DRAW; + case DYNAMIC: OpenGL.GL_DYNAMIC_DRAW; + }; + } +} + + diff --git a/src/lemons/display/shader/Program.hx b/src/lemons/display/shader/Program.hx new file mode 100644 index 0000000..2510853 --- /dev/null +++ b/src/lemons/display/shader/Program.hx @@ -0,0 +1,88 @@ +package lemons.display.shader; + +import lemons.display.render.Renderer.DataType; +import lemons.geometry.Matrix; + +typedef Attributes = Array<{size:Int, type:DataType, stride:Int, offset:Int}> + +enum UniformWriteDataType { + MATRIX; +} + +class UniformWrite { + public var next:UniformWrite; + public var value(default, null):Any; + public var type(default, null):UniformWriteDataType; + public var uniform(default, null):String; + + public function new(value:Any, type:UniformWriteDataType, uniform:String) { + this.value = value; + this.type = type; + this.uniform = uniform; + } +} + + +@:allow(lemons.display.render.Renderer) +class Program { + var _nativeHandle:Int = -1; + var _needsAllocation:Bool; + var _uniformQueue(default, null):UniformWrite = null; + + var attributes:Attributes = _defaultAttributes; + + public var vertexShader(default, null):Shader = _defaultVertexShader; + public var pixelShader(default, null):Shader = _defaultPixelShader; + + // TODO: embed these shaders when i make the macro for it + static var _defaultVertexShader:Shader = Shader.fromString(VERTEX, ' + #version 330 core + layout (location = 0) in vec3 vecPos; + layout (location = 1) in vec2 vecUV; + out vec2 uv; + + uniform mat4 trans; + uniform mat4 proj; + + void main(void) { + gl_Position = proj * trans * vec4(vecPos, 1.0); + uv = vecUV; + }'); + + static var _defaultPixelShader:Shader = Shader.fromString(PIXEL, ' + #version 330 core + in vec2 uv; + out vec4 pixelColor; + + void main() + { + pixelColor = vec4(1.0f, 1.0f, 1.0f, 1.0f); + }'); + + static var _defaultAttributes:Attributes = [{/* pos */ size: 3, type: SINGLE, stride: 5, offset: 0}, {/* uv */ size: 2, type: SINGLE, stride: 5, offset: 3}]; + + + public function new() { + _needsAllocation = true; + } + + public function setShader(?vertexShader:Shader, ?pixelShader:Shader) { + if (vertexShader != null) this.vertexShader = vertexShader; + if (pixelShader != null) this.pixelShader = pixelShader; + _needsAllocation = true; + } + + inline public function writeMat4(name:String, mat:Matrix) writeUniform(new UniformWrite(mat, MATRIX, name)); + + // maybe refactor this list to be reversed instead? if someone thats stupid sets like 89524103 uniforms this will take a lot of cycles + function writeUniform(item:UniformWrite):Void { + if (_uniformQueue == null) { + _uniformQueue = item; + return; + } + + var topItem:UniformWrite = _uniformQueue; + while (topItem.next != null) topItem = topItem.next; + topItem.next = item; + } +} diff --git a/src/lemons/display/shader/Shader.hx b/src/lemons/display/shader/Shader.hx new file mode 100644 index 0000000..df0df32 --- /dev/null +++ b/src/lemons/display/shader/Shader.hx @@ -0,0 +1,47 @@ +package lemons.display.shader; + +import lemons.display.render.Renderer; +import lemons.geometry.Matrix; + +enum abstract ShaderType(Int) to Int { + var VERTEX = 0; + var PIXEL = 1; +} + +/** + * `Shader` contains info on how the gpu should draw your object. you can create vertex (position) or pixel shaders and use them for drawing + * + * these shaders are written in GLSL ([OpenGL Shading Language](https://wikipedia.org/wiki/OpenGL_Shading_Language)) and transpiled to the renderer the game uses + * + * you're able to create shaders by either: + * embedding them + * ```haxe + * @:shader(PIXEL, 'code') + * class SomePixelShader extends Shader {} + * + * ``` + * or loading them from a string or resource + * ```haxe + * final somePixelShader:Shader = Shader.fromResource(PIXEL, /*some resource here*\/); + * ``` + * + * TODO: write some lexer and transpiler for glsl since all the transpilers i can find are in c++ and not c +**/ +@:allow(lemons.display.render.Renderer) +class Shader { + public var shaderType(default, null):ShaderType = VERTEX; + + var _source:String; + var _nativeHandle:Int = -1; + var _compiled:Bool = false; + + private function new(shaderType:ShaderType) { + this.shaderType = shaderType; + } + + public static function fromString(type:ShaderType, source:String):Shader { + final shader:Shader = new Shader(type); + shader._source = source; + return shader; + } +} \ No newline at end of file diff --git a/src/lemons/geom/Matrix4.hx b/src/lemons/geom/Matrix4.hx deleted file mode 100644 index 962b149..0000000 --- a/src/lemons/geom/Matrix4.hx +++ /dev/null @@ -1,65 +0,0 @@ -package lemons.geom; - -import lemons.geom.Vector2; -import lemons.geom.Vector3; - -abstract Matrix4(Array) to Array { - public function new() { - identity(); - } - - inline public function identity() - this = [1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1]; - - public function translateByVector2(vector:Vector2):Void { - this[3] += vector.x; - this[7] += vector.y; - } - - public function translateByVector3(vector:Vector3):Void { - this[3] += vector.x; - this[7] += vector.y; - this[10] += vector.z; - } - - public function scaleByVector2(vector:Vector2):Void { - this[0] *= vector.x; - this[5] *= vector.y; - } - - public function scaleByVector3(vector:Vector3):Void { - this[0] *= vector.x; - this[5] *= vector.y; - this[10] *= vector.z; - } - - public function rotateX(angle:Float):Void { - var cosAngle:Float = Math.cos(angle); - var sinAngle:Float = Math.sin(angle); - - this[5] += cosAngle; - this[6] += -sinAngle; - this[9] += sinAngle; - this[10] += cosAngle; - } - - static public function orthographic(left:Float, right:Float, top:Float, bottom:Float) { - var matrix:Matrix4 = new Matrix4(); - - var sx = 1.0 / (right - left); - var sy = 1.0 / (bottom - top); - matrix[0] = 2.0 * sx; - matrix[5] = 2.0 * sy; - matrix[12] = -(left + right) * sx; - matrix[13] = -(top + bottom) * sy; - - return matrix; - } - - public function toGLByteShit():hl.Bytes - return hl.Bytes.getArray(this); - -} \ No newline at end of file diff --git a/src/lemons/geom/Vector0.hx b/src/lemons/geom/Vector0.hx deleted file mode 100644 index d6ec59b..0000000 --- a/src/lemons/geom/Vector0.hx +++ /dev/null @@ -1,7 +0,0 @@ -package lemons.geom; - -/* - * A vector with zero variables, thanks nint - * @see -*/ -#if gen_docs @:keep #end class Vector0 { } \ No newline at end of file diff --git a/src/lemons/geom/Vector2.hx b/src/lemons/geom/Vector2.hx deleted file mode 100644 index e1f7299..0000000 --- a/src/lemons/geom/Vector2.hx +++ /dev/null @@ -1,11 +0,0 @@ -package lemons.geom; - -class Vector2 { - public var x:Float; - public var y:Float; - - public function new(x:Float, y:Float) { - this.x = x; - this.y = y; - } -} \ No newline at end of file diff --git a/src/lemons/geom/Vector3.hx b/src/lemons/geom/Vector3.hx deleted file mode 100644 index 96862ff..0000000 --- a/src/lemons/geom/Vector3.hx +++ /dev/null @@ -1,13 +0,0 @@ -package lemons.geom; - -class Vector3 { - public var x:Float; - public var y:Float; - public var z:Float; - - public function new(x:Float, y:Float, z:Float) { - this.x = x; - this.y = y; - this.z = z; - } -} \ No newline at end of file diff --git a/src/lemons/geometry/Matrix.hx b/src/lemons/geometry/Matrix.hx new file mode 100644 index 0000000..d916a1e --- /dev/null +++ b/src/lemons/geometry/Matrix.hx @@ -0,0 +1,90 @@ +package lemons.geometry; + +import haxe.ds.Vector; + +/** + * a 4x4 matrix. what else would it be? +**/ +abstract Matrix(Vector) to Vector { + + private function new(vec:Vector):Void { + if (vec.length != 16) throw 'Vector must be 16 Singles long'; + this = vec; + } + + @:from public static function fromArray(arr:Array):Matrix { + var matrix = new Matrix(Vector.fromArrayCopy(arr)); + return matrix; + } + + public static function fromIdentity():Matrix { + var matrix = new Matrix(new Vector(16)); + matrix.identity(); + return matrix; + } + + public function transform(x:Float, y:Float):Void { + this[12] += x; + this[13] += y; + } + + inline public function scale(x:Single, y:Single):Void { + this = mult(fromArray([ + x, 0, 0, 0, + 0, y, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1])); + } + + inline public function rotate(theta:Float):Void { + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + this = mult(fromArray([ + cosTheta, -sinTheta, 0, 0, + sinTheta, cosTheta, 0, 0, + 0, 0, 1, 0, + 0, 0, 0, 1])); + } + + public function identity():Void { + this[0] = 1; this[1] = 0; this[2] = 0; this[3] = 0; + this[4] = 0; this[5] = 1; this[6] = 0; this[7] = 0; + this[8] = 0; this[9] = 0; this[10] = 1; this[11] = 0; + this[12] = 0; this[13] = 0; this[14] = 0; this[15] = 1; + } + + public function orthographic(left:Float, right:Float, top:Float, bottom:Float, far:Float, near:Float):Void { + this[0] = 2 / (right - left); this[1] = 0; this[2] = 0; this[3] = 0; + this[4] = 0; this[5] = 2 / (top - bottom); this[6] = 0; this[7] = 0; + this[8] = 0; this[9] = 0; this[10] = -2 / (far - near); this[11] = 0; + this[12] = -((right + left) / (right - left)); this[13] = -((top + bottom) / (top - bottom)); this[14] = -((far + near) / (far - near)); this[15] = 1; + } + + @:op(A * B) public function mult(mat:Matrix):Matrix { + return fromArray([ + this[0] * mat[0] + this[1] * mat[4] + this[2] * mat[8] + this[3] * mat[12], + this[0] * mat[1] + this[1] * mat[5] + this[2] * mat[9] + this[3] * mat[13], + this[0] * mat[2] + this[1] * mat[6] + this[2] * mat[10] + this[3] * mat[14], + this[0] * mat[3] + this[1] * mat[7] + this[2] * mat[11] + this[3] * mat[15], + + this[4] * mat[0] + this[5] * mat[4] + this[6] * mat[8] + this[7] * mat[12], + this[4] * mat[1] + this[5] * mat[5] + this[6] * mat[9] + this[7] * mat[13], + this[4] * mat[2] + this[5] * mat[6] + this[6] * mat[10] + this[7] * mat[14], + this[4] * mat[3] + this[5] * mat[7] + this[6] * mat[11] + this[7] * mat[15], + + this[8] * mat[0] + this[9] * mat[4] + this[10] * mat[8] + this[11] * mat[12], + this[8] * mat[1] + this[9] * mat[5] + this[10] * mat[9] + this[11] * mat[13], + this[8] * mat[2] + this[9] * mat[6] + this[10] * mat[10] + this[11] * mat[14], + this[8] * mat[3] + this[9] * mat[7] + this[10] * mat[11] + this[11] * mat[15], + + this[12] * mat[0] + this[13] * mat[4] + this[14] * mat[8] + this[15] * mat[12], + this[12] * mat[1] + this[13] * mat[5] + this[14] * mat[9] + this[15] * mat[13], + this[12] * mat[2] + this[13] * mat[6] + this[14] * mat[10] + this[15] * mat[14], + this[12] * mat[3] + this[13] * mat[7] + this[14] * mat[11] + this[15] * mat[15], + ]); + } + + @:op([]) public function get(comp:Int):Single return this[comp]; + @:op([]) public function set(comp:Int, value:Single) this[comp] = value; + +} \ No newline at end of file diff --git a/src/lemons/geometry/Rect.hx b/src/lemons/geometry/Rect.hx new file mode 100644 index 0000000..cb0f1c7 --- /dev/null +++ b/src/lemons/geometry/Rect.hx @@ -0,0 +1,45 @@ +package lemons.geometry; + +/** + * a rectangle. what else would it be? +**/ +class Rect { + public var x:Float; + public var y:Float; + public var width:Float; + public var height:Float; + + public var left(get, set):Float; + public var bottom(get, set):Float; + public var top(get, set):Float; + public var right(get, set):Float; + + public function new(x:Float, y:Float, width:Float, height:Float):Void { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } + + /** + * check for if another rectangle is colliding/intersecting this one + **/ + public function rectColliding(otherRect:Rect):Bool { + // watch out! its the gay rectangle intersect check + return (this.left < otherRect.right && this.right > otherRect.left && + this.top > otherRect.bottom && this.bottom < otherRect.top); + } + + + function get_left():Float return x; + function set_left(lef:Float):Float return x = lef; + + function get_top():Float return y; + function set_top(topp:Float):Float return y = topp; + + function get_bottom():Float return y + height; + function set_bottom(bot:Float):Float return height = bot - y; + + function get_right():Float return x + width; + function set_right(rig:Float):Float return width = rig - x; +} \ No newline at end of file diff --git a/src/lemons/import.hx b/src/lemons/import.hx new file mode 100644 index 0000000..215afb7 --- /dev/null +++ b/src/lemons/import.hx @@ -0,0 +1,3 @@ +import lemons.util.IDestroyable; +import lemons.display.Color; +using StringTools; \ No newline at end of file diff --git a/src/lemons/resource/Image.hx b/src/lemons/resource/Image.hx new file mode 100644 index 0000000..0741689 --- /dev/null +++ b/src/lemons/resource/Image.hx @@ -0,0 +1,41 @@ +package lemons.display; + +import haxe.io.Bytes; + + +/** + * specifies in what colour format the raw image data is stored in +**/ +enum abstract ImageFormat(Int) to Int { + /** + * indicates 4 values in order of red, green, blue and alpha, all using 8 bits and 32 bits in total + **/ + var RGBA32 = 0; + + /** + * indicates a greyscale image with only one value, red, using 8 bits + **/ + var RED8 = 1; + + /** + * red 8 more like uhhhhhhhhh red 40 + * haha get it + * red 40 + * + * red fourty + * + * nevertheless, this is the same as `RED8` + **/ + var RED40 = 1; +} + +/** + * an image +**/ +class Image { + public final bytes:Bytes; + + function new(bytes:Bytes, format:ImageFormat) { + this.bytes = bytes; + } +} \ No newline at end of file diff --git a/src/lemons/sound/Sound.hx b/src/lemons/sound/Sound.hx deleted file mode 100644 index 8f0d7c3..0000000 --- a/src/lemons/sound/Sound.hx +++ /dev/null @@ -1,162 +0,0 @@ -package lemons.sound; - -import openal.*; -import hl.Bytes; -import lemons.geom.Vector3; - -import lemons.sound.SoundData; -import lemons.sound.filters.Filters.Filter; -import lemons.sound.effects.Effects.Effect; -import lemons.util.IDestroyable; - -import sys.io.File; - -class Sound implements IDestroyable { - public static var tempBytes:Bytes; - public var alSource:AL.Source; - private var alEffectSlot:EFX.EffectSlot; - - public var data:SoundData; - - public var duration(default, null):Float; - public var time(get, set):Float; - - @:isVar public var loop(get, set):Bool; - - @:isVar public var pitch(get, set):Float; - @:isVar public var volume(get, set):Float; - - public var pan(default, set):Float; - public var velocity(default, set):Vector3; - - public var filter(default, set):Filter; - public var effect(default, set):Effect; - - public function new():Void { - AL.genSources(1, tempBytes); - alSource = AL.Source.ofInt(tempBytes.getI32(0)); - - EFX.genAuxiliaryEffectSlots(1, tempBytes); - alEffectSlot = EFX.EffectSlot.ofInt(tempBytes.getI32(0)); - AL.source3i(alSource, EFX.AUXILIARY_SEND_FILTER, alEffectSlot.toInt(), 0, EFX.FILTER_NULL); - - AL.sourcei(alSource, AL.SOURCE_RELATIVE, AL.TRUE); - pan = 0.5; - velocity = new Vector3(0, 0, 0); - - pitch = 1; - volume = 1; - - loop = false; - } - - public function loadBuffer(buffer:AL.Buffer) { - AL.sourcei(alSource, AL.BUFFER, buffer.toInt()); - duration = AL.getBufferi(buffer, AL.SIZE) / (AL.getBufferi(buffer, AL.CHANNELS) * (AL.getBufferi(buffer, AL.BITS) / 8)); - } - - public function loadSoundData(data:SoundData) { - this.data = data; - loadBuffer(data.alBuffer); - } - - public function play():Void - AL.sourcePlay(alSource); - - public function pause():Void - AL.sourcePause(alSource); - - public function destroy():Void { - tempBytes.setI32(0, alEffectSlot.toInt()); - EFX.deleteAuxiliaryEffectSlots(1, tempBytes); - - tempBytes.setI32(0, alSource.toInt()); - AL.deleteSources(1, tempBytes); - - data = null; - } - - public static function getErrorString(?error:Int):String { - if (error == null) error = AL.getError(); - return switch(error) { - case AL.NO_ERROR: 'No error'; - case AL.INVALID_NAME: 'Invalid name'; - case AL.INVALID_ENUM: 'Invalid enum'; - case AL.INVALID_VALUE: 'Invalid value'; - case AL.INVALID_OPERATION: 'Invalid operation'; - case AL.OUT_OF_MEMORY: 'Out of memory'; - default: 'Unknown'; - } - } - - private static function __init__() { - @:privateAccess tempBytes = Bytes.alloc(1); - var device = ALC.openDevice(ALC.getString(null, ALC.DEFAULT_DEVICE_SPECIFIER)); - var context = ALC.createContext(device, tempBytes); - - ALC.makeContextCurrent(context); - } - - @:allow(lemons.App) - private static function stopEngine() { - var context:ALC.Context = ALC.getCurrentContext(); - var device:ALC.Device = ALC.getContextsDevice(context); - ALC.closeDevice(device); - ALC.destroyContext(context); - } - - function get_loop():Bool return (AL.getSourcei(alSource, AL.LOOPING)) == 1; - function set_loop(value:Bool):Bool { - AL.sourcei(alSource, AL.LOOPING, (value ? 1 : 0)); - return loop = value; - } - - function get_time():Float return AL.getSourcef(alSource, AL.SEC_OFFSET); - function set_time(value:Float):Float { - AL.sourcef(alSource, AL.SEC_OFFSET, value); - return volume = value; - } - - function set_filter(value:Filter):Filter { - AL.sourcei(alSource, EFX.DIRECT_FILTER, value.alFilter.toInt()); - return filter = value; - } - - function set_effect(value:Effect):Effect { - EFX.auxiliaryEffectSloti(alEffectSlot, EFX.EFFECTSLOT_EFFECT, value.alEffect.toInt()); - return effect = value; - } - - function get_volume():Float return AL.getSourcef(alSource, AL.GAIN); - function set_volume(value:Float):Float { - AL.sourcef(alSource, AL.GAIN, value); - return volume = value; - } - - function get_pitch():Float return AL.getSourcef(alSource, AL.PITCH); - function set_pitch(value:Float):Float { - AL.sourcef(alSource, AL.PITCH, value); - return pitch = value; - } - - function set_pan(value:Float):Float { - AL.source3f(alSource, AL.POSITION, value * 2 - 1, 0, 0); - return pan = value; - } - - function set_velocity(value:Vector3):Vector3 { - AL.source3f(alSource, AL.POSITION, value.x, value.y, value.z); - return velocity = value; - } - - - public static function createFromBytes(data:haxe.io.Bytes):Sound { - var sound:Sound = new Sound(); - sound.loadSoundData(SoundData.createFromBytes(data)); - return sound; - } - - public static function createFromFile(path:String):Sound - return Sound.createFromBytes(File.getBytes(path)); - -} \ No newline at end of file diff --git a/src/lemons/sound/SoundData.hx b/src/lemons/sound/SoundData.hx deleted file mode 100644 index 0812b68..0000000 --- a/src/lemons/sound/SoundData.hx +++ /dev/null @@ -1,163 +0,0 @@ -package lemons.sound; - -import format.wav.Reader as WavReader; -import format.wav.Data.WAVE as WavData; -import openal.*; -import haxe.io.Bytes; -import haxe.io.BytesInput; -import lemons.sound.Sound; -import hl.Ref; -import hl.Format; -import hl.Format.OGG; -import lemons.util.IDestroyable; -import haxe.io.Path; - -/** - * Class that holds the info and data of the sound - * - * Basically a wrappper for openal's buffer -**/ -class SoundData implements IDestroyable { - @:allow(lemons.sound.Sound) - private var alBuffer:AL.Buffer; - - /** - * Format value used for OpenAL - **/ - public var format:Int; - - /** - * The sound's sample rate - **/ - public var sampleRate:Int; - - /** - * Bits per sample of the sound - **/ - public var bitsPerSample:Int; - - /** - * The sound's bitrate - **/ - public var bitrate:Int; - - /** - * The ammound of audio channels in the sound - **/ - public var channels:Int; - - /** - * Actual data of the sound - **/ - public var data:Bytes; - - /** - * Creates a new empty instance of `SoundData` - * - * The instance won't be able to be used yet since it's empty - **/ - public function new() { - AL.genBuffers(1, Sound.tempBytes); - alBuffer = AL.Buffer.ofInt(Sound.tempBytes.getI32(0)); - } - - /** - * Loads the instance of SoundData with the specified bytes, note that the only formats that are supported are WAV, OGG, MP3 and FLAC - * @param bytes Bytes to load - **/ - public function fromBytes(bytes:Bytes) { - var signature:String = bytes.getString(0, 4); - - switch (signature.toLowerCase()) { - case 'flac': // fLaC - throw 'unimplemented!! check back later!'; - - case 'id3': // MP3 - var reader:Mp3 = Format.openMp3(#if (hl_ver >= "1.13.0") bytes, bytes.length #end); - // technically unneeded arguments since the c function doesent even define them - // but the prim definition expects them to be here so idk - data = Bytes.alloc(1); - Format.mp3DecodeFrame(reader, bytes, 1, 0, data, 1, 0); - - var b = 0, c = 0, fb = 0, h = 0, l = 0; - Format.mp3FrameInfo(reader, b, c, fb, h, l); - trace(b, c, fb, h, l); - - case 'oggs': // Vorbis - var reader:OGG = Format.openOgg(bytes, bytes.length); - - var b = 0, f = 0, s = 0, c = 0; - Format.oggInfo(reader, b, f, s, c); - - data = Bytes.alloc(s * c * 2); - var offset:Int = 0; - while (true) { - var balls:Int = Format.oggRead(reader, hl.Bytes.fromBytes(data).offset(offset), 4096, 2); - if (balls == 0) - break; - offset += balls; - } - channels = c; - sampleRate = f; - format = getFormat(c, 16); - - uploadToBuffer(); - - case 'riff': // WAV - var wavFile:WavData = new WavReader(new BytesInput(bytes)).read(); - - format = getFormat(wavFile.header.channels, wavFile.header.bitsPerSample); - sampleRate = wavFile.header.samplingRate; - channels = wavFile.header.channels; - bitsPerSample = wavFile.header.bitsPerSample; - - data = wavFile.data; - - uploadToBuffer(); - default: - throw 'unknown sound format!!!\nfound signature: ${signature}'; - } - } - - /** - * Creates a new instance of `SoundData` and loads the specified bytes - * @param bytes Bytes to load - **/ - public static function createFromBytes(bytes:Bytes):SoundData { - var daNewData = new SoundData(); - daNewData.fromBytes(bytes); - return daNewData; - } - - @:dox(hide) - private function uploadToBuffer() - AL.bufferData(alBuffer, format, data, data.length, sampleRate); - - /** - * Helper function to get a openAL format specifer - * @param channels Ammount of channels - * @param bitsPerSample Bits per sample - **/ - public static function getFormat(channels:Int, bitsPerSample:Int):Int // refactor this - return switch (channels) { - case 1: - switch (bitsPerSample) { - case 8: AL.FORMAT_MONO8; - case 16: AL.FORMAT_MONO16; - default: throw 'Invalid ammount of bits per sample! $bitsPerSample'; - } - case 2: - switch (bitsPerSample) { - case 8: AL.FORMAT_STEREO8; - case 16: AL.FORMAT_STEREO16; - default: throw 'Invalid ammount of bits per sample! $bitsPerSample'; - } - default: throw 'Invalid ammount of channels! $channels'; - } - - public function destroy():Void { - Sound.tempBytes.setI32(0, alBuffer.toInt()); - AL.deleteBuffers(1, Sound.tempBytes); - data = null; - } -} \ No newline at end of file diff --git a/src/lemons/sound/effects/Effects.hx b/src/lemons/sound/effects/Effects.hx deleted file mode 100644 index 99b7292..0000000 --- a/src/lemons/sound/effects/Effects.hx +++ /dev/null @@ -1,313 +0,0 @@ -package lemons.sound.effects; - -import openal.*; -import lemons.sound.Sound; -import lemons.util.IDestroyable; - -/** - * Base effect class. don't use this by itself. -**/ -@:dox(hide) -class Effect implements IDestroyable { - @:allow(lemons.sound.Sound) - private var alEffect:EFX.Effect; - - public function new(effectType:Int) { - EFX.genEffects(1, Sound.tempBytes); - alEffect = EFX.Effect.ofInt(Sound.tempBytes.getI32(0)); - EFX.effecti(alEffect, EFX.EFFECT_TYPE, effectType); - } - - public function destroy():Void { - Sound.tempBytes.setI32(0, alEffect.toInt()); - EFX.deleteEffects(1, Sound.tempBytes); - } - - // helpers - private function getInt(key:Int) return EFX.getEffecti(alEffect, key); - private function getFloat(key:Int) return EFX.getEffectf(alEffect, key); - private function setInt(key:Int, value:Int) { EFX.effecti(alEffect, key, value); return value; } - private function setFloat(key:Int, value:Float) { EFX.effectf(alEffect, key, value); return value; } - - private static function __init__() AL.loadExtensions(); -} - -class ReverbEffect extends Effect { - @:isVar public var density(get, set):Float; - @:isVar public var diffusion(get, set):Float; - @:isVar public var gain(get, set):Float; - @:isVar public var gainHF(get, set):Float; - @:isVar public var decayTime(get, set):Float; - @:isVar public var decayHFRatio(get, set):Float; - @:isVar public var reflectionGain(get, set):Float; - @:isVar public var reflectionDelay(get, set):Float; - @:isVar public var lateReverbGain(get, set):Float; - @:isVar public var lateReverbDelay(get, set):Float; - @:isVar public var airAbsorptionGainHF(get, set):Float; - @:isVar public var roomRolloffFactor(get, set):Float; - @:isVar public var decayHFLimit(get, set):Float; - - public function new() super(EFX.EFFECT_REVERB); - - function get_density():Float return getFloat(EFX.REVERB_DENSITY); - function get_diffusion():Float return getFloat(EFX.REVERB_DIFFUSION); - function get_gain():Float return getFloat(EFX.REVERB_GAIN); - function get_gainHF():Float return getFloat(EFX.REVERB_GAINHF); - function get_decayTime():Float return getFloat(EFX.REVERB_DECAY_TIME); - function get_decayHFRatio():Float return getFloat(EFX.REVERB_DECAY_HFRATIO); - function get_reflectionGain():Float return getFloat(EFX.REVERB_REFLECTIONS_GAIN); - function get_reflectionDelay():Float return getFloat(EFX.REVERB_REFLECTIONS_DELAY); - function get_lateReverbGain():Float return getFloat(EFX.REVERB_LATE_REVERB_GAIN); - function get_lateReverbDelay():Float return getFloat(EFX.REVERB_LATE_REVERB_DELAY); - function get_airAbsorptionGainHF():Float return getFloat(EFX.REVERB_AIR_ABSORPTION_GAINHF); - function get_roomRolloffFactor():Float return getFloat(EFX.REVERB_ROOM_ROLLOFF_FACTOR); - function get_decayHFLimit():Float return getFloat(EFX.REVERB_DECAY_HFLIMIT); - - function set_density(value:Float):Float return setFloat(EFX.REVERB_DENSITY, value); - function set_diffusion(value:Float):Float return setFloat(EFX.REVERB_DIFFUSION, value); - function set_gain(value:Float):Float return setFloat(EFX.REVERB_GAIN, value); - function set_gainHF(value:Float):Float return setFloat(EFX.REVERB_GAINHF, value); - function set_decayTime(value:Float):Float return setFloat(EFX.REVERB_DECAY_TIME, value); - function set_decayHFRatio(value:Float):Float return setFloat(EFX.REVERB_DECAY_HFRATIO, value); - function set_reflectionGain(value:Float):Float return setFloat(EFX.REVERB_REFLECTIONS_GAIN, value); - function set_reflectionDelay(value:Float):Float return setFloat(EFX.REVERB_REFLECTIONS_DELAY, value); - function set_lateReverbGain(value:Float):Float return setFloat(EFX.REVERB_LATE_REVERB_GAIN, value); - function set_lateReverbDelay(value:Float):Float return setFloat(EFX.REVERB_LATE_REVERB_DELAY, value); - function set_airAbsorptionGainHF(value:Float):Float return setFloat(EFX.REVERB_AIR_ABSORPTION_GAINHF, value); - function set_roomRolloffFactor(value:Float):Float return setFloat(EFX.REVERB_ROOM_ROLLOFF_FACTOR, value); - function set_decayHFLimit(value:Float):Float return setFloat(EFX.REVERB_DECAY_HFLIMIT, value); -} - -class DistortionEffect extends Effect { - @:isVar public var edge(get, set):Float; - @:isVar public var gain(get, set):Float; - @:isVar public var lowpassCutoff(get, set):Float; - @:isVar public var eqCenter(get, set):Float; - @:isVar public var eqBandwidth(get, set):Float; - - public function new() super(EFX.EFFECT_DISTORTION); - - function get_edge():Float return getFloat(EFX.DISTORTION_EDGE); - function get_gain():Float return getFloat(EFX.DISTORTION_GAIN); - function get_lowpassCutoff():Float return getFloat(EFX.DISTORTION_LOWPASS_CUTOFF); - function get_eqCenter():Float return getFloat(EFX.DISTORTION_EQCENTER); - function get_eqBandwidth():Float return getFloat(EFX.DISTORTION_EQBANDWIDTH); - - function set_edge(value:Float):Float return setFloat(EFX.DISTORTION_EDGE, value); - function set_gain(value:Float):Float return setFloat(EFX.DISTORTION_GAIN, value); - function set_lowpassCutoff(value:Float):Float return setFloat(EFX.DISTORTION_LOWPASS_CUTOFF, value); - function set_eqCenter(value:Float):Float return setFloat(EFX.DISTORTION_EQCENTER, value); - function set_eqBandwidth(value:Float):Float return setFloat(EFX.DISTORTION_EQBANDWIDTH, value); -} - -class EchoEffect extends Effect { - @:isVar public var delay(get, set):Float; - @:isVar public var stereoDelay(get, set):Float; - @:isVar public var damping(get, set):Float; - @:isVar public var feedback(get, set):Float; - @:isVar public var spread(get, set):Float; - - public function new() super(EFX.EFFECT_ECHO); - - function get_delay():Float return getFloat(EFX.ECHO_DELAY); - function get_stereoDelay():Float return getFloat(EFX.ECHO_LRDELAY); - function get_damping():Float return getFloat(EFX.ECHO_DAMPING); - function get_feedback():Float return getFloat(EFX.ECHO_FEEDBACK); - function get_spread():Float return getFloat(EFX.ECHO_SPREAD); - - function set_delay(value:Float):Float return setFloat(EFX.ECHO_DELAY, value); - function set_stereoDelay(value:Float):Float return setFloat(EFX.ECHO_LRDELAY, value); - function set_damping(value:Float):Float return setFloat(EFX.ECHO_DAMPING, value); - function set_feedback(value:Float):Float return setFloat(EFX.ECHO_FEEDBACK, value); - function set_spread(value:Float):Float return setFloat(EFX.ECHO_SPREAD, value); -} - -class FlangerEffect extends Effect { - @:isVar public var waveform(get, set):Float; - @:isVar public var phase(get, set):Int; - @:isVar public var rate(get, set):Float; - @:isVar public var depth(get, set):Float; - @:isVar public var feedback(get, set):Float; - @:isVar public var delay(get, set):Float; - - public function new() super(EFX.EFFECT_FLANGER); - - function get_waveform():Float return getFloat(EFX.FLANGER_WAVEFORM); - function get_phase():Int return getInt(EFX.FLANGER_PHASE); - function get_rate():Float return getFloat(EFX.FLANGER_RATE); - function get_depth():Float return getFloat(EFX.FLANGER_DEPTH); - function get_feedback():Float return getFloat(EFX.FLANGER_FEEDBACK); - function get_delay():Float return getFloat(EFX.FLANGER_DELAY); - - function set_waveform(value:Float):Float return setFloat(EFX.FLANGER_WAVEFORM, value); - function set_phase(value:Int):Int return setInt(EFX.FLANGER_PHASE, value); - function set_rate(value:Float):Float return setFloat(EFX.FLANGER_RATE, value); - function set_depth(value:Float):Float return setFloat(EFX.FLANGER_DEPTH, value); - function set_feedback(value:Float):Float return setFloat(EFX.FLANGER_FEEDBACK, value); - function set_delay(value:Float):Float return setFloat(EFX.FLANGER_DELAY, value); -} - -class RingModulatorEffect extends Effect { - @:isVar public var frequency(get, set):Float; - @:isVar public var highpassCutoff(get, set):Float; - @:isVar public var waveform(get, set):Float; - - public function new() super(EFX.EFFECT_RING_MODULATOR); - - function get_frequency():Float return getFloat(EFX.RING_MODULATOR_FREQUENCY); - function get_highpassCutoff():Float return getFloat(EFX.RING_MODULATOR_HIGHPASS_CUTOFF); - function get_waveform():Float return getFloat(EFX.RING_MODULATOR_WAVEFORM); - - function set_frequency(value:Float):Float return setFloat(EFX.RING_MODULATOR_FREQUENCY, value); - function set_highpassCutoff(value:Float):Float return setFloat(EFX.RING_MODULATOR_HIGHPASS_CUTOFF, value); - function set_waveform(value:Float):Float return setFloat(EFX.RING_MODULATOR_WAVEFORM, value); -} - -class CompressorEffect extends Effect { - @:isVar public var enabled(get, set):Bool; - - public function new() super(EFX.EFFECT_COMPRESSOR); - - function get_enabled():Bool return getInt(EFX.COMPRESSOR_ONOFF) == 1; - - function set_enabled(value:Bool):Bool return setFloat(EFX.COMPRESSOR_ONOFF, (value ? 1 : 0)) == 1; -} - -class EqualizerEffect extends Effect { - @:isVar public var lowGain(get, set):Float; - @:isVar public var lowCutoff(get, set):Float; - - @:isVar public var mid1Gain(get, set):Float; - @:isVar public var mid1Center(get, set):Float; - @:isVar public var mid1Width(get, set):Float; - @:isVar public var mid2Gain(get, set):Float; - @:isVar public var mid2Center(get, set):Float; - @:isVar public var mid2Width(get, set):Float; - - @:isVar public var highGain(get, set):Float; - @:isVar public var highCutoff(get, set):Float; - - public function new() super(EFX.EFFECT_EQUALIZER); - - function get_lowGain():Float return getFloat(EFX.EQUALIZER_LOW_GAIN); - function get_lowCutoff():Float return getFloat(EFX.EQUALIZER_LOW_CUTOFF); - function get_mid1Gain():Float return getFloat(EFX.EQUALIZER_MID1_GAIN); - function get_mid1Center():Float return getFloat(EFX.EQUALIZER_MID1_CENTER); - function get_mid1Width():Float return getFloat(EFX.EQUALIZER_MID1_WIDTH); - function get_mid2Gain():Float return getFloat(EFX.EQUALIZER_MID2_GAIN); - function get_mid2Center():Float return getFloat(EFX.EQUALIZER_MID2_CENTER); - function get_mid2Width():Float return getFloat(EFX.EQUALIZER_MID2_WIDTH); - function get_highGain():Float return getFloat(EFX.EQUALIZER_HIGH_GAIN); - function get_highCutoff():Float return getFloat(EFX.EQUALIZER_HIGH_CUTOFF); - - function set_lowGain(value:Float):Float return setFloat(EFX.EQUALIZER_LOW_GAIN, value); - function set_lowCutoff(value:Float):Float return setFloat(EFX.EQUALIZER_LOW_CUTOFF, value); - function set_mid1Gain(value:Float):Float return setFloat(EFX.EQUALIZER_MID1_GAIN, value); - function set_mid1Center(value:Float):Float return setFloat(EFX.EQUALIZER_MID1_CENTER, value); - function set_mid1Width(value:Float):Float return setFloat(EFX.EQUALIZER_MID1_WIDTH, value); - function set_mid2Gain(value:Float):Float return setFloat(EFX.EQUALIZER_MID2_GAIN, value); - function set_mid2Center(value:Float):Float return setFloat(EFX.EQUALIZER_MID2_CENTER, value); - function set_mid2Width(value:Float):Float return setFloat(EFX.EQUALIZER_MID2_WIDTH, value); - function set_highGain(value:Float):Float return setFloat(EFX.EQUALIZER_HIGH_GAIN, value); - function set_highCutoff(value:Float):Float return setFloat(EFX.EQUALIZER_HIGH_CUTOFF, value); -} - -class EAXReverbEffect extends Effect { - @:isVar public var density(get, set):Float; - @:isVar public var diffusion(get, set):Float; - @:isVar public var gain(get, set):Float; - @:isVar public var gainHF(get, set):Float; - @:isVar public var gainLF(get, set):Float; - @:isVar public var decayTime(get, set):Float; - @:isVar public var decayHFRatio(get, set):Float; - @:isVar public var decayLFRatio(get, set):Float; - @:isVar public var reflectionsGain(get, set):Float; - @:isVar public var reflectionsDelay(get, set):Float; - @:isVar public var reflectionsPan(get, set):Float; - @:isVar public var lateReverbGain(get, set):Float; - @:isVar public var lateReverbDelay(get, set):Float; - @:isVar public var lateReverbPan(get, set):Float; - @:isVar public var echoTime(get, set):Float; - @:isVar public var echoDepth(get, set):Float; - @:isVar public var modulationTime(get, set):Float; - @:isVar public var modulationDepth(get, set):Float; - @:isVar public var airAbsorptionGainHF(get, set):Float; - @:isVar public var HFReference(get, set):Float; - @:isVar public var LFReference(get, set):Float; - @:isVar public var roomRolloffFactor(get, set):Float; - @:isVar public var decayHFLimit(get, set):Float; - - public function new() super(EFX.EFFECT_EAXREVERB); - - function get_density():Float return getFloat(EFX.EAXREVERB_DENSITY); - function get_diffusion():Float return getFloat(EFX.EAXREVERB_DIFFUSION); - function get_gain():Float return getFloat(EFX.EAXREVERB_GAIN); - function get_gainHF():Float return getFloat(EFX.EAXREVERB_GAINHF); - function get_gainLF():Float return getFloat(EFX.EAXREVERB_GAINLF); - function get_decayTime():Float return getFloat(EFX.EAXREVERB_DECAY_TIME); - function get_decayHFRatio():Float return getFloat(EFX.EAXREVERB_DECAY_HFRATIO); - function get_decayLFRatio():Float return getFloat(EFX.EAXREVERB_DECAY_LFRATIO); - function get_reflectionsGain():Float return getFloat(EFX.EAXREVERB_REFLECTIONS_GAIN); - function get_reflectionsDelay():Float return getFloat(EFX.EAXREVERB_REFLECTIONS_DELAY); - function get_reflectionsPan():Float return getFloat(EFX.EAXREVERB_REFLECTIONS_PAN); - function get_lateReverbGain():Float return getFloat(EFX.EAXREVERB_LATE_REVERB_GAIN); - function get_lateReverbDelay():Float return getFloat(EFX.EAXREVERB_LATE_REVERB_DELAY); - function get_lateReverbPan():Float return getFloat(EFX.EAXREVERB_LATE_REVERB_PAN); - function get_echoTime():Float return getFloat(EFX.EAXREVERB_ECHO_TIME); - function get_echoDepth():Float return getFloat(EFX.EAXREVERB_ECHO_DEPTH); - function get_modulationTime():Float return getFloat(EFX.EAXREVERB_MODULATION_TIME); - function get_modulationDepth():Float return getFloat(EFX.EAXREVERB_MODULATION_DEPTH); - function get_airAbsorptionGainHF():Float return getFloat(EFX.EAXREVERB_AIR_ABSORPTION_GAINHF); - function get_HFReference():Float return getFloat(EFX.EAXREVERB_HFREFERENCE); - function get_LFReference():Float return getFloat(EFX.EAXREVERB_LFREFERENCE); - function get_roomRolloffFactor():Float return getFloat(EFX.EAXREVERB_ROOM_ROLLOFF_FACTOR); - function get_decayHFLimit():Float return getFloat(EFX.EAXREVERB_DECAY_HFLIMIT); - - function set_density(value:Float):Float return setFloat(EFX.EAXREVERB_DENSITY, value); - function set_diffusion(value:Float):Float return setFloat(EFX.EAXREVERB_DIFFUSION, value); - function set_gain(value:Float):Float return setFloat(EFX.EAXREVERB_GAIN, value); - function set_gainHF(value:Float):Float return setFloat(EFX.EAXREVERB_GAINHF, value); - function set_gainLF(value:Float):Float return setFloat(EFX.EAXREVERB_GAINLF, value); - function set_decayTime(value:Float):Float return setFloat(EFX.EAXREVERB_DECAY_TIME, value); - function set_decayHFRatio(value:Float):Float return setFloat(EFX.EAXREVERB_DECAY_HFRATIO, value); - function set_decayLFRatio(value:Float):Float return setFloat(EFX.EAXREVERB_DECAY_LFRATIO, value); - function set_reflectionsGain(value:Float):Float return setFloat(EFX.EAXREVERB_REFLECTIONS_GAIN, value); - function set_reflectionsDelay(value:Float):Float return setFloat(EFX.EAXREVERB_REFLECTIONS_DELAY, value); - function set_reflectionsPan(value:Float):Float return setFloat(EFX.EAXREVERB_REFLECTIONS_PAN, value); - function set_lateReverbGain(value:Float):Float return setFloat(EFX.EAXREVERB_LATE_REVERB_GAIN, value); - function set_lateReverbDelay(value:Float):Float return setFloat(EFX.EAXREVERB_LATE_REVERB_DELAY, value); - function set_lateReverbPan(value:Float):Float return setFloat(EFX.EAXREVERB_LATE_REVERB_PAN, value); - function set_echoTime(value:Float):Float return setFloat(EFX.EAXREVERB_ECHO_TIME, value); - function set_echoDepth(value:Float):Float return setFloat(EFX.EAXREVERB_ECHO_DEPTH, value); - function set_modulationTime(value:Float):Float return setFloat(EFX.EAXREVERB_MODULATION_TIME, value); - function set_modulationDepth(value:Float):Float return setFloat(EFX.EAXREVERB_MODULATION_DEPTH, value); - function set_airAbsorptionGainHF(value:Float):Float return setFloat(EFX.EAXREVERB_AIR_ABSORPTION_GAINHF, value); - function set_HFReference(value:Float):Float return setFloat(EFX.EAXREVERB_HFREFERENCE, value); - function set_LFReference(value:Float):Float return setFloat(EFX.EAXREVERB_LFREFERENCE, value); - function set_roomRolloffFactor(value:Float):Float return setFloat(EFX.EAXREVERB_ROOM_ROLLOFF_FACTOR, value); - function set_decayHFLimit(value:Float):Float return setFloat(EFX.EAXREVERB_DECAY_HFLIMIT, value); - -} - - -// these effects dont work?? - -class ChorusEffect extends Effect { - public function new() super(EFX.EFFECT_CHORUS); -} - -class FrequencyShifterEffect extends Effect { - public function new() super(EFX.EFFECT_FREQUENCY_SHIFTER); -} - -class VocalMorpherEffect extends Effect { - public function new() super(EFX.EFFECT_VOCAL_MORPHER); -} - -class PitchShifterEffect extends Effect { - public function new() super(EFX.EFFECT_PITCH_SHIFTER); -} - -class AutowahEffect extends Effect { - public function new() super(EFX.EFFECT_AUTOWAH); -} \ No newline at end of file diff --git a/src/lemons/sound/filters/Filters.hx b/src/lemons/sound/filters/Filters.hx deleted file mode 100644 index e5a2d69..0000000 --- a/src/lemons/sound/filters/Filters.hx +++ /dev/null @@ -1,105 +0,0 @@ -package lemons.sound.filters; - -import openal.*; -import lemons.sound.Sound; -import lemons.util.IDestroyable; - -class Filter implements IDestroyable { - public var alFilter:EFX.Filter; - public function new(filterType:Int) { - EFX.genFilters(1, Sound.tempBytes); - alFilter = EFX.Filter.ofInt(Sound.tempBytes.getI32(0)); - EFX.filteri(alFilter, EFX.FILTER_TYPE, filterType); - } - - public function destroy():Void { - Sound.tempBytes.setI32(0, alFilter.toInt()); - EFX.deleteFilters(1, Sound.tempBytes); - } -} - -class LowPassFilter extends Filter { - @:isVar public var gain(get, set):Float; - @:isVar public var gainHF(get, set):Float; - - public function new() { - super(EFX.FILTER_LOWPASS); - - gain = 1; - gainHF = 1; - } - - function get_gain():Float - return EFX.getFilterf(alFilter, EFX.LOWPASS_GAIN); - function set_gain(value:Float):Float { - EFX.filterf(alFilter, EFX.LOWPASS_GAIN, value); - return gain = value; - } - - function get_gainHF():Float - return EFX.getFilterf(alFilter, EFX.LOWPASS_GAINHF); - function set_gainHF(value:Float):Float { - EFX.filterf(alFilter, EFX.LOWPASS_GAINHF, value); - return gainHF = value; - } -} - -class HighPassFilter extends Filter { - @:isVar public var gain(get, set):Float; - @:isVar public var gainLF(get, set):Float; - - public function new() { - super(EFX.FILTER_HIGHPASS); - - gain = 1; - gainLF = 1; - } - - function get_gain():Float - return EFX.getFilterf(alFilter, EFX.HIGHPASS_GAIN); - function set_gain(value:Float):Float { - EFX.filterf(alFilter, EFX.HIGHPASS_GAIN, value); - return gain = value; - } - - function get_gainLF():Float - return EFX.getFilterf(alFilter, EFX.HIGHPASS_GAINLF); - function set_gainLF(value:Float):Float { - EFX.filterf(alFilter, EFX.HIGHPASS_GAINLF, value); - return gainLF = value; - } -} - -class BandPassFilter extends Filter { - @:isVar public var gain(get, set):Float; - @:isVar public var gainLF(get, set):Float; - @:isVar public var gainHF(get, set):Float; - - public function new() { - super(EFX.FILTER_BANDPASS); - - gain = 1; - gainLF = 1; - gainHF = 1; - } - - function get_gain():Float - return EFX.getFilterf(alFilter, EFX.BANDPASS_GAIN); - function set_gain(value:Float):Float { - EFX.filterf(alFilter, EFX.BANDPASS_GAIN, value); - return gain = value; - } - - function get_gainLF():Float - return EFX.getFilterf(alFilter, EFX.BANDPASS_GAINLF); - function set_gainLF(value:Float):Float { - EFX.filterf(alFilter, EFX.BANDPASS_GAINLF, value); - return gainHF = value; - } - function get_gainHF():Float - return EFX.getFilterf(alFilter, EFX.BANDPASS_GAINHF); - function set_gainHF(value:Float):Float { - EFX.filterf(alFilter, EFX.BANDPASS_GAINHF, value); - return gainHF = value; - } -} \ No newline at end of file diff --git a/src/lemons/util/IDestroyable.hx b/src/lemons/util/IDestroyable.hx index 83d7b18..5603b5c 100644 --- a/src/lemons/util/IDestroyable.hx +++ b/src/lemons/util/IDestroyable.hx @@ -1,11 +1,11 @@ package lemons.util; /** - * Basic interface for a class that can be destroyed + * basic interface for a class that can be destroyed **/ interface IDestroyable { /** - * Destroyes the instance + * destroyes the instance **/ public function destroy():Void; } \ No newline at end of file diff --git a/src/lemons/util/Log.hx b/src/lemons/util/Log.hx new file mode 100644 index 0000000..dbee7ac --- /dev/null +++ b/src/lemons/util/Log.hx @@ -0,0 +1,11 @@ +package lemons.util; + + +// TODO: this class + +class Log { + static var useColor:Bool = true; + + + #if sys static function __init__():Void useColor = Sys.args().contains('--nocolor'); #end +} \ No newline at end of file diff --git a/src/lemons/util/Signal.hx b/src/lemons/util/Signal.hx index 46b6ee0..1e702da 100644 --- a/src/lemons/util/Signal.hx +++ b/src/lemons/util/Signal.hx @@ -1,5 +1,9 @@ package lemons.util; + +// TODO: this class is non functional for cases like Void->Void, fix that + + class Signal { private var listeners:Array<{func:I->R, once:Bool}> = []; diff --git a/todo.md b/todo.md deleted file mode 100644 index 0e31361..0000000 --- a/todo.md +++ /dev/null @@ -1,18 +0,0 @@ -## progress - -- sound ❌ 50% - - filters ✅ - - effects ✅ - - formats ❌ 50% - - wave ✅ - - mp3 ❌ - - flac ❌ - - ogg ✅ - - groups ❌ - -- display - - drivers ❌ - - vulkan ❌ - - directx (either 12 or 11) ❌ - - fallback opengl ❌ - - shading language (LSL) ❌ diff --git a/tools/Main.hx b/tools/Main.hx new file mode 100644 index 0000000..0e40ea5 --- /dev/null +++ b/tools/Main.hx @@ -0,0 +1,42 @@ +package tools; + +class Main { + public function new() { + Sys.setCwd(libPath); + + args = Sys.args(); + originalPath = args.pop(); + + if (args.length == 0) { + Sys.println('\033[0;33mlemons\033[0m - 2d game framework i think'); + Sys.println('run with \'help\' to display a list of all commands'); + return; + } + + var argThing:String = args.shift(); + switch (argThing) { + case 'help': + Sys.println('\033[0;33mlemons\033[0m - 2d game framework i think'); + Sys.println(' help - displays this message'); + Sys.println(' rebuild - rebuilds the native library for lemons'); + Sys.println(' build - builds the project that you\'re located in'); + Sys.println(' create - creates a project'); + case 'build': + new tools.commands.BuildCommand(); + case 'display': + new tools.commands.DisplayCommand(); + case 'rebuild': + new tools.commands.RebuildCommand(); + case 'test': + new tools.commands.TestCommand(); + case 'setup': + new tools.commands.SetupCommand(); + default: + Sys.println('\033[1;31merm... error\033[0m invalid command: $argThing'); + + } + + } + + static public function main() new Main(); +} \ No newline at end of file diff --git a/tools/Util.hx b/tools/Util.hx new file mode 100644 index 0000000..ffe4629 --- /dev/null +++ b/tools/Util.hx @@ -0,0 +1,50 @@ +package tools; + +import sys.io.Process; +import tools.project.Ini; + +using StringTools; + +class Util { + @:allow(tools.Main) + private static var args:Array = []; + + public static var libPath:String = ''; + public static var originalPath:String = ''; + public static var setup:Ini; + + + private static function __init__() { + var process = new Process('haxelib', ['path', 'lemons']); + + try { + while (true) { + var line = process.stdout.readLine().trim(); + if (!line.startsWith('-D') && line.contains('lemons')) { + libPath = line.replace('src', '').normalize(); + break; + } + } + } catch(_) {} + + + process.close(); + + Sys.setCwd(libPath); + + try { + setup = new Ini().parse(File.getContent('setup.ini')); + } catch(e) { + setup = new Ini(); + setup.globalVariables['liblemonsDirectory'] = '$libPath/liblemons'; + File.saveContent('setup.ini', setup.toString()); + } + } + + // public static function removeArgument(arg:String) args.remove(args.indexOf(arg)); + // public static function getArgument(arg:String):Bool { + // final reslut:Bool = args.indexOf(arg) != -1; + // if (reslut) removeArgument(arg); + // return reslut; + // } +} \ No newline at end of file diff --git a/tools/commands/BuildCommand.hx b/tools/commands/BuildCommand.hx new file mode 100644 index 0000000..238c0a4 --- /dev/null +++ b/tools/commands/BuildCommand.hx @@ -0,0 +1,37 @@ +package tools.commands; + +import sys.io.Process; +import tools.project.Project; +import tools.project.Ini; + +class BuildCommand { + public var parsedProject:Project; + public var exitCode:Int; + + public function new() { + Sys.setCwd(originalPath); + + var project:String = null; + + try { + project = File.getContent('project.ini'); + } catch(e) { + Sys.println('\033[1;31merm... error\033[0m working directory does not have a project.ini, are you located in your project directory?'); + return; + } + + parsedProject = new Project(new Ini().parse(project)); + + exitCode = Sys.command('haxe ' + parsedProject.toArgList().join(' ')); + + try { + var libraryFiles:Array = sys.FileSystem.readDirectory(setup.globalVariables['liblemonsDirectory'] + '/out').filter((str) -> return !str.contains('.pdb')); + for (file in libraryFiles) + sys.io.File.copy(setup.globalVariables['liblemonsDirectory'] + '/out/' + file, parsedProject.getOutputPath() + '/' + file); + } catch(e) { + Sys.println('could not find the native extension library for lemons. make sure the path ${setup.globalVariables['liblemonsDirectory'] + '/out'} exists.\nif you are using the git version of lemons, you should follow the guide on how to build the native extension manually.\nif this was downloaded off of haxelib, send an issue in the lemons github repository\nhttps://github.com/LemonsFramework/lemons'); + Sys.println(e); + } + + } +} \ No newline at end of file diff --git a/tools/commands/CreateCommand.hx b/tools/commands/CreateCommand.hx new file mode 100644 index 0000000..e419820 --- /dev/null +++ b/tools/commands/CreateCommand.hx @@ -0,0 +1,9 @@ +package tools.commands; + +import sys.io.Process; + +class CreateCommand { + public function new() { + + } +} \ No newline at end of file diff --git a/tools/commands/DisplayCommand.hx b/tools/commands/DisplayCommand.hx new file mode 100644 index 0000000..0b74537 --- /dev/null +++ b/tools/commands/DisplayCommand.hx @@ -0,0 +1,24 @@ +package tools.commands; + +import sys.io.Process; +import tools.project.Project; +import tools.project.Ini; + +class DisplayCommand { + public function new() { + Sys.setCwd(originalPath); + + var project:String = null; + + try { + project = File.getContent('project.ini'); + } catch(e) { + Sys.println('\033[1;31merm... error\033[0m working directory does not have a project.ini, are you located in your project directory?'); + return; + } + + var parsedProject:Project = new Project(new Ini().parse(project)); + + Sys.println(parsedProject.toArgList().join('\n')); + } +} \ No newline at end of file diff --git a/tools/commands/RebuildCommand.hx b/tools/commands/RebuildCommand.hx new file mode 100644 index 0000000..7c48f7f --- /dev/null +++ b/tools/commands/RebuildCommand.hx @@ -0,0 +1,38 @@ +package tools.commands; + +import sys.io.Process; +import tools.project.Ini; + +class RebuildCommand { + + public function new() { + Sys.setCwd(setup.globalVariables['liblemonsDirectory']); + + if (Sys.systemName().toLowerCase() == 'windows') { // whyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy + try { + // the visual studio installer should always be here; if not im gonna have a panic attack + var process = new Process('C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe', ['-latest', '-property', 'installationPath']); + var vsPath = process.stdout.readLine(); + process.close(); + + var whyMicrosoft = new Process('"$vsPath\\Common7\\Tools\\VsDevCmd.bat" -arch=x64 -no_logo && set'); + try { + while (true) { + var line = whyMicrosoft.stdout.readLine(); + var lineSplit = line.split('='); + Sys.putEnv(lineSplit[0], lineSplit[1]); + } + } catch(_) {} + whyMicrosoft.close(); + } catch(e) { + trace('could\'nt setup build enviroment using visual studio, have you installed it?'); + } + } + + + Sys.command('mkdir make'); + Sys.setCwd(Sys.getCwd() + '/make'); + Sys.command('cmake ..'); + Sys.command('cmake --build .'); + } +} \ No newline at end of file diff --git a/tools/commands/SetupCommand.hx b/tools/commands/SetupCommand.hx new file mode 100644 index 0000000..8388876 --- /dev/null +++ b/tools/commands/SetupCommand.hx @@ -0,0 +1,22 @@ +package tools.commands; + +import sys.io.Process; +import tools.project.Ini; + +class SetupCommand { + public function new() { + Sys.setCwd(libPath); + + Sys.println('the current path for liblemons is ${setup.globalVariables['liblemonsDirectory']}'); + Sys.println('enter your liblemons directory [default is $libPath/liblemons]'); + + var line:String = Sys.stdin().readLine(); + + if (line.trim() == '') { + Sys.println('reverting to default directory...'); + setup.globalVariables['liblemonsDirectory'] = '$libPath/liblemons'; + } else setup.globalVariables['liblemonsDirectory'] = line; + + File.saveContent('setup.ini', setup.toString()); + } +} \ No newline at end of file diff --git a/tools/commands/TestCommand.hx b/tools/commands/TestCommand.hx new file mode 100644 index 0000000..e910121 --- /dev/null +++ b/tools/commands/TestCommand.hx @@ -0,0 +1,12 @@ +package tools.commands; + +class TestCommand { + public function new() { + var build:BuildCommand = new BuildCommand(); + + if (build.exitCode != 0) return; + + Sys.command('cd', [build.parsedProject.getOutputPath()]); + Sys.command('hl', [build.parsedProject.getOutputFilename()]); + } +} \ No newline at end of file diff --git a/tools/import.hx b/tools/import.hx new file mode 100644 index 0000000..b2a282c --- /dev/null +++ b/tools/import.hx @@ -0,0 +1,4 @@ +import tools.Util.*; +import sys.io.File; +using haxe.io.Path; +using StringTools; diff --git a/tools/project/Ini.hx b/tools/project/Ini.hx new file mode 100644 index 0000000..5ea9eb7 --- /dev/null +++ b/tools/project/Ini.hx @@ -0,0 +1,79 @@ +package tools.project; + +using StringTools; + +// basic ini parser, might seperate it into a seperate library + +@:transitive +abstract OneOfThree(Dynamic) from T1 to T1 from T2 to T2 from T3 to T3 {} + +typedef IniEntry = OneOfThree; +typedef IniSection = Map; + +class Ini { + public var globalVariables:IniSection = []; + public var sections:Map = []; + + public function new() {} + + public function parse(string:String):Ini { + final lines:Array = string.split('\n'); + + var curSection:String = ''; + + for (line in lines) { + if (isComment(line)) continue; + if (line.trim() == '') continue; + + if (line.charAt(0) == '[') { + if (line.indexOf(']') == -1) + throw 'Expected ]'; + + curSection = line.substr(1, line.indexOf(']') - 1); + if (sections[curSection] == null) sections.set(curSection, []); + continue; + } + + if (line.indexOf('=') == -1) throw 'Expected ='; + + final section:IniSection = (curSection == '' ? globalVariables : sections[curSection]); + final entryName:String = line.substr(0, line.indexOf('=')).trim(); + final entryValue:String = line.substr(line.indexOf('=') + 1).trim(); + + if (entryValue == 'true' || entryValue == 'false') section[entryName] = entryValue == 'true'; + else if (~/[0-9]/.match(entryValue.charAt(0))) section[entryName] = Std.parseFloat(entryValue); + else if (entryValue.charAt(0) == '\"' || entryValue.charAt(0) == '\'') section[entryName] = entryValue.substr(1, entryValue.length - 2); + else section[entryName] = entryValue; + } + + return this; + } + + public function toString():String { + var buffer:StringBuf = new StringBuf(); + + inline function addEntry(key:String, value:IniEntry) { + buffer.add(key); + buffer.add(' = '); + buffer.add(stringifyValue(value)); + buffer.add('\n'); + } + + for (key => value in globalVariables) addEntry(key, value); + + for (name => section in sections) { + buffer.add('\n'); + buffer.add('[$name]'); + buffer.add('\n'); + for (key => value in section) addEntry(key, value); + } + + return buffer.toString(); + } + + inline function stringifyValue(val:IniEntry):String + return if (val is String) '\'$val\''; else Std.string(val); + + inline function isComment(string:String):Bool + return string.charAt(0) == ';' || string.charAt(0) == '#'; +} \ No newline at end of file diff --git a/tools/project/Project.hx b/tools/project/Project.hx new file mode 100644 index 0000000..e2b28a3 --- /dev/null +++ b/tools/project/Project.hx @@ -0,0 +1,79 @@ +package tools.project; + +import tools.project.Ini; +import haxe.Serializer.run; + +class Project { + + var output:String = ''; + var filename:String = ''; + + public var sources:Array = []; + + public var resourceFolder:String = ''; + public var mainClass:String = ''; + + public var preferedRenderer:String = ''; + + public var gameWidth:Int = 0; + public var gameHeight:Int = 0; + + public var windowTitle:String = ''; + public var windowResizable:Bool = false; + + public var defines:Map = []; + public var libraries:Map = []; + + public var useCCompilation:Bool = false; + + public function new(projectFile:Ini, ?useCCompilation:Bool = false) { + this.useCCompilation = useCCompilation; + + filename = projectFile.globalVariables['filename'] ?? 'game'; + output = projectFile.globalVariables['output'] ?? 'out/'; + resourceFolder = projectFile.globalVariables['resources'] ?? 'res/'; + mainClass = projectFile.globalVariables['main'] ?? 'Main'; + + for (_ => source in projectFile.sections['sources']) + sources.push(source); + + gameWidth = Std.int(projectFile.sections['game']['width'] ?? 640); + gameHeight = Std.int(projectFile.sections['game']['height'] ?? 480); + + windowTitle = projectFile.sections['window']['title'] ?? 'lemons project'; + windowResizable = projectFile.sections['window']['resizable'] ?? true; + + preferedRenderer = projectFile.globalVariables['renderer'] ?? 'OPENGL'; // TODO: add "BEST" option where the game checks what renderers are avalible on the gpu, probabbly in a list of vulkan, then directx and at last opengl + + for (defineName => define in projectFile.sections['defines']) + defines[defineName] = Std.string(define); // in this case we want the value to be a string + + for (library => version in projectFile.sections['libraries']) + libraries[library] = Std.string(version); + } + + public function toArgList():Array { + var list:Array = []; + + list.push('--hl ' + getOutputPath() + '/' + getOutputFilename()); + list.push('-m $mainClass'); + for (source in sources) list.push('-p $source'); + for (defineName => define in defines) list.push('-D $defineName${define == '' ? '' : '=\"$define\"'}'); + for (library => version in libraries) list.push('-L $library${version == '' ? '' : ':$version'}'); + list.push('-L lemons'); + + list.push('-D gameSize=${gameWidth}x${gameHeight}'); + list.push('-D renderer=${preferedRenderer}'); + + final windowSettings = {title: windowTitle, resizable: windowResizable}; + list.push('-D windowSettings=${run(windowSettings)}'); + + return list; + } + + public function getOutputPath():String + return output.normalize(); + + public function getOutputFilename():String + return '$filename${useCCompilation ? '.c' : '.hl'}'.normalize(); +} \ No newline at end of file diff --git a/tools/projectTemplate.ini b/tools/projectTemplate.ini new file mode 100644 index 0000000..c75d076 --- /dev/null +++ b/tools/projectTemplate.ini @@ -0,0 +1,20 @@ +filename = 'filename' +output = 'out/' +resources = 'res/' + +main = 'Main' + +[sources] +mainSrc = 'src/' + +[game] +width = 640 +height = 480 + +[window] +title = '' +resizable = true + +[defines] + +[libraries] \ No newline at end of file