Current status of GLB iPhone

Previous topic - Next topic

doimus

Hi,

I've been away from the webz for a few months (being father to a 10 mo. old is exhausting!) but I'm slowly getting back on my feet again.  I've occasionally lurked here and there, but I kind of lost track of the overall progress in the GLB world.


So, what's the current status, especially on the iPhone front?
Can someone give the quick summary: what's new, what's in, what's isn't, limitations, etc.

I've seen in other thread that Gernot managed to get GRABSPRITE to work and that there are some issues with multitasking on new iOS... that's the kind of info I want to know. So, hit me.

jaywat

It's not just that there are some issues with multi-tasking. GLBasic apps crash on exit on any multi-tasking capable device, and don't get to execute GLB_ON_QUIT. If you have an old device, it seems to just fall back to OS3 methods, GLB_ON_QUIT is called, and the app exits without error. So as long as you're not developing for iPhone 3GS, iPhone 4, or a 3g iPod Touch, you're fine.

Sorry. I'm done now. I really don't want to derail your thread (indeed, if anyone wants to reply, please do it in my thread about it), but I couldn't leave it at "there are some issues with multitasking on new iOS" because that isn't it at all. The original issue is that GLBasic is incompatible with multi-tasking capable devices. That is still the case with or without the newly implemented attempt at supporting OS4 multi-tasking. Which don't work anyway, as far as I can tell.

I've reported all this extensively over three threads and many hours of testing, but it's apparently just falling on deaf or unconcerned ears... or I'm just not communicating in a language anyone here understands. Either way, I'm wasting lots of my time, and not getting anywhere but frustrated.

So anyway, y'all will be relieved to hear I'm leaving the forums and this little community alone now. Maybe I'll check back in a few months and see if GLBasic is working yet so I can give my customers an update so their apps don't crash.

Ok. carry on.

doimus

Don't be so negative about it, things will work itself out. They always do in GLB world.

Always keep in mind that GLB is run by one man who, considering how ridiculously low we all pay him, is doing hell of a job.

Hatonastick

And especially considering he has a very busy life beyond GLB.  Honestly I don't know how he does it.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

doimus

When we eliminate the impossible, whatever remains, however improbable, must be the truth.
Therefore... he is Santa Claus.

Kitty Hello

LOL. If I was Santa, I'd go on a diet.
It's not that complicated. Basically, I do stuff quite quickly when it's easy things, and during the night. My wife goes to sleep at 10:30pm and I stay up to 1:00 am in busy times. (Which I hope are over now since the release).

Most stuff goes in really quickly. But when there's something to fix on the precompiler or on devices where you can't debug easily, it can take ages.

ampos

I was just thinking about starting to make a game for iPhone. But if I understand, my app will crash on any multitask iOS, and I will unable to save gamestate... is this true?

Not asking about multitask, It would be fine to exit app as in 3.x. Does it works in iOS 4 as in previous versions?

If not, any ETA on it?
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

mykyl66

#7
As Gernot said in another post he should have that fixed by next week. I think the main issue is Gernot has no access at the moment to a generation 3 ipod or 3ds minimum iphone (iPads are still on ios 3 so dont have fast task switching etc.) so its not that Gernot cant fix it, he just seems to be having difficulty tracking it down through a third party.

The main issue on multitasking machines is it never gets to do the glb on quit section as it crashes at that point. In other words try to close the app or put it into a fast task switching state it will crash out at that point. SO in answer to your query you cannot save on quit by relying on glb on quit or anything like that. For some games you can save progress as the player plays but on others where they might have been playing for an hour or so and get a call there is nothing you can currently do as most folks just hit the home button to get out and answer the call or whatever.

Cheers

Mike R

Kitty Hello

OK, I've uploaded an update now. If it still crashes on multitasking, please send me the console output.

Here's the example that I successfully tested:
Code (glbasic) Select

ALLOWESCAPE FALSE // if you don't do that, "the button" will exit your app right away.

WHILE TRUE
// doing some opengl drawings (that's the code for testing landscape grabsprite)
STARTPOLY -1,0
POLYVECTOR 0,0,0,0,0x0000ff
POLYVECTOR 0,480,0,0,0x00ffff
POLYVECTOR 640,480,0,0,0x00ff00
POLYVECTOR 640,0,0,0,0xff0000
ENDPOLY

