BlitzMax NG compile error on Linux (Zorin OS)

Started by sphinx, July 06, 2019, 07:30:24

Previous topic - Next topic

sphinx

My game compile and starts without any problem but keyboard and mouse are not working at all!
I tried a very simple test thinking maybe my game has a specific problem:

Graphics 800,600,0

While Not KeyHit(key_escape)
Cls
DrawText Rand(100),100,100
Flip
Wend


but it does not work too!

I tried to rebuild the modules and I got the error attached
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Derron

Did you try on a major linux distribution? (Ubuntu, Mint, Manjaro, ... )?

Just had a look and it seems they sell an "ultimate version" which sounds like "our other releases are crippled somewhere".

----

What NG version have you installed?
What gcc is installed ($ gcc -v) ?
What "Zorin OS" have you installed?
Are you using a "copied from some computer" NG version which might have these precompilates already? -> do not "quick" compile if having done so.


bye
Ron

sphinx

#2
Quote from: Derron on July 06, 2019, 07:43:40
Did you try on a major linux distribution? (Ubuntu, Mint, Manjaro, ... )?

Just had a look and it seems they sell an "ultimate version" which sounds like "our other releases are crippled somewhere".

----

bye
Ron

Same on Ubuntu!
Even on OSX when I try using :
Import SDL.GLSDLMax2D

On Linux and without SDL module I have no control over mouse and keyboard!

QuoteWhat NG version have you installed?
I have the latest version of NG from Github BlitzMax Linux.x64 v0.105.3.35

QuoteWhat gcc is installed ($ gcc -v) ?
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)

QuoteWhat "Zorin OS" have you installed?
Core essential

QuoteAre you using a "copied from some computer" NG version which might have these precompilates already? -> do not "quick" compile if having done so.
I will check!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Derron

With vanilla/legacy BlitzMax you get keystrokes recognized?

When utilizing SDL you get keystrokes?


bye
Ron

Derron

Code (Blitzmax) Select

SuperStrict
Framework Brl.StandardIO
Import Brl.GLMax2D

Graphics 800,600,0

'maybe enable this?
'EnablePolledInput()

Local lastDown:Int = -1
Local lastHit:Int = -1
Local lastHits:String[20]
Local lastDowns:String[20]
While Not KeyHit(KEY_ESCAPE)
Cls

'print out all hit keys
Local hitKeyNum:Int = 0
For Local i:Int = 0 Until 255
Local kh:Int = KeyHit(i) 'state is reset after this command!
Local kd:Int = KeyDown(i) 'state is reset after this command!

If kh Then lastHit = i
If kd Then lastDown = i

If kh Then lastHits = lastHits[1..] + ["Hit: " + i + " at " + MilliSecs()]
If kd Then lastDowns = lastDowns[1..] + ["Downs: " + i + " at " + MilliSecs()]

If kh Or kd
DrawText("key " + i + "  hit=" + kh + "  down=" + kd, 100, 20 + hitKeyNum*10)
hitKeyNum :+ 1
EndIf
Next

For Local i:Int = 0 Until lastHits.length
DrawText(lastHits[i], 350, 20 + i * 10)
Next

For Local i:Int = 0 Until lastDowns.length
DrawText(lastDowns[i], 550, 20 + i * 10)
Next

Flip
Wend


try this (and maybe EnablePolledInput() - albeit graphics creation should do this)

sphinx

Quote from: Derron on July 06, 2019, 08:05:41
Code (Blitzmax) Select

SuperStrict
Framework Brl.StandardIO
Import Brl.GLMax2D

Graphics 800,600,0

'maybe enable this?
'EnablePolledInput()

Local lastDown:Int = -1
Local lastHit:Int = -1
Local lastHits:String[20]
Local lastDowns:String[20]
While Not KeyHit(KEY_ESCAPE)
Cls

'print out all hit keys
Local hitKeyNum:Int = 0
For Local i:Int = 0 Until 255
Local kh:Int = KeyHit(i) 'state is reset after this command!
Local kd:Int = KeyDown(i) 'state is reset after this command!

If kh Then lastHit = i
If kd Then lastDown = i

If kh Then lastHits = lastHits[1..] + ["Hit: " + i + " at " + MilliSecs()]
If kd Then lastDowns = lastDowns[1..] + ["Downs: " + i + " at " + MilliSecs()]

If kh Or kd
DrawText("key " + i + "  hit=" + kh + "  down=" + kd, 100, 20 + hitKeyNum*10)
hitKeyNum :+ 1
EndIf
Next

For Local i:Int = 0 Until lastHits.length
DrawText(lastHits[i], 350, 20 + i * 10)
Next

For Local i:Int = 0 Until lastDowns.length
DrawText(lastDowns[i], 550, 20 + i * 10)
Next

Flip
Wend


try this (and maybe EnablePolledInput() - albeit graphics creation should do this)

Same problem!!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

sphinx

Quote from: Derron on July 06, 2019, 07:54:16
With vanilla/legacy BlitzMax you get keystrokes recognized?

When utilizing SDL you get keystrokes?


bye
Ron

I think I have a problem and something is missing because with legacy BlitzMax I can not even compile any code!!!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Derron

Sometimes you should consider to add the exact errors ("cannot compile" is not an error message).


My code should work if your x-system is properly configured and emitting events.


run this in a terminal:

xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'

and when the window opened, press some keys.
In the terminal you should see the keys hit.


If so we could create some advanced codes to see if events are properly triggered or not.
Please also post which version of NG you are using. And please first start with an Ubuntu/Mint distribution until we got this working - we can later on try to tackle that Zorin OS.

bye
Ron

sphinx

Quote from: Derron on July 06, 2019, 09:44:51
Sometimes you should consider to add the exact errors ("cannot compile" is not an error message).


My code should work if your x-system is properly configured and emitting events.


run this in a terminal:

xev | awk -F'[ )]+' '/^KeyPress/ { a[NR+2] } NR in a { printf "%-3s %s\n", $5, $8 }'

and when the window opened, press some keys.
In the terminal you should see the keys hit.


If so we could create some advanced codes to see if events are properly triggered or not.
Please also post which version of NG you are using. And please first start with an Ubuntu/Mint distribution until we got this working - we can later on try to tackle that Zorin OS.

bye
Ron

Thanks Ron.

I tried on Ubuntu and keys I hit are shown but they appear bit slow, I mean not in real time as I hit!

My NG version :
MaxIDE 1.52 [ng] (x64)
BCC Version : bcc [ng] Release version 0.105
bmk Version : bmk 3.35 mt-linux-x64 / gcc 070400
GCC : 7
G++ : 7
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com