-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGlk changes #38
Comments
Actually some further ideas for IGlk: Could we make it more of a natural C# API. Things like:
Basically expanding the use of higher level functions like those in GlkUtil rather than low level ones. But if we do any of these, should we rename any functions which have a different number of arguments than the actual Glk function, to avoid confusion? And if we do make changes like this, it would be more beneficial to do a DEFAULT_DLL_NAME implementation so that the Garglk/Winglk versions don't have to duplicate the code which turns our modified API into the true Glk API. Could we distinguish between arrays which are temporary and can be on the stack, and those which must be kept around for later? My understanding is that We could make
Change to distinct reference types so that we can't mix them up, rather than putting streams, windows etc all under
|
I agree with removing the As for making
If that's a necessary change then I can do that.
Agreed, I'll see to that.
Well, my entire initial implementation was super jank. I didn't need the As for the entire
|
Sounds good, let's do this.
Maybe right for now it could assert/throw if a non-zero pointer is passed in? Just to be safe.
It's a bit over my head too... I'll see if I can get it working.
I assume that's this part: @cspiegel Could this be changed to accept memory streams? Or could we just call |
Yes, I don't think this would be too difficult to implement. I'll give it a look. |
Fix casing on Frankendrift.GlkRunner so that references work on case sensitive file systems
I've got a pull request at garglk/garglk#759 for memory Blorbs. I'll continue to test a bit, but I'm making it available for any other testing/reviews for those who are interested. |
OK, I've merged it in, so the next major Gargoyle release will support Blorb loading from memory streams. |
Return tuples rather than using out parameters?- only in GlkUtilCould we distinguish between arrays which are temporary and can be on the stack, and those which must be kept around for later? My understanding is that Span and Memory are for this purpose. So glk_put_buffer would accept a Span, but glk_stream_open_memory would accept Memory.We could make glk_request_line_event also take Memory, or go one step further: change it completely from the Glk API, to accept an initial string, and then return a string. (Unless you want to use the partial result if glk_cancel_line_event is called...)Would there be any issue cleaning up unused IGlk functions?
While most of them don't matter,
glk_stream_open_memory
in particular seems to be wrong, as it takes aIntPtr buf
rather thanbyte* buf
. Or maybe that doesn't really matter for the C interpreters, but I just can't work out how to convert it into an ArraySegment for JS marshalling ;)For the rest, it would make it slightly smaller an API for us to keep track of. No need for
glk_schannel_play
if we always useglk_schannel_play_ext
instead. Things like that.The text was updated successfully, but these errors were encountered: