Forum Replies Created
I had a small look and GLWindow extends Window and only has a few addition to Window. And Window works (there is this vsync issue with previous systems). So it’s looks doable. May be posting an issue on github could be interresting if you really need it working.
There is this vsync issue with different Mac systems for now and I’d love to see it solved as well as those gl issue. But Apple is not helping here..
here’s the commit mark made for the blank screen on mojave. it’s a sdl2 hack. But I thought you had made your own hack for your monkey2 fork. https://github.com/blitz-research/monkey2/commit/ce3a9ebdd92aa861358210e24c94d3d8c6a5631e
Maybe your problem has nothing to do with this blank screen issue on mojave, I haven’t tested the banana, just guessing here.
Since Apple has deprecated opengl with Mojave there as been a lot of troubles. I think importing latest dev sdl2 would resolve the problem (and reverting back the displaylink commit for Mac vsync). I had a try but sdl2 is configured by default to dynamic linking and there is some hack to do to get it statically linked.
Import sdl2 then it’s sdl2.SDL_StartTextInput( ) (and sdl2.SDL_StopTextInput( ) )
Lokking forward to test it in english..March 15, 2019 at 11:28 am in reply to: How to use GIT for your own projects/modules within the monkey2 repo #16129
I’m using githubDesktop on both Mac and MSWin and it has been flawless for now. Just clone your repo to the module folder. Changing the folder name if needed, and everything runs fine. The only problem is Ted2Go intellisens behaving badly when you work on files from the modules folder.
I can see some cross platform serial libraries so it should be doable. But the bmx serial package could be event better!?
I suppose you have to read tru your arduino drivers? There is no specific serial port thing in monkey2 AFAIK. But everything that can be donne in C can be imported into Monkey2 (c++ might need some glue/wrapping).
If you want some help in calling arduino with monkey2. I’ll be glad to help as I always wanted to play with an arduino. I don’t own one though, but I want to own one anyway.
If you show some C code that works I probably can help.March 5, 2019 at 6:53 pm in reply to: Assets, paths… Need some help putting together examples #16110
Just use a relative path (to your monkey2 file) and “asset::blah.bla” as amon told
Note that you can use ‘../’ to go to relative parent directory. eg “../assets/mycsv.csv”
you can also use the @ symbol to create virtual asset dirs.
eg #Import “../assets/images/@/images/”
Note that you can assign a class instance’s method to a first class function too.
The fisrt class functions has never been a problem with callbacks, for me.
To get your ‘char_t Ptr Ptr’
you might want to use ‘VarPtr myChar_tArray.Data’ as ‘Array.Data’ is already a pointer to the first element of the array.Edit doesn’t work. I’ve put some working code on the codebox below.Monkey12345678910111213141516171819202122#Import "<libc>"Function Main()Local baseStr:="y"Local cstr:=New libc.char_t[baseStr.Length+1] '1 char larger to put the null termination charbaseStr.ToCString(cstr.Data,baseStr.Length+1) 'writes the baseStr to the cstrLocal csDat:=cstr.Data 'VarPtr cstr.Data is not accepted by compiler! & won't accept VarPtr twice neitherLocal chptrptr:=Varptr csDatPrintstuff(chptrptr)EndFunction Printstuff(csptrptr:libc.char_t Ptr Ptr)Print "mx2 callback"Print String.FromCString(csptrptr)End
I’ve joined a little zip/demo code using external function pointers with first class function in various ‘directions’.
Yes, the compiler should tell you that you are using a non accepted type.
If I remember well you can also use ‘implements’ and ‘extends’
Where <T> implements myInterface
Where <T> extends myBaseClass.February 24, 2019 at 8:29 am in reply to: Fist class function in collection with struct parameter #16084
A correcting commit has arrived! Thx Mark!
Sorry to not be able to help you. I don’t know where the linker flags are.
Mark usually checks for github issues on the weekend.
The best example in monkey2 is IContainer interface.
Stack and lists for example implements IContainer and can therfore be used with eachin loops.
You can create you own container that implements icontainer and you’ll be able to use it with eachin loops.
An interface force you to respect what was planned in some way. And if you forget to implement a part of it, you’ll have a compile error.
Interfaces are usefull for generic type constrains too. (using the ‘where’ keyword)