Skip to content

Commit

Permalink
added support for windows ids
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Mar 8, 2024
1 parent aa5f266 commit 8255dc5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions libs/directx/dx/Event.hx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ package dx;
public var controller : Int;
public var value : Int;
public var dropFile: hl.Bytes;
public var windowId : Int;
public function new() {
}
}
Expand Down
4 changes: 3 additions & 1 deletion libs/directx/dx/Loop.hx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ class Loop {

static function eventLoop( e : Event ) {
for( w in @:privateAccess Window.windows )
if( w.getNextEvent(e) )
if( w.getNextEvent(e) ) {
e.windowId = w.id;
return true;
}
return false;
}

Expand Down
5 changes: 4 additions & 1 deletion libs/directx/dx/Window.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class Window {
public static inline var HIDDEN = 0x000001;
public static inline var RESIZABLE = 0x000002;

static var _UID = 0;
var win : WinPtr;
public var id(default,null) : Int;
public var title(default, set) : String;
public var width(get, never) : Int;
public var height(get, never) : Int;
Expand All @@ -57,6 +59,7 @@ class Window {
this.title = title;
windows.push(this);
vsync = true;
id = ++_UID;
}

function set_title(name:String) {
Expand Down Expand Up @@ -357,7 +360,7 @@ class Window {
return false;
}

static function winGetRelativeMouseMode() : Bool {
static function winGetRelativeMouseMode() : Bool {
return false;
}

Expand Down

0 comments on commit 8255dc5

Please sign in to comment.