Author
Topic: Blitzmax & macOS Mojave (Read 2803 times)

Go to a terminal. Move into your folder via "cd ~/Your/BlitzMax/Folder" (the "~" is a abbreviation for your home folder) ... or use "cd .." to go one folder "out" and "cd name" to move into the subfolder "name".

When then in your BlitzMax folder - go into the "maxide.app" folder.cd maxide.app/Contents/MacOS (case sensitive, so might be "MaxIDE.app" on your side)

to start you then type in./maxide (case sensitive, so might be "./MaxIDE" on your side)

the "./" is there to make the OS aware of the binary being exactly in this folder and not a system wide available command.

Thank you, this is exactly what I needed!! It's awesome to finally see my game running again.

The game ran almost perfect with NG. The only thing I noticed which I found odd was the mouseY() seemed to be inverted. The top of the screen was my max screen height instead of 0 and the bottom of the screen was 0. This cause my image mouse icon to go down when I moved the mouse up and up when I moved the mouse down. NG Bug?

Function DrawCursor()RepeatClsDrawImage(MouseIcon,MouseX(), MouseY())DrawText(MouseY()),10,10If KeyDown(KEY_ESCAPE) Then EndFlipForeverEnd FunctionIn windowed mode it seems to work correctly. In Full screen mode as I have here, both the mouse and the graphic icon which should appear overlapping the mouse icon behave separately. The mouse seems to move around the screen correctly but the 10x10icon is inverted.

yes, but only on full screen. It's something to do with MouseY() on fullscreen. When I move the hardware cursor to the bottom of the screen, it displays MouseY() as 0 but the 10x10icon.png will then be at the top of the screen (because MouseY() is returning 0). When I move the hardware cursor to the top of the screen it will display MouseY() as 800 and the 10x10icon.png will then be at the bottom. So the image seems to be going exactly where MouseY() is telling it to go. Just MouseY() is not where the actual mouse cursor is. Again, only in fullscreen mode. In windowed mode, everything seems to behave how it should.

In OpenGL "0,0" is at the bottom left - while in Max2D (BlitzMaX) "0,0" is on the top left, maybe there is something borked. Will create a github issue for this - maybe Brucey can verify it on his Mac.

And yes, it might be a bit "hacky" but meanwhile you could use your own "MouseY()" ... and handle the invertion on your own when doing full screen on mac.Most of the time you are better having your own Mouse type to allow easier handling of "mouse clicks" (which are not _hits_ in all cases) or blockage of clicks (avoid spamming), double clicks handling ... not to forget about handling virtual resolutions (designed: 800,600, used: 1280*720 -> black bars needed, and scaled mouse coords).

Hi. There are several issues currently with Mojave and the default OpenGL graphics modules for BlitzMax.

I would like to suggest moving over to use the SDL backend (sdl.mod) on macOS. The latest SDL has fixed all the currently known macOS issues (fullscreen y flipping, fullscreen refresh sync, etc), and their team is generally quick to fix new ones.

Generally, all you need to do is to import SDL.gl2sdlmax2d, rather than BRL.GLMax2D.If you are not using a Framework (and therefore all of BRL and Pub modules are automatically imported) you will need to switch to using the Framework statement, and then import the required modules for your project.

Thanks for getting this working on MacOS Brucey. I too upgraded my mac and found suddenly I couldn't use blitz any more. I tried NG but I had the same issue with the signing and had to launch the max IDE from the terminal. But i hate the terminal. So researched and found that you can use Automator.app on the Mac to make a very simple automation. You make a new automation and add a Utilities/Run Shell Script action. In the script, type in a script as given in this thread or as below, for me I did something like this... (you can probably figure out a more efficient one, I'm not familiar with terminal syntax stuff or how to make this 'flexible' to work on everyone's setup, so you'll have to change the folder names/path as you see fit)

cd /cd applications/blitzmaxng/maxide.app/contents/macos./maxide

then save the automation. In the save dialog, there's a dropdown option to save it as an application. Choose that. Put the application in your blitz folder or whatever you like. You can also then drag this icon into the dock to launch easily. Clicking the icon will run the automation and thus launch the IDE without having to go to the terminal.

I guess to make that work on "anyone's" computer you'd need a way to locate the app from within a shell script without knowing where it is, or have a way to modify the script. Maybe make a little blitz app that finds the path of the blitzmax folder and auto-generates an automator action or something?

Also you can change the icon of the automator app by simply right-clicking its icon and doing a 'Get Info', then click and drag some other application icon (e.g. maxide app) and drop it onto the top left of the getinfo window where it shows the icon. .. mouse should show a plus sign.... as soon as you let go it assigns the icon to the app. Now the automator app 'looks like' the maxide app.

EDIT2:ok i got that to work by removing a call to a driver initialisation within MiniB3D.

it now builds and runs, very happy to see that!

... but fails after about half a second after repeated calls to linkedlist.ValueAtIndex(index) - i've tested that the index being requested is less than the Count() of the list, but it keeps failing (runtime error "List index out of range), often at the higher indices of the list, but always within its Count(). the list is 1690 entities large, and it tends to fall over at indices like 1592. not sure what i'm doing wrong here.

at somewhat of a loss on this one.

i should mention that i had to switch back to BRL.GLMax2D as the SDL backend didn't work. i have hacked Linkedlist.bmx to return null when it can't find ValueAtIndex(index), and things seem to work, except that i had to hack in the MouseY() flip because of not using SDL.

i think this is solid enough for me to make the move to Mojave, possibly.

EDIT3: could the list issue be related to this: https://github.com/bmx-ng/brl.mod/issues/44? i hacked out 'IF _count=-1' in BRL.Linkedlist.Count(), so that it always returns the actual number rather than the cached one. Behaviour is now as expected, but there is obviously a better way to do this (fixing the thing that causes _count to hold the incorrect value!)

so - i'm going to try a clean install of Mojave, but before i do, am i going to see issues with the fact that i'm still on GLMax2D? ideally i'd like to switch to the SDL backend, but i have no idea how to write the Framework commands to import what i need