Installing a BlitzMax App on user MAC

Started by Midimaster, July 02, 2021, 13:47:17

Previous topic - Next topic

Qube

Quote from: Steve Elliott on July 05, 2021, 11:01:51
No it's the 'Command' Key and right click open.  But the app does not function correctly, the background window flashes multi-coloured garbage, there's a menu that takes user information and doesn't seem to progress and a small menu that doesn't function either...But I was able to run it easily without turning off security globally.

I have a 2017 MacBook Pro.
It's definitely the 'control' key here. Just tested again for sanity. Control Key > Right mouse click > Click Open >> Popup window, erm popups up > Click Open.  \o/
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Steve Elliott

lol come on Apple, some consistency. Command Key on MacBook Pro with Big Sur. Nothing else works.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

iWasAdam

control key + mouse click opens app menu - then click "open"

Midimaster

this may explain the installation problems the user had...

I told him only to use the CTRL-Key. Maybe he should try it again with CMD-Key ...


As I have not a single problem with my app I can not simulate his problems.
Did you all try this with my AURIS-App Version 1.10 from the download?

I would like to know what happended afterwards.
Did you reach the licence dialog?
Have you been able to CANCEL the dialog.
Did you now reach the DEMO-Version -Dialog?
Have you been able to click on CONTINUE?
Did you also see garbage colors instead of a blue canvas in the background (like Steve reported)?
Did anybody get the message (Something like translated) "Upps ...this file not longer exists..."?


...back from Egypt

Steve Elliott

#19
Ok after a few tests, CTRL does not work for me...BUT for the other two keys you must *hold down* either the Option or Command key, letting go of the key and the menu changes.  You can then simply select Open to allow the program to run.

Quote
Did you all try this with my AURIS-App Version 1.10 from the download?

Yes.

Quote
Have you been able to CANCEL the dialog.

Yes.

Quote
Did anybody get the message (Something like translated) "Upps ...this file not longer exists..."?

No.

Quote
Did you also see garbage colors instead of a blue canvas in the background (like Steve reported)?

Midimaster I wonder if the graphics cards are the problem?  Mine is an Intel Iris Plus Graphics 640 1536 MB.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

iWasAdam

Did you reach the licence dialog?
yes

Have you been able to CANCEL the dialog.
no

Did you now reach the DEMO-Version -Dialog?
yes

Have you been able to click on CONTINUE?
yes

Did you also see garbage colors instead of a blue canvas in the background (like Steve reported)?
no

Did anybody get the message (Something like translated) "Upps ...this file not longer exists..."?
no - but upps is the link html page

there are a lot of niggles with the UI and Mac apps:
1. very wierd ui colors for licence dialog
2. completely non standard menu items
- file should be second
- options should be help
- duplication of menu items with different name (exit/quit) etc

Midimaster

#21
Here are 4 screenshots how the start on a mac should look like:

1.licence window:




2.demo-dialog window:




3.running without selected anything:




4.selected Theme-Intervals-Dictation:



Mac Menu Problems

Quote from: iWasAdam on July 06, 2021, 06:51:28
...there are a lot of niggles with the UI and Mac apps:
1. very wierd ui colors for licence dialog
2. completely non standard menu items
- file should be second
- options should be help
- duplication of menu items with different name (exit/quit) etc...

I see, what you mean... But the first three menus are not mine. I only created "File", "Theme" and "Options"
This must be something system default at the mac. Do you know, where I can manipulate it?

By the way.... starting MaxIDE: it looks the same way.
It looks like these are limitations by BlitzMax MAC
...back from Egypt

Steve Elliott

Midimaster are you clearing the screen each frame?  If not then that might explain the garbage.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Midimaster

Quote from: Steve Elliott on July 05, 2021, 21:01:21

Did you also see garbage colors instead of a blue canvas in the background (like Steve reported)?
Midimaster I wonder if the graphics cards are the problem?  Mine is an Intel Iris Plus Graphics 640 1536 MB.


Steve, I found a code part that could be perhaps responsible for the flicker. In my own "music education-SDK" there was a old function that produce flickers if somebody tries to use the app on a not conform OS. The code to find out the OS was:
Code (BlitzMax) Select

Function DiesesOs%()
?MacOs
Return 0
?Win32
Return (GetVersion() & $f)*10  + ((GetVersion() Shr 8) & $f)
?
End Function


This should return 0 in case of OsX or a number in case of WINDOWS. But now I see that if none of the both systems if "valid" this function can return NULL. This maybe could cause errors in other code parts of the code (like the flicker)

By the way... This would mean that the compiler directive
?MacOs
would not work correct on BlitzMax NG.

