Use GLRenderContext on native, prep for GLES3 API

This commit is contained in:
Joshua Granick
2016-11-15 19:25:37 -08:00
parent c46d7ae42e
commit c4cd020f66
8 changed files with 3582 additions and 2366 deletions

View File

@@ -88,9 +88,9 @@ class HTML5Renderer {
webgl = untyped WebGLDebugUtils.makeDebugContext (webgl);
#end
GL.context = webgl;
GL.context = cast webgl;
#if (js && html5)
parent.context = OPENGL (cast GL.context);
parent.context = OPENGL (GL.context);
#else
parent.context = OPENGL (new GLRenderContext ());
#end

View File

@@ -5,6 +5,7 @@ import haxe.Timer;
import lime.app.Application;
import lime.app.Config;
import lime.audio.AudioManager;
import lime.graphics.opengl.GL;
import lime.graphics.ConsoleRenderContext;
import lime.graphics.GLRenderContext;
import lime.graphics.RenderContext;
@@ -28,8 +29,10 @@ import lime.ui.Window;
#end
@:access(haxe.Timer)
@:access(lime._backend.native.NativeGLRenderContext)
@:access(lime._backend.native.NativeRenderer)
@:access(lime.app.Application)
@:access(lime.graphics.opengl.GL)
@:access(lime.graphics.Renderer)
@:access(lime.system.Sensor)
@:access(lime.ui.Gamepad)
@@ -389,7 +392,8 @@ class NativeApplication {
#if lime_console
renderer.context = CONSOLE (ConsoleRenderContext.singleton);
#else
renderer.context = OPENGL (new GLRenderContext ());
GL.context = new GLRenderContext ();
renderer.context = OPENGL (GL.context);
#end
renderer.onContextRestored.dispatch (renderer.context);

File diff suppressed because it is too large Load Diff

View File

@@ -12,6 +12,7 @@ import lime.graphics.GLRenderContext;
import lime.graphics.Image;
import lime.graphics.ImageBuffer;
import lime.graphics.Renderer;
import lime.graphics.opengl.GL;
import lime.math.Rectangle;
import lime.utils.UInt8Array;
@@ -19,7 +20,9 @@ import lime.utils.UInt8Array;
@:build(lime.system.CFFI.build())
#end
@:access(lime._backend.native.NativeGLRenderContext)
@:access(lime.graphics.cairo.Cairo)
@:access(lime.graphics.opengl.GL)
@:access(lime.ui.Window)
@@ -66,9 +69,17 @@ class NativeRenderer {
case "opengl":
var context = new GLRenderContext ();
useHardware = true;
parent.context = OPENGL (new GLRenderContext ());
parent.context = OPENGL (context);
parent.type = OPENGL;
if (GL.context == null) {
GL.context = context;
}
default:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
package lime.graphics.opengl;
import lime.utils.ArrayBufferView;
import lime.utils.Float32Array;
import lime.utils.Int32Array;
@:forward()
abstract GLES3Context(GLES2Context) from GLES2Context to GLES2Context from GLRenderContext to GLRenderContext {
}