forked from haxenme/nme
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merged and improved from haxenme#496 . Added GL3.hx for GLES3 functions. It is only activated for windows and android because needs testing on other targets (ios, linux, mac, emscripten). Windows angle needs native-toolkit/libsdl#11 , otherwise gets a GLES2 context. Tested with https://github.com/madrazo/nme-opengl-tutorials/tree/master/tutorial02_red_triangle
- Loading branch information
Showing
8 changed files
with
286 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package nme.gl; | ||
|
||
import nme.display.BitmapData; | ||
import nme.utils.ArrayBuffer; | ||
import nme.utils.ByteArray; | ||
import nme.utils.IMemoryRange; | ||
import nme.utils.ArrayBufferView; | ||
import nme.geom.Matrix3D; | ||
import nme.Lib; | ||
import nme.Loader; | ||
|
||
#if (neko||cpp) | ||
import nme.utils.Float32Array; | ||
import nme.utils.Int32Array; | ||
#end | ||
|
||
|
||
@:nativeProperty | ||
class GL3 | ||
{ | ||
|
||
#if (neko||cpp) | ||
|
||
public static inline function bindVertexArray(vertexarray:GLVertexArray):Void | ||
{ | ||
nme_gl_bind_vertexarray(vertexarray); | ||
} | ||
|
||
public static inline function createVertexArray():GLVertexArray | ||
{ | ||
return new GLVertexArray(GL.version, nme_gl_create_vertexarray()); | ||
} | ||
|
||
|
||
// Native Methods | ||
private static var nme_gl_create_vertexarray = GL.load("nme_gl_create_vertexarray", 0); | ||
private static var nme_gl_bind_vertexarray = GL.load("nme_gl_bind_vertexarray", 1); | ||
|
||
#end | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package nme.gl; | ||
#if (!flash) | ||
|
||
@:nativeProperty | ||
class GLVertexArray extends GLObject | ||
{ | ||
public function new(inVersion:Int, inId:Dynamic) | ||
{ | ||
super(inVersion, inId); | ||
} | ||
|
||
override function getType():String | ||
{ | ||
return "VertexArray"; | ||
} | ||
} | ||
|
||
#end |
Oops, something went wrong.