Add renderer.type

This commit is contained in:
Joshua Granick
2015-08-20 23:49:56 -07:00
parent 6344949f57
commit a4e6cbaafe
5 changed files with 8 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ class FlashRenderer {
public function create ():Void {
parent.context = FLASH (Lib.current);
parent.type = FLASH;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;