Skip to content

Commit a560680

Browse files
authored
Merge pull request #25 from RobDangerous/master
Fix deprecation warnings
2 parents 02986ae + 261cc11 commit a560680

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

haxe/ui/backend/AppBase.hx

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ class AppBase {
2828
var width:Int = Toolkit.backendProperties.getPropInt("haxe.ui.kha.width", 800);
2929
var height:Int = Toolkit.backendProperties.getPropInt("haxe.ui.kha.height", 600);
3030
_backgroudColor = parseCol(Toolkit.backendProperties.getProp("haxe.ui.kha.background.color", "0xFFFFFF"));
31-
System.init( { title: title, width: width, height: height }, initialized);
31+
System.start( { title: title, width: width, height: height }, initialized);
3232
}
3333

34-
private function initialized() {
34+
private function initialized(_) {
3535
Assets.loadEverything(assetsLoaded);
3636
}
3737

3838
private function assetsLoaded() {
39-
System.notifyOnRender(render);
39+
System.notifyOnFrames(render);
4040
_callback();
4141
}
4242

43-
public function render(framebuffer:Framebuffer):Void {
43+
public function render(framebuffers:Array<Framebuffer>):Void {
4444

45-
var g = framebuffer.g2;
45+
var g = framebuffers[0].g2;
4646
g.begin(true, _backgroudColor);
4747

4848
for (c in Screen.instance.rootComponents) {

haxe/ui/backend/ScreenBase.hx

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import haxe.ui.containers.dialogs.DialogButton;
55
import haxe.ui.core.Component;
66
import haxe.ui.core.MouseEvent;
77
import haxe.ui.core.UIEvent;
8+
import kha.Display;
89
import kha.input.Mouse;
910
import kha.System;
1011
import kha.graphics2.Graphics;
@@ -30,7 +31,7 @@ class ScreenBase {
3031

3132
public var dpi(get, null):Float;
3233
private function get_dpi():Float {
33-
return System.screenDpi();
34+
return Display.primary.pixelsPerInch;
3435
}
3536

3637
public var focus(get, set):Component;

0 commit comments

Comments
 (0)