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