DRAWRECT 100,50, 100,50,0xffffff
DRAWRECT 101,51,98,48,0x000000
DRAWLINE 102,50,130,50,0xcc00cc
PRINT "ABC", 101,51

DRAWRECT 300,50, 79,37,0x0000ff

GRABSPRITE 1, 100,50, 77,35
DRAWSPRITE 1, 301,51


STARTPOLY 1, 0
POLYVECTOR 0,0,0,0,0xffffff
POLYVECTOR 0,64,0,64,0xffffff
POLYVECTOR 128,64,128,64,0xffffff
POLYVECTOR 128,0,128,0,0xffffff
ENDPOLY

LOCAL cx%, cy%
GETSCREENSIZE cx%, cy%
PRINT "screen: "+cx+" x "+cy, 0,300

SHOWSCREEN
WEND

// you get this when you get a call or multitasking switches you awa
// DO SAVE HERE. You will not get an GLB_ON_QUIT in iOS4!
// Maybe if you hog too much memory, but I'm uncertain.
SUB GLB_ON_PAUSE:
STDOUT "on pause\n"
ENDSUB

// you get that when you see you game again after the interruption
SUB GLB_ON_RESUME:
STDOUT "on resume\n"
ENDSUB

// That's (I think) only called on iOS3, and maybe on an
// applicationDidReceiveMemoryWarning()
SUB GLB_ON_QUIT:
STDOUT "on quit\n"
ENDSUB


Get the update, 8.085 is the number.

mykyl66

#9
Looks promising running the above code.

The results of swapping between apps and single clicking the home button always pause the app which is good. I have posted the result here from the xcode debug console. Still to test it within our game but looking promising.

edit: Just tested it on one of our current pieces of code and YES it seems to be working fine.

Will post if any issues arise although as I said it seems fine at last.

-applicationDidBecomeActive    -> unpause
backing: 320 x 480
Init GFX
AudioStreamBasicDescription:  2 ch,  44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved
Init Finalized
-applicationWillResignActive   -> pause
on pause
pause loop in showscreen
-applicationDidEnterBackground -> pause
-applicationWillEnterForeground-> do nothing
-applicationDidBecomeActive    -> unpause
on resume
pause ended
-applicationWillResignActive   -> pause
on pause
-applicationDidEnterBackground -> pause
pause loop in showscreen
-applicationWillEnterForeground-> do nothing
-applicationDidBecomeActive    -> unpause
on resume
pause ended
-applicationWillResignActive   -> pause
on pause
pause loop in showscreen
-applicationDidBecomeActive    -> unpause
on resume
pause ended
-applicationWillResignActive   -> pause
on pause
-applicationDidEnterBackground -> pause
pause loop in showscreen
Program received signal:  "SIGKILL".
(gdb)

Cheers

Mike R

jaywat

#10
Whilst it might work for Mike, it does not work for me at all. In fact, GLBasic is actually now in a worse state than ever on my 64bit Windows Vista machine after installing 8.085. If I paste Kitty's exact test code from the post above, the editor actively changes ALL the subs GLB_ON_QUIT, GLB_ON_PAUSE, GLB_ON_RESUME to lower case, and none of them ever fire now.

