Use GLRenderContext on native, prep for GLES3 API
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
1910
lime/_backend/native/NativeGLRenderContext.hx
Normal file
1910
lime/_backend/native/NativeGLRenderContext.hx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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
1624
lime/graphics/opengl/GLES2Context.hx
Normal file
1624
lime/graphics/opengl/GLES2Context.hx
Normal file
File diff suppressed because it is too large
Load Diff
17
lime/graphics/opengl/GLES3Context.hx
Normal file
17
lime/graphics/opengl/GLES3Context.hx
Normal 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 {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user