March 21, 2019, 09:14:24 PM

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

Offline Derron

  • Hero Member
  • *****
  • Posts: 1677
Re: Blitzmax & macOS Mojave
« Reply #45 on: December 10, 2018, 07:17:12 AM »
Yes Mac OS X hides the folder in the finder/File Manager.

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.


bye
Ron

Offline MickMuze

  • Jr. Member
  • **
  • Posts: 6
Re: Blitzmax & macOS Mojave
« Reply #46 on: December 11, 2018, 12:34:36 PM »
Thank you, this is exactly what I needed!! :D 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?

Offline Derron

  • Hero Member
  • *****
  • Posts: 1677
Re: Blitzmax & macOS Mojave
« Reply #47 on: December 11, 2018, 01:45:24 PM »
Maybe an SDL bug? Can you create a simple example and note down what OS version you use on what gpu?

I only run an older OS X on a "non certified computer" - so others need to chime in when it comes to verifying your issue - Qube has a Mac, Brucey has a Mac, others surely too


bye
Ron

Offline MickMuze

  • Jr. Member
  • **
  • Posts: 6
Re: Blitzmax & macOS Mojave
« Reply #48 on: December 13, 2018, 02:37:46 AM »
My OS is Mojave version 10.14.2
GPU: Intel Iris Plus Graphics 655 1536 MB

Code: [Select]
Strict
Graphics 1280,800,32,60

Global MouseIcon:TImage
MouseIcon = LoadImage("10x10icon.png")

DrawCursor()

Function DrawCursor()

Repeat
Cls
DrawImage(MouseIcon,MouseX(), MouseY())
DrawText(MouseY()),10,10
If KeyDown(KEY_ESCAPE) Then End
Flip
Forever

End Function

In 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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 1677
Re: Blitzmax & macOS Mojave
« Reply #49 on: December 13, 2018, 06:12:55 AM »
So hardware cursor is correct but custom image drawn at mouseX,mouseY is inverted?

Bye
Ron

Offline MickMuze

  • Jr. Member
  • **
  • Posts: 6
Re: Blitzmax & macOS Mojave
« Reply #50 on: December 13, 2018, 06:37:41 AM »
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.
 

P.S. MouseX() is not inverted. It is always behaving as it should.

Offline Derron

  • Hero Member
  • *****
  • Posts: 1677
Re: Blitzmax & macOS Mojave
« Reply #51 on: December 13, 2018, 08:36:37 AM »
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.


bye
Ron

Offline Derron

  • Hero Member
  • *****
  • Posts: 1677
Re: Blitzmax & macOS Mojave
« Reply #52 on: December 13, 2018, 08:44:29 AM »
you can follow progress of the issue there:
https://github.com/bmx-ng/brl.mod/issues/79

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).


bye
Ron

Offline MickMuze

  • Jr. Member
  • **
  • Posts: 6
Re: Blitzmax & macOS Mojave
« Reply #53 on: December 14, 2018, 03:17:30 AM »
I'll keep checking over there. I did whip up a cheap kinda hack around for it that works ok but yeah, kinda ugly. Hopefully this problem gets fixed at some point. Thanks again for your help.

Offline Xerra

  • Sr. Member
  • ****
  • Posts: 471
    • Retro Evolved
Re: Blitzmax & macOS Mojave
« Reply #54 on: December 31, 2018, 06:21:33 PM »
I just fired up the newest Blitzmax build as I wanted to build an old game of mine so I could potentially sequel it and found this mouse problem as well.

Offline sonic

  • Jr. Member
  • **
  • Posts: 10
Re: Blitzmax & macOS Mojave
« Reply #55 on: January 01, 2019, 04:11:56 PM »
sooo i got this to run at least using the terminal method. but i am unable to get it to build minib3d - it seems not to say which line is causing the issue, which makes it tricky to debug...

the error i get is: Can't find interface for module 'brl.blitz'

Online Yellownakji

  • Full Member
  • ***
  • Posts: 116
  • Whoop-de-doo-ba-dooo!
Re: Blitzmax & macOS Mojave
« Reply #56 on: January 03, 2019, 04:21:48 AM »
sooo i got this to run at least using the terminal method. but i am unable to get it to build minib3d - it seems not to say which line is causing the issue, which makes it tricky to debug...

the error i get is: Can't find interface for module 'brl.blitz'

Check that [NG Install dir]\Mod\BRL\blitz exists and that the module is built.

Offline Derron

  • Hero Member
  • *****
  • Posts: 1677
Re: Blitzmax & macOS Mojave
« Reply #57 on: January 03, 2019, 08:08:20 AM »
Quote from: Brucey via github issue
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.
source: https://github.com/bmx-ng/brl.mod/issues/79


bye
Ron

Offline imaginaryhuman

  • Jr. Member
  • **
  • Posts: 1
Re: Blitzmax & macOS Mojave
« Reply #58 on: January 19, 2019, 09:31:02 PM »
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.

Little trick I learned from here:
https://stackoverflow.com/questions/281372/executing-shell-scripts-from-the-os-x-dock

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.

Offline sonic

  • Jr. Member
  • **
  • Posts: 10
Re: Blitzmax & macOS Mojave
« Reply #59 on: January 28, 2019, 12:57:08 PM »
hi there,

i'm still plugging away at this because High Sierra is very unstable on my macbook and i really need to move to Mojave if possible.

i have got minib3d to build as a module by switching to the SDL backend. all modules seem correctly built now.

however, trying to build my project, it says that it "Can't find interface for module 'sidesign.minib3d" - not sure where to go from here.

EDIT:
somehow i spotted the TGlobal inside Reflection was clashing with TGlobal in minib3d. i renamed it to MGlobal, and it finally gets as far as 'Executing' - however, i now see this error:

"Cannot initialise SDLSystemDriver. System driver already configured as MacOSSystemDriver"

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