I originally updated to 8.085 from the editor, but when that caused this failure, I downloaded it fresh and installed on a new drive from scratch, after archiving my old glbasic install. [Edit: mainly, I didn't realise that the sdk on the main download link is still 8.078, so I still had to update internally when I installed it fresh]

Same result either way. So for me, at least, GLBasic is now even more broken, and I can't code the update to our apps at all!

MrTAToad

#11
That is odd - on my Windows 7 x64 directly copying doesn't change the case of the SUB names - cant find anything to cause it (not even the re-formatting options).  I did find one person who had the same trouble when copying text from OpenOffice, and it appears that the web browser was modifying the formatting of characters.  Would be worth test to see, if you type in SUB TEST: if test is converted to lower-case.

ON_QUIT is working
ON_PAUSE is working
ON_RESUME is working

There are several things to note :

  • At the moment, they only work in RELEASE mode
  • On Windows, STDERR/STDOUT only works in console mode.  DEBUG cant be used as the SUB's only work in release mode

So, to test them I put an END in the ON_PAUSE subroutine - so as soon as the program is minimised it ended straight away.
Then I moved the END into ON_RESUME and watched the program end as soon as a window was restored.

Hopefully these ON_RESUME/ON_PAUSE will be working in debug mode later on.

This also works :

Code (glbasic) Select
ALLOWESCAPE FALSE // if you don't do that, "the button" will exit your app right away.
AUTOPAUSE TRUE

GLOBAL quit%

quit%=FALSE
WHILE TRUE
// doing some opengl drawings (that's the code for testing landscape grabsprite)
LOCAL cx%, cy%
GETSCREENSIZE cx%, cy%

IF quit%=TRUE
DRAWRECT 0,0,cx%-1,cy%-1,RGB(255,255,255)
SHOWSCREEN
KEYWAIT
ELSE
STARTPOLY -1,0
POLYVECTOR 0,0,0,0,0x0000ff
POLYVECTOR 0,480,0,0,0x00ffff
POLYVECTOR 640,480,0,0,0x00ff00
POLYVECTOR 640,0,0,0,0xff0000
ENDPOLY

DRAWRECT 100,50, 100,50,0xffffff
DRAWRECT 101,51,98,48,0x000000
DRAWLINE 102,50,130,50,0xcc00cc
PRINT "ABC", 101,51

DRAWRECT 300,50, 79,37,0x0000ff

GRABSPRITE 1, 100,50, 77,35
DRAWSPRITE 1, 301,51


STARTPOLY 1, 0
POLYVECTOR 0,0,0,0,0xffffff
POLYVECTOR 0,64,0,64,0xffffff
POLYVECTOR 128,64,128,64,0xffffff
POLYVECTOR 128,0,128,0,0xffffff
ENDPOLY
ENDIF

PRINT "screen: "+cx+" x "+cy+" "+quit%, 0,300

SHOWSCREEN
WEND

// you get this when you get a call or multitasking switches you awa
// DO SAVE HERE. You will not get an GLB_ON_QUIT in iOS4!
// Maybe if you hog too much memory, but I'm uncertain.
SUB GLB_ON_PAUSE:
quit%=TRUE
ENDSUB

// you get that when you see you game again after the interruption
SUB GLB_ON_RESUME:
quit%=FALSE
ENDSUB

// That's (I think) only called on iOS3, and maybe on an
// applicationDidReceiveMemoryWarning()
SUB GLB_ON_QUIT:
STDOUT "on quit\n"
ENDSUB


Minimise the window and restore it, and you should get a white screen.  Press any key to resume.  The key wait is needed otherwise the program would return back to normal before you can see anything.



jaywat

Quote from: MrTAToad on 2010-Aug-28
That is odd - on my Windows 7 x64 directly copying doesn't change the case of the SUB names - cant find anything to cause it (not even the re-formatting options).  I did find one person who had the same trouble when copying text from OpenOffice, and it appears that the web browser was modifying the formatting of characters.  Would be worth test to see, if you type in SUB TEST: if test is converted to lower-case.

ON_QUIT is working
ON_PAUSE is working
ON_RESUME is working

There are several things to note :

  • At the moment, they only work in RELEASE mode
  • On Windows, STDERR/STDOUT only works in console mode.  DEBUG cant be used as the SUB's only work in release mode

So, to test them I put an END in the ON_PAUSE subroutine - so as soon as the program is minimised it ended straight away.
Then I moved the END into ON_RESUME and watched the program end as soon as a window was restored.

Hopefully these ON_RESUME/ON_PAUSE will be working in debug mode later on.

Doesn't work for me. Even when I type it in (which was the first thing I tried). I'm well aware they only work in release mode and that there's no way to debug them. Not that inability to debug matters when they never fire for me anyway, after the editor magically converts them back to lower case for me.

MrTAToad

Cant think why it would do that - might be worth un-installing and re-installing.

Kitty Hello

if the editor breaks your case, do this:

SUB glb_on_xxx:
1. remove the ":"
SUB glb_on_xxx
2. press enter (the glb_on_xxx must not be blue anymore)
3. uppercase the word (Ctrl+Shift+U)
4. finally add a ":"