Game Controllers in BlitzMax NG on Mac?
I'm creating a Mac version of my PC game, the game plays great when compiled of Mac BlitzMax NG except for game controller input.
It looks like I need to use either the tjoystickdriver or the third-party module sdlgamecontroller, is their a guide for game controllers on Mac BlitzMax NG?
Well, there's the docs https://github.com/bmx-ng/sdl.mod/blob/master/sdlgamecontroller.mod/doc/intro.bbdoc
and there's docs for all the functions https://github.com/bmx-ng/sdl.mod/blob/master/sdlgamecontroller.mod/sdlgamecontroller.bmx
Is that enough?
Otherwise maybe read a non-Blitz SDL2 tutorial like this https://lazyfoo.net/tutorials/SDL/20_force_feedback/index.php
Blitzmax SDL worked nicely on my Catalina Mac.
Thanks Mark, plenty docs to read through for me - my Blitz is a bit rusty.
Would TJoystickDriver allow the use of JoyHit/JoyDown etc or is the SDLGameController the best way to go?
Yes of course, I think you're supposed to use pub.Freejoy not pub.Joystick which it imports.
According to this https://github.com/bmx-ng/pub.mod/issues/43 there is a bug with pub.Freejoy on MacOS, so for now you should use the sdl.Gamecontroller.
Now able to read the joypad by using:
However, when placing the above into my game it no longer runs - the framework command means that no other modules are imported?
Seems that the brl.timer and sdl framework can not be run together causing the CreateTimer commands not to work. I removed Timers from my game for the moment and the game ran and the sdlgamecontroller was able to read the xbox 360 pad - however it appears the "JoyHit" command does not work.
Reply To Topic (minimum 10 characters)
Please log in to reply