I replaced the function with ...
Code (BlitzMax) Select
Function DiesesOs%()
Return 0
End Function

...because I dont not need this functionality in AURIS


Could you please be so kind and download the new version 1.11 to your computer again?
Version 1.11: http://www.midimaster.de/download/AurisOsxBigSur.zip

The test whether the flicker is still there.

Thanks a lot.
...back from Egypt

Derron

Quote from: Midimaster on July 06, 2021, 09:26:32
Code (BlitzMax) Select

Function DiesesOs%()
?MacOs
Return 0
?Win32
Return (GetVersion() & $f)*10  + ((GetVersion() Shr 8) & $f)
?
End Function


This should return 0 in case of OsX or a number in case of WINDOWS. But now I see that if none of the both systems if "valid" this function can return NULL. This maybe could cause errors in other code parts of the code (like the flicker)

No ... It does not return "Null" ... it returns "0" as the returned value is an integer - and integer of "nothing" is in BlitzMax "0".

so for Mac and "undefined OS" it returns "0".


bye
Ron

Steve Elliott

Still flicker and garbage in the new version.  But like I said, are you clearing the canvas each frame?  If not that could cause flicker.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

iWasAdam

One thing to really think about with macos and blitzng is this:
almost all of what makes a mac a mac, YOU will have to sort out in your app yourself. blitzNG 'may' do a bit here and a bit there. but in general YOU will have to find out where it is doing things differently and write your own patches to make it 'correct'

E.G.
the menu thing

Midimaster

#27
thanks to you both. I will again check twice whether I have any FLIP problems.
The code is quit easy and called by Events:
Code (BlitzMax) Select

While WaitEvent()
'Print "!"
   Select EventID()
Case EVENT_TIMERTICK
TimerTickt()  ' calls also casualy Malen()

    Case EVENT_GADGETPAINT
Malen
        ...
end select



Function Malen()
Local Fenster:TGraphics=CanvasGraphics(mdi.Canvas)
SetGraphics Fenster
SetAlpha 1
SetColor 255,255,255
SetScale 1,1
SetClsColor 44,55,88
Cls
SetColor 64,75,108
DrawRect HellBalkenX,0,300,1200

Local dm%=DemoWindow.Taster()
Select SpielMode
Case KEIN_SPIEL
PapierText= LocalizeString("{{Phrase4}}")
Case FINDE_INTERVALL
Spiel_FindeIntervall
Case FINDE_AKKORD
Spiel_FindeAkkord
Case FINDE_MELODIE
Spiel_FindeMelodie
Default

End Select
If AlleButtonSichtbar=AN
ButtonTyp.DrawAllButtons()
EndIf
If InstrumentSichtbar=AN
Smilys()
If dm=0 CheckSmily()
KlavierTyp.Draw
MonoChord.Draw
EndIf
TextPaperGame
DrawPunkte
If NotenSichtbar=AN
Noten.Draw
If dm=0 Noten.ChangeOneAtMaus
EndIf
DemoWindow.DemoRotierer()
Flip 0

If AktivesFenster()=LektionenAssistent.Window
Fenster:TGraphics=CanvasGraphics(LektionenAssistent.Canvas)
SetGraphics Fenster
SetAlpha 1
SetColor 255,255,255
SetScale 1,1
SetClsColor 255,245,235
Cls
AssiText.Draw
ShowAssistent
Flip 0
EndIf
End Function


It starts with a CLS and ends with a FLIP. Between this all emelents are drawn. The last element is the rotating word "DEMO" if it is a demo version.

Only if additional the LektionenAssistent.Window is activ there is a second Canvas-Action. But this is off when starting the app.

So you see, it looks very harmless and tidy.


My biggest problem is still that it runs on my mac perfect. This makes it difficult to find the reason. Only with collges like you I can move forward.

Thanks again to the awesome community here.

Mac Menu

Quote from: iWasAdam on July 06, 2021, 10:56:56
... but in general YOU will have to find out where it is doing things differently and write your own patches to make it 'correct'
E.G.
the menu thing

Does somebody with BlitzMax NG know how to get into these 3 mac-pre-defined menu entries? At the moment I coded only my 3 menus and there are added as column no. 4, 5 and 6 in the  mac menu.


Global Menus:Tgadget[70]

