Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds D&D support for DirectX in a similar fashion to hlsdl. There are some caveats thought.
Small note on buffer formatting: SDL implementation requires
String.fromUTF8
(since SDL buffer is UTF8) to convert the buffer into Haxe String. DX needsString.fromUCS2
as it's rawDragQueryFileW
buffer output.Big note on GC shenanigans:
Due to the fact that events are queued and consumed asynchronously - string buffers of dropped files are added to gc root, as well as require extra checks on event type when consuming events/destroying window. This is mandatory, because when buffer is not rooted - if GC runs in any circumstance - we get garbage data on event consume stage. And extra checks on type are here to ensure there's no gc root memory leaks.
This could be alleviated if
dx_event*
array was properly GC-managed list of dx.Event instances instead of data storage that is being memcopy'd on consumption. But that would require pretty substantial rewrites and breaking changes.Additionally, haxelib.json versions of both hldx and hlsdl were bumped. I also would like to note that it's better to decouple those versions from HL version as to make it much easier to add new features when working with nightly HL, and not needing to hack into
hl_ver
or writing code that won't work on current HL version but will on next HL release that happens who knows when.