Add renderer.type
This commit is contained in:
@@ -21,6 +21,7 @@ class FlashRenderer {
|
||||
public function create ():Void {
|
||||
|
||||
parent.context = FLASH (Lib.current);
|
||||
parent.type = FLASH;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ class HTML5Renderer {
|
||||
if (parent.window.backend.div != null) {
|
||||
|
||||
parent.context = DOM (cast parent.window.backend.div);
|
||||
parent.type = DOM;
|
||||
|
||||
} else if (parent.window.backend.canvas != null) {
|
||||
|
||||
@@ -74,6 +75,7 @@ class HTML5Renderer {
|
||||
if (webgl == null) {
|
||||
|
||||
parent.context = CANVAS (cast parent.window.backend.canvas.getContext ("2d"));
|
||||
parent.type = CANVAS;
|
||||
|
||||
} else {
|
||||
|
||||
@@ -87,6 +89,7 @@ class HTML5Renderer {
|
||||
#else
|
||||
parent.context = OPENGL (new GLRenderContext ());
|
||||
#end
|
||||
parent.type = OPENGL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ class NativeRenderer {
|
||||
|
||||
useHardware = true;
|
||||
parent.context = OPENGL (new GLRenderContext ());
|
||||
parent.type = OPENGL;
|
||||
|
||||
default:
|
||||
|
||||
@@ -64,6 +65,7 @@ class NativeRenderer {
|
||||
render ();
|
||||
parent.context = CAIRO (cairo);
|
||||
#end
|
||||
parent.type = CAIRO;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ class Renderer {
|
||||
public var onContextLost = new Event<Void->Void> ();
|
||||
public var onContextRestored = new Event<RenderContext->Void> ();
|
||||
public var onRender = new Event<Void->Void> ();
|
||||
public var type:RendererType;
|
||||
public var window:Window;
|
||||
|
||||
@:noCompletion private var backend:RendererBackend;
|
||||
|
||||
Reference in New Issue
Block a user