Const MENU_FILE%=1 , MENU_SPIEL%=2 , MENU_OPTI%=5
Const MENU_EXIT%=15  ,MENU_OPEN%=10, MENU_CREATE%=11
Const MENU_GRUPPE_INTERVALL%=20,MENU_INTERVALL%=21, MENU_WIS_INTERVALL%=22
Const MENU_GRUPPE_AKKORD%=30, MENU_AKKORD%=31,MENU_WIS_AKKORD%=32
Const MENU_MELODIE%=40
Const MENU_INTERNET%=50 ,MENU_ABOUT%=51, MENU_HELP%=52 , MENU_UPDATE%=53, MENU_PARA%=54,MENU_LIZENZ%=55
Const MENU_LANG%=60

Function FormLoad()
Local flags%=WINDOW_DEFAULT|WINDOW_CLIENTCOORDS
Window= CreateWindow("AURIS" , 100 , 100 , WindowBreite , WindowHoehe , Null , Flags%)

Canvas=CreateCanvas(0 , 0 , GadgetWidth(Desktop()), GadgetHeight(Desktop()) , Window)
SetGadgetLayout Canvas , 1,1,1,1


Menus[MENU_FILE] = CreateMenu("{{File}}   ",0,WindowMenu(Window))
Menus[MENU_OPEN] = CreateMenu ("{{Open}}                   " , MENU_OPEN , Menus[MENU_FILE],0,0)
Menus[MENU_CREATE] = CreateMenu ("{{Create exercise}}                   " , MENU_CREATE , Menus[MENU_FILE],0,0)
CreateMenu "" , 0 , Menus[MENU_FILE] ,0,0
Menus[MENU_EXIT] = CreateMenu ("{{Exit}}" , MENU_EXIT , Menus[MENU_FILE] ,0,0 )
Menus[MENU_SPIEL] = CreateMenu("{{Theme}}   ",0,WindowMenu(Window))
Menus[MENU_GRUPPE_INTERVALL]= CreateMenu(  "{{Intervalls}}" , MENU_INTERVALL , Menus[MENU_SPIEL] ,0,0 )
Menus[MENU_INTERVALL]= CreateMenu(  "{{Listening}}" , MENU_INTERVALL , Menus[MENU_GRUPPE_INTERVALL] ,0,0 )
Menus[MENU_WIS_INTERVALL]= CreateMenu(  "{{Dictation}}" , MENU_WIS_INTERVALL , Menus[MENU_GRUPPE_INTERVALL] ,0,0 )

Menus[MENU_GRUPPE_AKKORD]= CreateMenu(  "{{Chords}}" , MENU_AKKORD , Menus[MENU_SPIEL] ,0,0 )
Menus[MENU_AKKORD]= CreateMenu(  "{{Listening}}" , MENU_AKKORD , Menus[MENU_GRUPPE_AKKORD] ,0,0 )
Menus[MENU_WIS_AKKORD]= CreateMenu(  "{{Dictation}}" , MENU_WIS_AKKORD , Menus[MENU_GRUPPE_AKKORD] ,0,0 )

Menus[MENU_MELODIE]= CreateMenu(  "{{Melody}}" , MENU_MELODIE , Menus[MENU_SPIEL] ,0,0 )
Menus[MENU_OPTI] = CreateMenu("{{Options}}   ",0,WindowMenu(Window))
Menus[MENU_ABOUT]= CreateMenu(  "{{Info about}} Auris" , MENU_ABOUT , Menus[MENU_OPTI] ,0,0 )

Menus[MENU_PARA]= CreateMenu(  "{{Parameter}}" , MENU_PARA , Menus[MENU_OPTI] ,0,0 )
Menus[MENU_INTERNET]= CreateMenu(  "Homepage Midimaster" , MENU_INTERNET , Menus[MENU_OPTI] ,0,0 )
Menus[MENU_HELP]= CreateMenu(  "{{Help}}" , MENU_HELP , Menus[MENU_OPTI] ,0,0 )
Menus[MENU_LIZENZ]= CreateMenu(  "{{Licence}}" , MENU_LIZENZ , Menus[MENU_OPTI] ,0,0 )

SwitchSomeMenus ([10,11], [0])
SwitchSprache IniClass.Value("", "Allgemein", "Sprache")
UpdateWindowMenu window
End Function





...back from Egypt

Derron

#28
Code (Blitzmax) Select

        If AktivesFenster()=LektionenAssistent.Window
                         Fenster:TGraphics=CanvasGraphics(LektionenAssistent.Canvas)
                        SetGraphics Fenster


"Fenster:TGraphics=" is not needed. "Fenster =" will do too (but makes no difference at the end :)

So ... what is "SetGraphics" doing ?

SetGraphics() is defined in "brl.mod/graphics.mod"
Code (BlitzMax) Select

