Skip to content

Commit

Permalink
Merge pull request #25 from RobDangerous/master
Browse files Browse the repository at this point in the history
Fix deprecation warnings
  • Loading branch information
ianharrigan authored Sep 21, 2018
2 parents 02986ae + 261cc11 commit a560680
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions haxe/ui/backend/AppBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ class AppBase {
var width:Int = Toolkit.backendProperties.getPropInt("haxe.ui.kha.width", 800);
var height:Int = Toolkit.backendProperties.getPropInt("haxe.ui.kha.height", 600);
_backgroudColor = parseCol(Toolkit.backendProperties.getProp("haxe.ui.kha.background.color", "0xFFFFFF"));
System.init( { title: title, width: width, height: height }, initialized);
System.start( { title: title, width: width, height: height }, initialized);
}

private function initialized() {
private function initialized(_) {
Assets.loadEverything(assetsLoaded);
}

private function assetsLoaded() {
System.notifyOnRender(render);
System.notifyOnFrames(render);
_callback();
}

public function render(framebuffer:Framebuffer):Void {
public function render(framebuffers:Array<Framebuffer>):Void {

var g = framebuffer.g2;
var g = framebuffers[0].g2;
g.begin(true, _backgroudColor);

for (c in Screen.instance.rootComponents) {
Expand Down
3 changes: 2 additions & 1 deletion haxe/ui/backend/ScreenBase.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import haxe.ui.containers.dialogs.DialogButton;
import haxe.ui.core.Component;
import haxe.ui.core.MouseEvent;
import haxe.ui.core.UIEvent;
import kha.Display;
import kha.input.Mouse;
import kha.System;
import kha.graphics2.Graphics;
Expand All @@ -30,7 +31,7 @@ class ScreenBase {

public var dpi(get, null):Float;
private function get_dpi():Float {
return System.screenDpi();
return Display.primary.pixelsPerInch;
}

public var focus(get, set):Component;
Expand Down

0 comments on commit a560680

Please sign in to comment.