Function SetGraphics( g:TGraphics )
If Not g
If _driver And _graphics _driver.SetGraphics Null
_graphics=Null
_gWidth=0
_gHeight=0
_gDepth=0
_gHertz=0
_gFlags=0
_gx=0
_gy=0
Return
EndIf
Local d:TGraphicsDriver=g.Driver()
If d<>_driver
If _driver And _graphics _driver.SetGraphics Null
_graphicsModes=Null
_driver=d
EndIf
g.GetSettings _gWidth,_gHeight,_gDepth,_gHertz,_gFlags,_gx,_gy
d.SetGraphics g
_graphics=g
End Function

- if no "g" was passed, a reset would be done
- if "g" was passed but using a different driver (eg you switch from OGL to DX on Windows) the old object would be cleaned up
- in all cases some settings would be read (GetSettings...) and
- in all cases the driver's "SetGraphics" would be called


(driver).SetGraphics is most probably from brl.mod/glmax2d.mod/glmax2d.bmx (as you talk about Mac OS and DX is not available there :) ):
Code (Blitzmax) Select

Method SetGraphics( g:TGraphics ) Override
If Not g
TMax2DGraphics.ClearCurrent
GLGraphicsDriver().SetGraphics Null
Return
EndIf

Local t:TMax2DGraphics=TMax2DGraphics(g)
Assert t And TGLGraphics( t._graphics )

GLGraphicsDriver().SetGraphics t._graphics

ResetGLContext t

t.MakeCurrent
End Method


As you see, it will call these three lines each time you call "SetGraphics Fenster":
Code (Blitzmax) Select

GLGraphicsDriver().SetGraphics t._graphics

ResetGLContext t

t.MakeCurrent



OK ... and if this leads to flicker or issues (eg the project matrix blows up or whatever...) then maybe we could simply skip that?

Code (Blitzmax) Select

       If AktivesFenster()=LektionenAssistent.Window
                        'only set new graphics if needed
                        if Fenster <> CanvasGraphics(LektionenAssistent.Canvas)
                          Fenster=CanvasGraphics(LektionenAssistent.Canvas)
                          SetGraphics Fenster
                        endif

A pity in your case it wont be "skipable" as you always set the canvas back to "mdi.canvas" at the begin of Malen(). So take this code just as a simple "showcase" on how to avoid doing stuff if not needed.


So something to say about the begin of Malen()

Function Malen()
                Local Fenster:TGraphics=CanvasGraphics(mdi.Canvas)
                        SetGraphics Fenster

The issue here is that you cannot check if the current graphics object is "mdi.canvas" ("Fenster") already.
For this you would need to backup the current graphics object each time you "SetGraphics" a new one.

Code (BlitzMax) Select

global currentGraphics:TGraphics


SetGraphics theOneToSet
currentGraphics = theOneToSet

(Or call a custom function "MySetGraphics()" which automates that for you).

Using the currentGraphics set means you could skip setting the mdi.canvas on each call to Malen() - as long as other canvases weren't "activated" (SetGraphics).


I am NOT knowing if this helps or not - but it minimizes "switches" between the canvases and potential issues inside the functions called on canvas changes.


PS: Next to brl.glmax2d you could always try if the sdl.mod-stuff works better.

bye
Ron

Midimaster

#29
Quote from: Steve Elliott on July 06, 2021, 08:53:42
Midimaster are you clearing the screen each frame?  If not then that might explain the garbage.

Steve, may I ask you for help again?

I reduced the code at the Malen() function to a basic minimum. I added Derron sugesstion of not calling always the SetGraphics(), I removed to rotating DEMO word temporary. I set the Timer-Tick to 60Hz, I remove the double calling of Malen(). Now it is only called once by TimerTickt().

Code (BlitzMax) Select
Function Malen()
Global Fenster:TGraphics
If Fenster=NULL
Fenster=CanvasGraphics(mdi.Canvas)
SetGraphics Fenster
Endif
SetAlpha 1
SetColor 255,255,255
SetScale 1,1
SetClsColor 44,55,88
Cls

SetColor 64,75,108
DrawRect HellBalkenX,0,300,1200
.....
TextPaperGame
DrawPunkte
If NotenSichtbar=AN
Noten.Draw
If dm=0 Noten.ChangeOneAtMaus
EndIf
' DemoWindow.DemoRotierer()
Flip 0
        Return
.......



All I want to know is again: do you still see the color garbage when starting the app? As a second test you could select "THEME INTERVALL - LISTENING" from the menu and report whether you see this:

(Dont worry, when you cannot do anything in this testversion: Mouseactions are ignored)


Then close the app

This time I used a new link. Version 1.12:
www.midimaster.de/downloads/AurisTest.app.zip


Of course everybody else with a MAC can also help testing the app.
...back from Egypt