GLBasic forum

Main forum => Announcements => Topic started by: Kitty Hello on 2010-Jun-07

Title: V8 beta
Post by: Kitty Hello on 2010-Jun-07
Hi,

I quickly made a first V8 preview beta (which can compile for iPAD!!!)
http://www.glbasic.com/beta/glbasic_sdk.exe (http://www.glbasic.com/beta/glbasic_sdk.exe)

The manual is not up to date. See http://www.glbasic.com/xmlhelp.php (http://www.glbasic.com/xmlhelp.php) instead.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-07
Now to start testing it mercilessly...
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-07
Some problems :

Title: Re: V8 beta
Post by: Hark0 on 2010-Jun-07
Downloading and testing with my project for iphone.

=D
Title: Re: V8 beta
Post by: fjsantosb on 2010-Jun-07
Wohohoooo

Santas come this year on summer :P.

Thanks for your support Gernot!!

King Regards, fjsantos.
Title: Re: V8 beta
Post by: Scott_AW on 2010-Jun-07
Quote from: Kitty Hello on 2010-Jun-07
Hi,

I quickly made a first V8 preview beta (which can compile for iPAD!!!)
http://www.glbasic.com/beta/glbasic_sdk.exe (http://www.glbasic.com/beta/glbasic_sdk.exe)

The manual is not up to date. See http://www.glbasic.com/xmlhelp.php (http://www.glbasic.com/xmlhelp.php) instead.
Sounds great, I'll have to check this out later.
Title: Re: V8 beta
Post by: Hark0 on 2010-Jun-07
Quote from: Scott_AW on 2010-Jun-07
Quote from: Kitty Hello on 2010-Jun-07
Hi,

I quickly made a first V8 preview beta (which can compile for iPAD!!!)
http://www.glbasic.com/beta/glbasic_sdk.exe (http://www.glbasic.com/beta/glbasic_sdk.exe)

The manual is not up to date. See http://www.glbasic.com/xmlhelp.php (http://www.glbasic.com/xmlhelp.php) instead.
Sounds great, I'll have to check this out later.

myipad...myipad...myipad...myipad...myipad...myipad...myipad...myipad...myipad...myipad...myipad...

Where is iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiit?

It sounds like Gollum's character..  :D
Title: Re: V8 beta
Post by: matchy on 2010-Jun-08
Fantastic. Nice. Beauty. And, as a practical test, I was able to compile my 3D game to the larger resolution.  :booze: Woo hoo ... it's iPad time!!!!
Title: Re: V8 beta
Post by: Ian Price on 2010-Jun-08
What about support fo the new iPhone4? - http://www.engadget.com/2010/06/07/iphone-4-announced/

The screen is doubled now (960x640), as well as some other changes to the hardware  :blink: Where will this all end? Apple updating their stuff every three minutes. Devs don't have a chance to support any version properly before it's outdated. Apple will fragment their own market.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-08
Slight problem with the Linux version : symbol lookup error: /usr/lib/libX11.so.6: undefined symbol: XAllocClassHint.  I do have Ubuntu 10's X11 dev installed...
Title: Re: V8 beta
Post by: Scott_AW on 2010-Jun-08
AT&T might muck things up for Apple, they're eliminating unlimited internet altogether and having two packages, 200mb monthly limit for $15 and 2gb monthly limit for $25.  However, like most phone companies, exceeding these limits leads to additional fees.

Hopefully we might see Apple jump that ship and possibly open doors to other services.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-08
Quote from: Ian Price on 2010-Jun-08
What about support fo the new iPhone4?

I think it's not a problem at all. Just a change in the platform.ini file.

Quote
Devs don't have a chance to support any version properly before it's outdated. Apple will fragment their own market.
Yes. I totally agree that the double resolution is a true pain. WTF? I mean, 320x480 is really enough for an iPhone sized device. Win Mobile usually is 320x240. Was OK, too.
I think I won't support that resolution myself and stick with 320x480 for iPhone.


Title: Re: V8 beta
Post by: Quentin on 2010-Jun-08
any other new features beside IPad support?
I see its still not possible to use the same function name in different types. Will this be changed?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-08
Quoteany other new features beside IPad support?
There is the NOT, ENCRYPT$, DECRYPT$, REPEAT and UNTIL commands.

QuoteI see its still not possible to use the same function name in different types. Will this be changed?
It would be nice.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-08
Has PLATFORMINFO$ been updated so that "" will return iPod/iPhone or iPad ?
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-08
function name is a bug. IPAD is returned correctly. See the xml help online.
Title: Re: V8 beta
Post by: matchy on 2010-Jun-08
Landscape display modes are offset now for iPhone/iPad and not displaying correctly.  :'(
Can someone please confirm and flag as an important bug fix!
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-08
offset by how much? Very strange.
Title: Re: V8 beta
Post by: matchy on 2010-Jun-08
The offset about a third of the screen left and up. As if the width and height haven't been changed when rotated from 320x480 to 480x320 because the side is cut off.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-08
oh. on iPhone? Did you specify the platform options to 480x320 instead of iPad sizes? (Just check to be sure).
Title: Re: V8 beta
Post by: matchy on 2010-Jun-08
It is the same for iPod Touch (480x320) and iPad (1024x768). I think this issue is there for the v7 also with 3D.
Simply put, DRAWRECT 0,0,480,320,RGB(255,0,0);SHOWSCREEN;MOUSEWAIT // is not centered when compiled in landscape 480x320 as iPhone.  :whip:
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-08
Another slight problem is that a type cant be used in another type :

Code (glbasic) Select
TYPE Ta
FUNCTION blah%:
ENDFUNCTION
ENDTYPE

TYPE Tb
  test as Ta

  FUNCTION go%:
     test.blah()
  ENDFUNCTION
ENDTYPE


Generates : warning : note : TYPE  is not declared and error : wrong argument type : TYPE  is not declared
Title: Re: V8 beta
Post by: backslider on 2010-Jun-09
hm... with the resolution of 1024*768 i can see the title bar and i can move the window, too.  :blink:
Or is it only a problem with more than 1 display?
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-09
Quote from: MrTAToad on 2010-Jun-08
Another slight problem is that a type cant be used in another type :

Code (glbasic) Select
TYPE Ta
FUNCTION blah%:
ENDFUNCTION
ENDTYPE

TYPE Tb
  test as Ta

  FUNCTION go%:
     test.blah()
  ENDFUNCTION
ENDTYPE


self.test.blah() works in my version (changed something, might not work in yours. My error was: call to undefined function "test" in that line.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-09
Yes - that works.  Keep forgetting the self command...  ;/
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-10
Yes, its coming along nicely.

I haven't tried the Linux executable with 8.006 yet, but most of the other bugs seem to be fixed with the exception of compiling to iPhone :

Code (glbasic) Select
In file included from /cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_tempg.cpp:2:
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:14: error: extra qualification '__GLBASIC__::Ta::' on member 'blah'
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:43: error: extra qualification '__GLBASIC__::Tb::' on member 'go'
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:75: error: extra qualification '__GLBASIC__::Tc::' on member 'acall'
In file included from /cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp0.cpp:1:
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:14: error: extra qualification '__GLBASIC__::Ta::' on member 'blah'
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:43: error: extra qualification '__GLBASIC__::Tb::' on member 'go'
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:75: error: extra qualification '__GLBASIC__::Tc::' on member 'acall'
In file included from /cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp1.cpp:1:
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:14: error: extra qualification '__GLBASIC__::Ta::' on member 'blah'
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:43: error: extra qualification '__GLBASIC__::Tb::' on member 'go'
/cygdrive/C/Users/Nicholas/AppData/Local/Temp/glbasic/gpc_temp.h:75: error: extra qualification '__GLBASIC__::Tc::' on member 'acall'
*** FATAL ERROR - Please post this output in the forum


Currently, NOT wont invert the sign of a number :

Code (glbasic) Select
DEBUG NOT(-1)+"\n"
DEBUG NOT(1)+"\n"


Both return 0

It would be nice if a TYPE defined in one file could be used in another - at the moment it generates the usual  "warning : note : TYPE Tc is not declared"
Title: Re: V8 beta
Post by: backslider on 2010-Jun-10
It would be nice to have a program parameter like "dockwindow" with parameters like "left, top, right, bottom, center" where you can set the start position of your game window wouldn´t it? :)

@Gernot: Would it be hard to implement this function?

greetz
Title: Re: V8 beta
Post by: dijster on 2010-Jun-10
Thanks for this.
I can't wait to get something running on my iPad
Title: Re: V8 beta
Post by: backslider on 2010-Jun-10
and how do you set the position of your glbasic window after using GetSystemMetrics() ?   :blink:
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-10
Oh yes. The -_-_ replacement in the app name was required, because the iPhone program did not work if it had spaces in the name.

I fixed the other bugs and will do an live-update soon.
Title: Re: V8 beta
Post by: Kuron on 2010-Jun-10
Thank you for the update!
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-11
One slight problem :

This loop is okay :
Code (glbasic) Select
self.row[newSize%].TColumn_Initialise()

However, when you try to add a value to newSize% (an offset, if you will), eg :

Code (glbasic) Select
self.row[newSize%+1].TColumn_Initialise()

The compiler generates an "error : call to undefined function : TColumn" error
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-14
Occasionally I have noticed that the editor cursor isn't displayed after a program exits - you have to select a different window before returning for it to be displayed.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-14
GAH! I've been trying to fix that about a dozent times now. So a stupid error. In Debug mode or release?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-14
Both!
Title: Re: V8 beta
Post by: hardyx on 2010-Jun-18
Quote from: MrTAToad on 2010-Jun-10
Currently, NOT wont invert the sign of a number :

Code (glbasic) Select
DEBUG NOT(-1)+"\n"
DEBUG NOT(1)+"\n"


Both return 0
Operator NOT inverts a boolean expression, not inverts the sign. Any number not zero is evaluated to true and the zero is false. Then, I think your test is ok.

NOT(-1)   -->  NOT(true)  --> false  --> 0
NOT(1)    -->  NOT(true)  --> false  --> 0

Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-18
Yes - I would like NOT to work on both boolean operators and arithmetic ones
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-18
that exists. bNOT().
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-18
Ooh - yes!  Forgot about that...
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-19
One other thing - I have noticed that the editor lists functions in types twice - once with % and once without

[EDIT]
Fixed.

[attachment deleted by admin]
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-22
Dont forget JPEG's :)

NETWEBGET doesn't seem to be working in V8 on a Windows 7 or XP machines - Scramble is just returning an empty scores.ini file, for example.

Could someone else test as its quite possible my router playing around :)
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-23
Also, can you try the NETWEBGET$ instead? It sounds like one of those "try to read before you write" bugs on Windows 7.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-23
Both seem to be a problem - NETWEBGET returns 0, whilst NETWEBGET$ doesn't create the output file.
[edit]fixed.

I'm not sure SHELLCMD works on Linux on Ubuntu 10 - the clipboard routine doesn't seem to work.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-24
When used to print some text, some font sizes dont produce readable characters.  I've included one font as an example.

[attachment deleted by admin]
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-24
the font is square and thus considered as 128 characters. Sorry. A bug in the font creator?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jun-24
Looks like it :)
Title: Re: V8 beta
Post by: Moru on 2010-Jun-24
As a temporary workaround, just make the bitmap slightly higher and it should work :-)
Title: Re: V8 beta
Post by: dijster on 2010-Jun-25
Will future versions feature auto rotation, so the iPad can be help in either horizontal position and the display will correct itself?

I think I read somewhere that a game got rejected because it didn't do this.
Might just have been an arsey tester though
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-25
rotate it yourself. I'll post a code snippet for that.
Title: Re: V8 beta
Post by: dijster on 2010-Jun-25
Cool, thanks for answering.
It's great fun running code on the iPad, thanks again!!!
Title: Re: V8 beta
Post by: gregbug on 2010-Jun-30
HI!

i'm trying to convert my code to v8 beta ...

in this code...
Code (glbasic) Select

TYPE geTimer
FrameRate# = 0 // Frequenza aggiornamento logica del gioco (in millisecondi)
LastTime# = 0 // Ultimo aggiornamento ?
ElapsedMS# = 0 // Milliseconti impiegati per eseguire un loop logico...
NumTicks# = 0 // Numero dei cicli logici...
LastNumTicks# = 0 // Numero dei cicli logici... ciclo precedente...
MilliSecs# = 0 // millisecondi di aggiornamento (frequenza)...
Threshold% = 150

// Inizializza il motore di timing con i valori di default iniziali.
FUNCTION Init: LogicFrameRate% = 200
self.MilliSecs# = 1000/LogicFrameRate%
self.LastTime# = GETTIMERALL()
self.NumTicks# = 0.0
self.Threshold% = LogicFrameRate%
ENDFUNCTION

// Calcola i cicli logici da eseguire
FUNCTION UpdateLogic: GamePhase%
LOCAL NowMS# = GETTIMERALL() // Millisecondi attuali...

self.ElapsedMS# = NowMS# - self.LastTime# // Millisecondi trascorsi dall'ultimo aggiornamento....

IF self.ElapsedMS# > self.Threshold%    // Se è intercorso un tempo maggiore dell'intervallo fisso (pc molto lento)
self.ElapsedMS# = self.Threshold% // allora impostiamo il minimo...
ENDIF

self.NumTicks# = (self.ElapsedMS# / self.MilliSecs#) // Numero dei cicli logici da eseguire...
self.LastTime# = NowMS#

LOCAL cLoops% = 0
WHILE cLoops% < self.NumTicks#
LogicUpdater(GamePhase%)
// *************** //
INC cLoops%, 1
// *************** //
WEND
ENDFUNCTION

// Questa è la funzione che aggiorna la logica del gioco...// da ridefinire ...
CALLBACK FUNCTION LogicUpdater: GamePhase%
// QUESTA FUNZIONE E' DA RIDEFINIRE ALL'INTERNO DEL GIOCO
// E CI SI DEVE INSERIRE TUTTA LA LOGICA DEL GIOCO
// GAME PHASE E' UNA VARIABILE INTERA CHE SERVE PER
// ESEGUIRE UN SELECT DELLA LOGICA DELLA SEZIONE DEL
// GIOCO DA CUI SI RICHIAMA...
ENDFUNCTION

// Impostiamo la velocità (in fotogrammi al secondo) della logica...
FUNCTION SetLogicFrameRate: Logic_Rate%
self.FrameRate = Logic_Rate%
self.MilliSecs = 1000.0/self.FrameRate
ENDFUNCTION
ENDTYPE

GLOBAL Timer AS geTimer
// Inizializza Genesis Engine
FUNCTION ge_InitEngine: LogicHZ% = 200
Timer.Init(LogicHZ%)
ENDFUNCTION

// Dealloca e libera la memoria utilizzata dell'engine
FUNCTION ge_FreeEngine:
ENDFUNCTION


if i compile with "unfolded" function v8 beta compile ok
but if  i "colse" the functions the compiler make this error:
Code (glbasic) Select


_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.6.972 SN:654fb5e3 - 3D, NET
Wordcount:19 commands
compiling:
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp: In member function `DGInt __GLBASIC__::geTimer::LogicUpdater(DGNat)':
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp:66: error: a function-definition is not allowed here before '{' token
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp:58:1: unterminated #ifndef
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp: At global scope:
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp:78: error: expected `}' at end of input
*** FATAL ERROR - Please post this output in the forum
_______________________________________
*** Finished ***
Elapsed: 1.6 sec. Time: 14:50
Build: 0 succeeded.
*** 1 FAILED ***


it's is my fault or a bug?  :blink:

thanks.


ops... and is possible (feature request :)) to add type folding too?
thanks again!

Title: Re: V8 beta
Post by: Slydog on 2010-Jun-30
Or, how about adding a general code folding directive, like Visual Studio:
http://msdn.microsoft.com/en-us/library/9a1ybwek.aspx (http://msdn.microsoft.com/en-us/library/9a1ybwek.aspx)

Like:
Code (glbasic) Select

#region Region Title
... code ...
#endregion


This would be handy for organizing larger projects / files by grouping common routines as one region.
Ha, but then what about nested regions?!
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jun-30
aw, cool.
Title: Re: V8 beta
Post by: aonyn on 2010-Jun-30
Or the ability to add custom keywords and custom folding.
In purebasic, I use ;Segment_SomeDescription and ;EndSegment for folding sections of code.
Very useful, and keeps things looking tidy.

regards,
Dave
Title: Re: V8 beta
Post by: gregbug on 2010-Jun-30
nobody has the same problem with the IDE? (compile error with function folding?)
Title: Re: V8 beta
Post by: Slydog on 2010-Jun-30
I haven't tried it myself.
But, could it be specifically only when you use CALLBACK functions?

The error states:
Code (glbasic) Select
C:\DOCUME~1\GregBUG\IMPOST~1\Temp\glbasic\gpc_tempg.cpp: In member function `DGInt __GLBASIC__::geTimer::LogicUpdater(DGNat)':


And your function definition for LogicUpdater is:
Code (glbasic) Select
CALLBACK FUNCTION LogicUpdater: GamePhase%

[Edit]
Can you even have CALLBACK functions nested in a TYPE?

Quote from: gregbug on 2010-Jun-30
nobody has the same problem with the IDE? (compile error with function folding?)
Title: Re: V8 beta
Post by: gregbug on 2010-Jun-30
a little update...
the compiler only generate errors when "close" one of this function:

   CALLBACK FUNCTION LogicUpdater: GamePhase%
   FUNCTION UpdateLogic: GamePhase%
        FUNCTION ge_InitEngine: LogicHZ% = 200
        FUNCTION ge_FreeEngine:


mmmm. i'm going crazy...  :rant:

Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-01
With callbacks, this works :

Code (glbasic) Select
TYPE TT
CALLBACK FUNCTION moo%:
DEBUG "Yes\n"
ENDFUNCTION
ENDTYPE

LOCAL t AS TT

t.moo()


But not this :

Code (glbasic) Select
TYPE TT
CALLBACK FUNCTION moo%:
DEBUG "Yes\n"
ENDFUNCTION

FUNCTION moo%:
ENDFUNCTION
ENDTYPE

LOCAL t AS TT

t.moo()


I had no problem compiling with folded code -there is an error in the ge_FreeEngine function : ENDFUNCTIONG "No\n".  Fix that to something more valid, and all should be fine :)
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-01
does a callback within a type work? Dude, that's not intended. Use a PROTOTYPE instead. Much cleaner.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-01
I haven't tried a CALLBACK in a TYPE and the proper function outside it yet - will be interesting to see what happens :)
Title: Re: V8 beta
Post by: Hatonastick on 2010-Jul-01
Apple needs to slow down on its product releases otherwise you are never going to be able to go on holiday.  =D
Title: Re: V8 beta
Post by: FutureCow on 2010-Jul-06
I haven't had the chance to download yet, so my appologies if this is already the case. Any chance of distributing the manual as html rather than the chm format?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-06
Gernot did say the total package size would be too big...
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-06
You can view it online, though.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-06
I had hoped my XML system could deal with it, but unfortunately it wasn't (found a bit of a limitation with it :) )

By the way, do you know of any programs to convert bitmaps/pngs etc to just binary data, for the MEM2SPR command ?
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-07
Write one. You can use SPRITE2MEM for that.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-07
Where can I get the latest beta ? The first post points to 8.006 (which I already have)
Title: Re: V8 beta
Post by: matchy on 2010-Jul-08
I'm still running 8.002. Is the internet update on for the beta?
Title: Re: V8 beta
Post by: FutureCow on 2010-Jul-08
I'd prefer to have a download twice the size if it meant I could get the help in html rather than chm format.
And though the internet version of the help pages is the most up to date, I don't like having to be hooked up to the net, so a downloadable html set of help files is definitely my preference.
Once you've downloaded them once, wouldn't the GLBasic update tool allow you to then just update the individual pages that had changed since the last update?
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-08
yes. No idea if there is an update, though ;)
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-08
QuoteI'm still running 8.002. Is the internet update on for the beta?
Unfortunately no.  However, download the file from the first page as that is 8.006
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-08
A simple question (or not)...

Are currently GLB V8 Beta compiling at native screen for iPad?

I have tried a simple test changing res at project settings.... I no see anything on screen, but apps are running (It play music...  :P)

TIA, Hark0
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-09
I think 8.006 can...
Title: Re: V8 beta
Post by: S. P. Gardebiter on 2010-Jul-09
Does NOT work with IF? :x
Also waiting for compressed sound support ;_; (If ever)
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-09
Yes, NOT works with IF

Doubtful with compressed sound support - you might need BASS or FMOD for that.
Title: Re: V8 beta
Post by: S. P. Gardebiter on 2010-Jul-09
Quote from: MrTAToad on 2010-Jul-09Doubtful with compressed sound support - you might need BASS or FMOD for that.

That's what everyone tells me :/
But I won't kill off multiplatform support and accept some troublesome license, while still not beeing able to play any ogg's or streamed compressed sound at all :x
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-09
Quote from: MrTAToad on 2010-Jul-09
I think 8.006 can...

Ok I make another test....

EDIT: I tried other test. My steps:

1- New app with GLB 8.006 beta
2- Project settings set to 1024x768 for iphone.
3- Code with simple "hello world" text print...
4- Project runs perfect on Win32.
5- Compile for iphone.
6- Replace *.pch and modify Bundle field at *.plist
7- SDK Base missing on Xcode modified to iOS 3.2 device release
8- Compiling...
9- Singing...
10- Installed on iPad device...
11- App not work.... d'ont load.... (zoom icons in zoom icons out effect on screen)

What am I doing wrong?
I've missed something?
I have to change something in Xcode?
It has to activate the option "convert IPAD application" in Xcode?


TIA, Hark0
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-09
By the way, with INLINE, I have been using \ for splitting lines.  Unfortunately with the latest update, \ is no longer accepted, and I have to change them to _

In addition, I found that, with a V7.250 project, I can compile the program, but aside from "start debug session" appearing in the output window, the program wont run.

However, I have no problems with V8 project :)
Title: Re: V8 beta
Post by: matchy on 2010-Jul-09
Did a quick test and landscape for iPhone/iPad is now working fine now. :)
I use this to check the correct device compile setting in GLB and XCode.
Code (glbasic) Select
LOCAL width,height;GETSCREENSIZE width,height;PRINT "Platform,Device,Width,Height",0,0;PRINT PLATFORMINFO$("")+","+PLATFORMINFO$("DEVICE")+","+width+","+height,0,10;SHOWSCREEN;MOUSEWAIT

Result (iPad Portrait):
Platform,Device,Width,Height
IPHONE,IPAD,768,1024

:)
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-10
Another slight bugette :

Comments in folded functions produce :

Quote
C:\Users\Nicholas\AppData\Local\Temp\glbasic\gpc_temp0.cpp:41: error: a function-definition is not allowed here before '{' token
C:\Users\Nicholas\AppData\Local\Temp\glbasic\gpc_temp0.cpp:51: error: a function-definition is not allowed here before '{' token
C:\Users\Nicholas\AppData\Local\Temp\glbasic\gpc_temp0.cpp: At global scope:
C:\Users\Nicholas\AppData\Local\Temp\glbasic\gpc_temp0.cpp:64: error: expected `}' at end of input

Title: Re: V8 beta
Post by: gregbug on 2010-Jul-10
sorry but...  :-[
where is possible to download the last beta? (8.036?)  :good:



the link in the first post is the 8.006  :'(

grazie.
thanks.
Gianluca.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-11
It does seem that repeated calls to SPR2MEM causes it to fail for some reason.  I have the problem in my graphic to data conversion program.

The program loads a sprite, gets its size, calls SPR2MEM, writes the data to file, deletes the sprite and then proceeds to the next file.

There is more of a problem in release mode - it happens in release mode, but not so often.

Eeek - its worse than I thought :  Add a DEBUG statement after SPR2MEM and all is fine, but remove it and you get the error after the first use.
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-11
Sorry...

Please can anyone help me to compile IPAD? What steps should I follow?

(For iPhone I have no problems)

TIA
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-11
It should be the same as compiling for the iPhone, but set the resolution 480 x 320 or more...
Title: Re: V8 beta
Post by: WPShadow on 2010-Jul-11
Hi,

I hope my english is good enough to explain the error:

I've got 2 files, the main file and a second one:

MAIN:
Code (glbasic) Select

TYPE gui

FUNCTION test:

ENDFUNCTION

ENDTYPE



GLOBAL g AS gui
GLOBAL h AS husti


WHILE TRUE


g.test()

h.bla = 1
h.blub()


SHOWSCREEN

WEND


NOT MAIN:  =D
Code (glbasic) Select

TYPE husti

bla

FUNCTION blub:

ENDFUNCTION


ENDTYPE


The main file works well, but in the second file I get:

Code (glbasic) Select


_______________________________________
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.6.973 SN:5aa2ccd7 - 3D, NET
"GUI - Test 0.1.gbas"(0) warning : note : TYPE husti is not declared

"GUI - Test 0.1.gbas"(31) error : call to undefined function : husti



It looks like a problem and I don't found any answer for this here!

CU

W.
Title: Re: V8 beta
Post by: gregbug on 2010-Jul-11
with current version extended type defined in one file can't be use in another...
i hope this will be fixed soon!! :)
Title: Re: V8 beta
Post by: WPShadow on 2010-Jul-11
Oh... Ok, good to know... thx  :giveup:
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-11
Yes - its been known since the first beta :)
Title: Re: V8 beta
Post by: WPShadow on 2010-Jul-12
I don't found anything about it... Perhaps I don't searched good enough!    :noggin:

Quote from: MrTAToad on 2010-Jul-11
Yes - its been known since the first beta :)

Not for wpshadow  :giveup:

Sorry for the question!  :whip:
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-12
Quote from: MrTAToad on 2010-Jul-11
The program loads a sprite, gets its size, calls SPR2MEM, writes the data to file, deletes the sprite and then proceeds to the next file.

Add a SLEEP in between. I have the impression that your virus program is blocking files when quickly trying to access them... You had that problem with the GCC/GPC, too.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-12
Hark0: Try to completely remove the XCode directory, then rebuild for iPad.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-12
Quote from: Kitty Hello on 2010-Jul-12
Quote from: MrTAToad on 2010-Jul-11
The program loads a sprite, gets its size, calls SPR2MEM, writes the data to file, deletes the sprite and then proceeds to the next file.

Add a SLEEP in between. I have the impression that your virus program is blocking files when quickly trying to access them... You had that problem with the GCC/GPC, too.
Alas, its not the AV this time as I disabled it...
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-12
OK, Send me some sample code then.

The Type-not-declared problem seems a bigger one. I should have not touched this.
I will have to rewrite a big portion of my source code to deal with all this.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-12
Unfortunately it needs to be done, otherwise extended TYPE use will be limited...  :good:
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-12
Quote from: Kitty Hello on 2010-Jul-12
Hark0: Try to completely remove the XCode directory, then rebuild for iPad.

My steps are correct? I delete Xcode ALLWAYS before compile...

"Simple" sets app to resolution for ipad and go?

And on Xcode I compile for target family ipad... iphone or ipad/iphone?

See my steps at: http://www.glbasic.com/forum/index.php?topic=4604.msg35501#msg35501

O_O


EDIT: Downloading & installing 8.036. Testing for iPad.  :)

EDIT2:

Nothing, it does not work  :rant:  :'(

Call me silly but I'm not able to compile for IPAD. I have no problem on iphone, but IPAD does not work.

I am using the latest SDK from Apple and the latest beta version GLBasic (036).

Someone can get a step by step guide for donkeys?  :blink:

Thanks in advance.
Title: Re: V8 beta
Post by: dijster on 2010-Jul-13
I'm not at my mac at the moment, so I can't tell you exactly what you need to do, but.

In the Xcode project, open up the Targets (in the Groups & Files section)

In the list you get, scroll down and you will see something that says target device (not 100% sure), change this to iPad and you should be good to go.

[attachment deleted by admin]
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Quote from: dijster on 2010-Jul-13
I'm not at my mac at the moment, so I can't tell you exactly what you need to do, but.

In the Xcode project, open up the Targets (in the Groups & Files section)

In the list you get, scroll down and you will see something that says target device (not 100% sure), change this to iPad and you should be good to go.

Changed to ipad, iphone and iphone/ipad too....

Nothing!!!!!!!  :(

Upgrade to ipad ENABLED¿?¿?¿?¿¿?

Testing....

EDIT: Tested and....NO WORK FOR ME!!!  zoom icon in - zoom icon out and app exits

:noggin:
Title: Re: V8 beta
Post by: dijster on 2010-Jul-13
Strange, sounds like your app might be crashing.
Try creating a new GL project and just enter this code
Code (glbasic) Select

SETSCREEN 1024,768,0
WHILE TRUE
DRAWRECT 100,100,824,568,RGB(255,0,0)
SHOWSCREEN
WEND


Compile it for the iPad and it should just show a red rectangle.

If this works, then there may be a problem in your code, if this doesn't, then there may be a problem with xcode.

Hope this helps
Title: Re: V8 beta
Post by: matchy on 2010-Jul-13
 :S
Hark0, as you have mentioned by your post that your code has graphics. Post your code so we can help you! Does my code work? If you can compile for iPhone, then it's virtually the same for iPad. Just make sure you compile at 768x1024 (or 1024x768) by setting it in the Project/Options and not with SETSCREEN.
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Quote from: dijster on 2010-Jul-13
Strange, sounds like your app might be crashing.
Try creating a new GL project and just enter this code
Code (glbasic) Select

SETSCREEN 1024,768,0
WHILE TRUE
DRAWRECT 100,100,824,568,RGB(255,0,0)
SHOWSCREEN
WEND


Compile it for the iPad and it should just show a red rectangle.

If this works, then there may be a problem in your code, if this doesn't, then there may be a problem with xcode.

Hope this helps

Can you tell-me step by step the XCODE procedure?

I have a folder from GLB named Xcode...

HOW At this point I continue... setup xcode, set target, etc... maybe there are my error....

TIA, Hark0
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Quote from: matchy on 2010-Jul-13
:S
Hark0, as you have mentioned by your post that your code has graphics. Post your code so we can help you! Does my code work? If you can compile for iPhone, then it's virtually the same for iPad. Just make sure you compile at 768x1024 (or 1024x768) by setting it in the Project/Options and not with SETSCREEN.

My code occupies 18 DIN A-4 pages...  =D

I tried with this:

Code (glbasic) Select
WHILE TRUE
FOR n=0 TO 768 STEP 5
DRAWLINE 0,0,n,1024,RGB(255,255,255)
DRAWLINE 768,1024,n,0,RGB(255,255,255)
NEXT

SHOWSCREEN
WEND

Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Quote from: dijster on 2010-Jul-13
Strange, sounds like your app might be crashing.
Try creating a new GL project and just enter this code
Code (glbasic) Select

SETSCREEN 1024,768,0
WHILE TRUE
DRAWRECT 100,100,824,568,RGB(255,0,0)
SHOWSCREEN
WEND


Compile it for the iPad and it should just show a red rectangle.

If this works, then there may be a problem in your code, if this doesn't, then there may be a problem with xcode.

Hope this helps

testing setscreen

AND..... NOT WORK!  :'( :'( :'( :'( :'(
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
My procedure:

- Write SRC on GLB 8.036. (simple "hello world test").
- Test and works on win32
- Set Res for iphone at 768x1024 (or 1024x768).
- Compiling multiplatform for iphone.
- Modify Bundle field for sing app.
- Modify *.pch (empty file).

- Set project to RELEASE device.
- Set to 3.2 device.

- Tried for ipad, tried universal....

Nothing!!!!  :blink: :blink: :blink: :blink: :blink:

EDIT: Triing to compile xcode source without GLB... for testing ipad deployment etc etc etc

EDIT2: I created a NEW Xcode project (without GLB) ALL Xcode... simple "utility application" sample with rotated info panel.... compiled and works 100% on ipad.... The problem is on GLB ¿?¿?¿?¿?¿?¿?
Title: Re: V8 beta
Post by: matchy on 2010-Jul-13
Quote from: Hark0 on 2010-Jul-13
My code occupies 18 DIN A-4 pages...  =D

I don't mean your full code, just your test code like "PRINT "HELLO iPad",10,10;SHOWSCREEN;MOUSEWAIT".

Anyhow, this is what I do for iPad only:

0. Plug in and sync the iPad to the Mac.
1. Open the XCode project (that's created by GLB)
2. Select "Release" in the project.
3. From the menu Project/Edit Active Target "appname".
4. Set Base SDK to iPhone 3.2.
5. Set Targeted Device Family]/b] to iPad.
5. Set iPhone OS Deployment Target to iPhone OS 3.2
6. Set the Code Signing Identity (if need be).
7. Hit "Build & Run".
:good:

I just tried that and work fine!!!!

Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Quote from: matchy on 2010-Jul-13

I don't mean your full code, just your test code like "PRINT "HELLO iPad",10,10;SHOWSCREEN;MOUSEWAIT".

Anyhow, this is what I do for iPad only:

0. Plug in and sync the iPad to the Mac.
1. Open the XCode project (that's created by GLB)
2. Select "Release" in the project.
3. From the menu Project/Edit Active Target "appname".
4. Set Base SDK to iPhone 3.2.
5. Set Targeted Device Family]/b] to iPad.
5. Set iPhone OS Deployment Target to iPhone OS 3.2
6. Set the Code Signing Identity (if need be).
7. Hit "Build & Run".
:good:

I just tried that and work fine!!!!

YES!!! YES!!! YES!!! YES!!! Thanks matchy!!!

WORKING PERFECT!!!!!   :good: :good: :good:

(I missing "second" step 5 -Set iPhone OS Deployment Target to iPhone OS 3.2-)  :P

THANKS TO ALL!!!!

Title: Re: V8 beta
Post by: matchy on 2010-Jul-13
Quote from: Hark0 on 2010-Jul-13
YES!!! YES!!! YES!!! YES!!! Thanks matchy!!!
WORKING PERFECT!!!!!   :good: :good: :good:
(I missing "second" step 5 -Set iPhone OS Deployment Target to iPhone OS 3.2-)  :P
THANKS TO ALL!!!!
8)
Oh good! Hope to see some good stuff.

I'm not exactly sure when OS4.0 arrives for iPad but should be soon.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-13
Can someone update the FAQ for "iPhone/iPod" please?
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
My idea are preparing a tutorial for my blog (with snapshots etc)..... If you want I translate and copy these tutorial for this forum.

YES?

NOT?

Please select to continue....

:)
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Quote from: matchy on 2010-Jul-13

Oh good! Hope to see some good stuff.


OF COURSE!
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-13
Quote from: Kitty Hello on 2010-Jul-13
Can someone update the FAQ for "iPhone/iPod" please?
I've added it to the "Compiling for iPhone" section...
Title: Re: V8 beta
Post by: Hark0 on 2010-Jul-13
Thank you all once again.

This forum gets better everyday!
:good:
Title: Re: V8 beta
Post by: Hatonastick on 2010-Jul-15
Should I upgrade to 8 Beta?  Or wait till it uses the updater instead of requiring full downloads every time you've updated it.

Taking into consideration I have a really slow DSL connection thanks to miles of 80 year old copper wiring and an exchange right out of the middle-ages (possibly a slight exaggeration :)).
Title: Re: V8 beta
Post by: Quentin on 2010-Jul-15
I've just learned that its also possible to upgrade the Beta version. Just download and install 8.006 and use the normal upgrade function.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-16
Yes, take V8. the problem is, once V8 is released, you need a new setup to use newer updates then. So watch for when it goes release.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-16
I presume it'll be best uninstall the previous versions before V8 as well ?
Title: Re: V8 beta
Post by: Hatonastick on 2010-Jul-20
What algorithm is ENCRYPT and DECRYPT using?  I'm mostly asking so I don't recreate it in my library (which has the usual standard crypto hashes and stream ciphers). :)

Also, where the heck is the info on the changes to types that everyone except me seems to have?  Might make what I'm doing in my game easier.  Maybe.  I use a lot of types.  =D
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-20
Blowfish, 128 bit
Title: Re: V8 beta
Post by: Hatonastick on 2010-Jul-20
Cool. :)  I'm a bit of a Bruce Schneier fan -- one of my favourite books in my (now drastically reduced due to the Internet and books not remaining current for long) computer book collection is 'Applied Cryptography' (it's out of date, but still an interesting read).  Might want to mention that it's Blowfish in the documentation though.
Title: Re: V8 beta
Post by: fjsantosb on 2010-Jul-21
Hi!

I have tried the lovely v8 beta version and all seems to work wells but NETWEBGET$.

I have discovered on this command when compiling Exodus, that don't seems to work properly on iPhone devices (ios4.0).

If I turn off wifi (not internet connection), it's seems to work well, but if my wifi is turn on, then game hangs on loading screen (on network command).

This is a resume of log:
Exodus[72] has active assertions beyond permitted time:
{(
    <SBProcessAssertion: 0x2c5e00> identifier: Suspending process: Exodus[72] permittedBackgroundDuration: 10.000000 reason: suspend owner pid:26 preventSuspend  preventThrottleDownCPU  preventThrottleDownUI
)}

Thread 0:
0   libSystem.B.dylib                0x3185e68c 0x317d5000 + 562828
1   libSystem.B.dylib                0x317d78a0 0x317d5000 + 10400
2   Exodus                           0x0010223c GFHawkNetwork::WGet(char const*, char const*, unsigned short, char const*, char*, long, int) + 1608
3   Exodus                           0x000fb0fc __GLBASIC__::NETWEBGET_Str(__GLBASIC__::DGStr const&, __GLBASIC__::DGStr const&, int, int, int) + 252


Anyone got same error?

Anyway, v8 is really a great update!

King Regards, fjsantos.
Title: Re: V8 beta
Post by: matchy on 2010-Jul-22
My experience also with v8 NETWEBGET$ on os4 is it does visit the webpage (visit logged) but then freezes.  :'(
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-22
Can you PM me the url / params you exaclty use?
Title: Re: V8 beta
Post by: fjsantosb on 2010-Jul-23
Of course, I have just pm you! ^_^.

@matchy: Same for me, visit is logged and then hang up!

Thanks so much for your continuous support Gernot!

King Regards, fjsantos.
Title: Re: V8 beta
Post by: matchy on 2010-Jul-23
KittyHello, I've PM sent you my web page submit function code!
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-23
WEBGET$ is fixed then?

The final beta is out http://www.glbasic.com/beta/glbasic_sdk.exe (http://www.glbasic.com/beta/glbasic_sdk.exe)
It supports Windows CE devices and the Pandora.
Title: Re: V8 beta
Post by: Hatonastick on 2010-Jul-23
So this is a beta, not the full release?  I mean if I download this and install it, I'm going to have to download and install the full release later?

If so I might wait for the full release then -- not like I can test any of the new devices anyways. :)
Title: Re: V8 beta
Post by: trucidare on 2010-Jul-23
Testing GLBasic in XCode 4.

Here the Results.

[attachment deleted by admin]
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-23
A couple of things :

Title: Re: V8 beta
Post by: Quentin on 2010-Jul-24
it's still not possible to use the same function name in different types :(
Thus it makes no sense to use them imho
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-24
Its a shame, but not a great loss.  I append the type name to the function to get around the problem.
Title: Re: V8 beta
Post by: Quentin on 2010-Jul-24
in my opinion it's a great loss. I won't use them otherwise as it's less work to use "normal" functions then. But as Gernot told us, it will be a great challenge to change this. It's a task for the pre compiler I guess. I hope he will be able to change this in the final version  :booze:
Title: Re: V8 beta
Post by: okee on 2010-Jul-24
Gernot just a small thing, v8 doesn't seem to save changes to the syntax highlighting.
When I change background colour/keyword colour it changes for the file i have opened
but not any other files in my project but then when i restart it's gone back to the original
colours
using v 8.050

Thanks

okee
Title: Re: V8 beta
Post by: Moru on 2010-Jul-24
That's probably the same problem as in v7, close all open files except one, change colors, close GLBasic, open again and it should work. Also make sure you only are running one instance of GLBasic.
Title: Re: V8 beta
Post by: okee on 2010-Jul-24
Yeah, thanks Moru, sorted.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-26
One thing I can noticed is that you cant seem to call an extended type from within an extended type when the two are in seperate files :

File 1 :

Code (glbasic) Select
TYPE B
b
g AS Tg

FUNCTION foo: a%
DEBUG self.g.Tg_moo()
ENDFUNCTION
ENDTYPE


File 2 :

Code (glbasic) Select
TYPE Tg
FUNCTION Tg_moo%:
DEBUG "gg\n"
ENDFUNCTION
ENDTYPE


gives "error : call to undefined function : B__g.Tg_moo"
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-26
Did I really have the impression I could make this work!? Oh my...
I think the best approach is now to leave all that to the GCC and parse the GCC error and point to the GLBasic line where it occurs.
Yes, that's propably the best.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-26
QuoteDid I really have the impression I could make this work!? Oh my...
Of course!  You can get anything to work!
Title: Re: V8 beta
Post by: Quentin on 2010-Jul-26
Gernot, who else, if not you :)
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-27
Just need to get rid of that inaccurate warning message now...

Couple of other things :

Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-28
Hm. Not for me. Can you reproduce that?
Title: Re: V8 beta
Post by: Hatonastick on 2010-Jul-28
Hey Gernot, what does this actually mean?

// Mac/iPhone:
//    NETWEBGET hung for good.

Does that mean it works properly now or that you've removed it?
Title: Re: V8 beta
Post by: matchy on 2010-Jul-28
It's now working on the Mac on the LAN, but still not on the iPod Touch. :(
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-28
Oh noes! What can that be again... I'll have to investigate further. Still locking?
Title: Re: V8 beta
Post by: matchy on 2010-Jul-28
Freezes after web visit on iPhone. Can someone verify?!
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-28
Quote from: Kitty Hello on 2010-Jul-28
Hm. Not for me. Can you reproduce that?
Certainly can!

With the following :

Code (glbasic) Select
FUNCTION T%:
INLINE
int a;

if (a=1)
{
}
ENDINLINE
ENDFUNCTION


Fold the function and then re-display it and you'll get :

Code (glbasic) Select
FUNCTION T%:
INLINE
int a;

IF (a=1)
{
}
ENDINLINE
ENDFUNCTION


I haven't been able to get it to do it with just loading a problem, so it may have been a once-off...
Title: Re: V8 beta
Post by: Schranz0r on 2010-Jul-28
I dont know if this on your ToDo Gernot, or you can't fix this problem...

Code (glbasic) Select
TYPE TTest
a%;b%
FUNCTION init:

ENDFUNCTION
ENDTYPE


TYPE TSubTest
a%;b%
FUNCTION init:

ENDFUNCTION
ENDTYPE



WHILE TRUE




SHOWSCREEN
WEND
END


ERROR:

Code (glbasic) Select
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.7.019 SN:7513feb7 - 3D, NET
"TypeTest.gbas"(20) error : a sub/fkt is defined twice : init


But i think you know that problem :D
Title: Re: V8 beta
Post by: Slydog on 2010-Jul-28
Gernot, I don't know the inner workings of your compile process (or ANY compile process!), but to allow TYPES to use the same function names, like Schranz0r is asking, could you get the compiler to automatically prefix all function names with the type name?

For his example you would rename internally his functions to: TTest_init() and TSubTest_init().
(Like people in the forums suggest you do on your own.)

Of course you would have to determine which actual function to call when you encounter it later on in the source code, by knowing what TYPE it is referring to.
Title: Re: V8 beta
Post by: hardyx on 2010-Jul-28
@Slydog: I think that C++ do the same way, prefixing the functions with the name of the class of struct. This must be the way.

Gernot, this is an interface bug I think: when you select GP2X in the project options is saved as GP2X-Wiz. When you enter again in the options you see this. Works ok with other platforms.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-29
Yes, it's on my TODO. It's a bug. Bad one.
Title: Re: V8 beta
Post by: Schranz0r on 2010-Jul-29
Ah Ok, nice to know  :happy:
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Jul-29
http://www.glbasic.com/xmlhelp.php?lang=en&id=386&action=view (http://www.glbasic.com/xmlhelp.php?lang=en&id=386&action=view)
Trim$ functions, anyone?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-29
Interesting :)

Any chance of having a SPACE$ (or PADSTRING command - create a string of a defined character, x many times) ?  A intergrated decimal to hex (and vice versa).



Title: Re: V8 beta
Post by: MrTAToad on 2010-Jul-30
SPRITE2MEM memory problem seems to be fixed, which is good!
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-04
Compound ?IFDEF statements not only execute the code within the ?IFDEF statement, but also any non-valid ones.

For example, :

Code (glbasic) Select
?IFDEF WIN32
?WARNING "Windows"
?ELSE
?IFDEF OSXUNI
?WARNING "Mac"
?ELSE
?WARNING "Here too!"
?ENDIF
?ENDIF


Displays both Windows and Here too!

Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-06
I notice that if you call a function in an extended type, unless you add self. to it, the compiler generates a

Quotecall to undefined function

error.

However, if you define a standard function (with the same name), the compiler somehow finds the function in the type and calls it (and you dont need to use self to do it).  I presume thats a little buggette :)

And of course, called functions in a type dont turn blue.

This is the code I'm testing it with :

Code (glbasic) Select
TYPE Ta
FUNCTION moo%:
go()
ENDFUNCTION

FUNCTION go%:
DEBUG "Type function\n"
ENDFUNCTION
ENDTYPE

LOCAL a AS Ta

a.moo()
END

FUNCTION go%:
DEBUG "Standard function\n"
ENDFUNCTION


I notice that the  "warning : note : TYPE xxx is not declared" message is still displayed...
Title: Re: V8 beta
Post by: Quentin on 2010-Aug-09
did anyone realize that with version 8.064 is't now possible to use the same function name in different types ?
Yeah!
Title: Re: V8 beta
Post by: Schranz0r on 2010-Aug-09
have do update today :P

WOHOOO ;)
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-10
Its coming along very nicely...
Title: Re: V8 beta
Post by: bigsofty on 2010-Aug-11
Good enough to use on a commercial project yet?

Cheers,


Ian
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-11
Well, IMO better than V7 already.
Title: Re: V8 beta
Post by: bigsofty on 2010-Aug-11
Thanks Gernot, time to update I suppose!


Cheers,


Ian
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-13
There is a slight problem with SELECT and values return from functions in extended type - the only problem is I cant get a small example to do the same :(

For some reason this code :

Code (glbasic) Select
CONSTANT GAMESTATE_ERROR% = -1
CONSTANT GAMESTATE_INITIALISELEVEL% = 1
CONSTANT GAMESTATE_LOADLEVEL% = 2
CONSTANT GAMESTATE_INITIALISEPLAYERS%= 3
CONSTANT GAMESTATE_INITIALISEGAME% = 4
CONSTANT GAMESTATE_MAINLOOP% = 5
CONSTANT GAMESTATE_PAUSELOOP% = 6
CONSTANT GAMESTATE_DOMOVEMENT% = 7


Code (glbasic) Select
SELECT players[currentPlayer%].DisplayPointer(level,mouseBuffer)
CASE STATE_MENUSELECTED% // Selected ingame menu
gameState%=GAMESTATE_PAUSELOOP%
DEBUG "hdhd\n"

CASE STATE_DOMOVE% // Do movement
DEBUG "Do Move\n"
gameState%=GAMESTATE_DOMOVEMENT%

DEFAULT
DEBUG "Error should be : "+players[currentPlayer%].DisplayPointer(level,mouseBuffer)+"\n"
ENDSELECT


Always displays the Error should be message.

The code it calls is :

Code (glbasic) Select
FUNCTION DisplayPointer%:level AS TLevel,mouseBuffer AS TMouseBuffer
LOCAL result%,x%,y%,destX%,destY%
LOCAL windowWidth% = 310
LOCAL windowHeight% = 80
LOCAL moveType$

setup.DrawSpr_Scale(SPRITE_PLAYERSPOINTERS%,self.pointer.imageIndex%,self.pointer.x%,self.pointer.y%,0.0,1.0)
mouseBuffer.mouseProcess(self.pointer.x%,self.pointer.y%,self.pointer.b1%,self.pointer.b2%)
IF self.pointer.b1%
SELECT self.state%
CASE STATE_WAITINGFORPRESS%
// First press
// Now we check to see if we are over one of the players shapes
IF level.isOverPlayerShape(self.playerIndex%,self.pointer.x%,self.pointer.y%, _
self.selectedPos.x%,self.selectedPos.y%)
// Yes, its a valid shape, so we get all valid move positions (if any)
self.selectedPos.spotIndex%=self.findSelectedSpotIndex(self.selectedPos.x%,self.selectedPos.y%)
IF self.selectedPos.spotIndex%>=0
IF level.collectValidPositions(self.selectedPos.x%,self.selectedPos.y%,self.playerIndex%)>0
self.state%=STATE_WAITINGFORSELECTION%
ENDIF
ELSE
ENDIF
ELSE
IF self.isOverStatusArea(self.pointer.x%,self.pointer.y%)
// Yes, active pause window
x%=(self.screenWidth%-windowWidth%)/2
y%=(self.screenHeight%-windowHeight%)/2
DDgui_pushdialog(x%,y%,windowWidth%,windowHeight%)
DDgui_set("","TEXT","Game Paused")
DDgui_widget("w","What do you want to do now ?",windowWidth%)
DDgui_button(BUTTON_SKIPTURN$,BUTTON_SKIPTURN$,0,0)
DDgui_button(BUTTON_ABANDONGAME$,BUTTON_ABANDONGAME$,0,0)
DDgui_button(BUTTON_CLOSEWINDOW$,BUTTON_CLOSEWINDOW$,0,0)
RETURN STATE_MENUSELECTED%
ENDIF
ENDIF

CASE STATE_WAITINGFORSELECTION%
result%=level.isOverValidPosition(self.pointer.x%,self.pointer.y%,self.playerIndex%,moveType$,destX%,destY%)
SELECT result%
CASE SELECT_ORIGINALSHAPE% // Clicked over the original shape, so we reset the selection state
self.state%=STATE_WAITINGFORPRESS%
self.selectedPos.spotIndex%=INVALID%

CASE SELECT_MOVEPOSITION% // Selected a place to move to
DEBUG "Moving : "+moveType$+"\n"
IF moveType$=COPY_MOVE$ OR moveType$=MOVE_MOVE$
self.prepareSpotMove(moveType$,destX%,destY%)
DEBUG "HERE\n"
RETURN STATE_DOMOVE%
DEBUG "HHH\n"
KEYWAIT
ELSE
self.setup.seriousError("Unknown move type : "+moveType$)
ENDIF
ENDSELECT
ENDSELECT
ENDIF

RETURN STATE_NOTHINGPROCESSED%
ENDFUNCTION


As soon as the value is put in a variable, all is okay...

currentplayer is always 0, and the players array is defined.
Title: Re: V8 beta
Post by: Slydog on 2010-Aug-13
QuoteAs soon as the value is put in a variable, all is okay...

By that, are you saying that this works?:

Code (glbasic) Select
LOCAL state%
state% = players[currentPlayer%].DisplayPointer(level,mouseBuffer)

SELECT state%
...
ENDSELECT
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-14
Thats right.    :)

Whats annoying is that a small example doesn't exhibit the same behaviour which must mean a memory/stack error somewhere...   :glare:
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-17
One other thing - you cant use calculations in an extended type array :

Code (glbasic) Select
TYPE TTest
FUNCTION moo%:
RETURN 12
ENDFUNCTION
ENDTYPE

LOCAL test[] AS TTest
DIM test[4]

LOCAL index%

index%=1

DEBUG test[index%-1].moo()


produces : error : call to undefined function : TTest
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-17
oh dear. Try an alias so far.
Title: Re: V8 beta
Post by: Slydog on 2010-Aug-18
The link in the first post is to version 8.050, but the current beta is 8.064.
I understand that you just download the older version, and run an update from GLBasic and it will find and install the lastest beta.
Except, my computer at work might have a firewall setup (or other security) and GLBasic keeps saying I have the latest version.

Is there a manual / alternative way to install the 8.064 update?  Is it available as a file?
Not a problem as I do my programming from home, would just like the new Extended Type features at work in case I need to do a quick edit to see / test something.

And, am I the only one who gets errors clicking any of the links in the 'Web' menu?
It comes up as this (in Firefox):
http://\\www.glbasic.com\main.php/?site=news&lang=en (http://\\www.glbasic.com\main.php/?site=news&lang=en)
The slashes are the wrong ones (plus 2 additional).
No problem, as I know where to go by hand, just wondering.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-18
The links work here okay - what browser are you using ?
Title: Re: V8 beta
Post by: Slydog on 2010-Aug-18
I use Firefox (3.6.3).

I'm in Canada, could it be a regional thing (it shouldn't because URLs are universal).
Or other setting?  (ha, but what?  Security?)

Do your URLs come out as: (slashes backwards, with preceding slashes too, without the 'http://')
\\www.glbasic.com\main.php (http://\\www.glbasic.com\main.php)

That may explain my update problem too perhaps, as maybe the update URL is causing a problem.

But I also use Firefox on both my home computers and update works fine.
But, I can't remember checking the 'Web' menu's other links, I'll try tonight when I get home.  (I'm 6 hours behind Germany!)

[Edit]
In case it matters, I use XP at work, and Windows 7 at home.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-19
Mine come out as :

Quotehttp://www.glbasic.com/main.php?site=games&lang=en
http://www.glbasic.com/forum/index.php
http://www.glbasic.com/main.php?site=news&lang=en

http://www.glbasic.com/main.php?lang=en&site=order
http://www.glbasic.com/main.php?lang=en&site=games

With the latest beta...  I'm using Chrome
Title: Re: V8 beta
Post by: Slydog on 2010-Aug-19
Yep, the links work fine from home, but I'm using 8.064 (and 8.050 at work because I can't upgrade).
Title: Re: V8 beta
Post by: Hatonastick on 2010-Aug-24
So does this mean v8 is out of beta now?  Just saw this at the top of the forum: *NEW* Current Version:  8.078 release (get setup).

Where do we get it from?  I realise I might be a bit early in asking this as from the looks of it Kitty hasn't had time to update the official website download yet. :)

If it's not out of beta, I'm guessing I just go to the usual beta download link.
Title: Re: V8 beta
Post by: Quentin on 2010-Aug-24
did you already try the normal update function within the editor? This worked for the last beta updates.
Title: Re: V8 beta
Post by: Ian Price on 2010-Aug-24
You can't update from v7.XXX to the new v8.XXX via the usual "INTERNET UPDATE" method - GLBasic produces an error message and bugs out (on Windows 7 anyway). Looking at the site's log file, versi 8.050 was non-beta and it's been updated a couple of times since. The new download is available here - http://www.glbasic.com/main.php?lang=en&site=download It states that it's v7, but it is actually v8.
Title: Re: V8 beta
Post by: Quentin on 2010-Aug-24
right, I took it that some version of 8.0xx Beta was already installed :)
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-24
Yes, but not for the latest version (assuming the version number is correct :) )
Title: Re: V8 beta
Post by: jaywat on 2010-Aug-24
Editing my post about 6th or 7th time...

Kitty, I've been testing GLB_ON_PAUSE and GLB_ON_RESUME which you implemented per my bug report here (http://www.glbasic.com/forum/index.php?topic=4863.0).

First: unlike GLB_ON_QUIT, typing the sub name in lowercase isn't automatically being converted to upper case and recognised, but assuming you put them in upper case, they're being recognised.

Also, these subs don't get called when in debug mode. Is that by design for some reason?

Now, my main issue is, what am I supposed to PUT in GLB_ON_PAUSE?

Here's why I'm asking: With my test code on windows, I successfully put it into pause, but then the app would absolutely not come out of pause. So much so, that using task manager to shut it wouldn't. I managed to shut GLBasic Editor, but the app was still open! No amount of convincing task manager would close it, all it did was bring the app window back up, albeit the title still said <paused>. Worse still, it limited my mouse movement to some little corner of the screen. In the end, I had to reboot my pc!

Now, I *think* I may know why...

in my GLB_ON_PAUSE, after writing a timestamp to a log file, I did:

WHILE TRUE

HIBERNATE

WEND

Because I figured I had to *do* something while paused... but as we know, using SHOWSCREEN while the app is a background task on iPhone kills the app stone dead. But I forgot that if you write a while loop with no showscreen, it tends to kill the app (didn't know if you knew that? always happens to me). And that's why I think my app killed itself so badly - it was paused, but crashed, and could neither continue execution nor be made to exit. Mind you, it'd really help if it could be made that if I screw up the code that badly it didnt require a reboot to continue!

I'm about to try it without a while loop at all. I'll update here in a few minutes or longer if I have to reboot again! :p

EDIT 4: Ok. If you put a while loop in GLB_ON_RESUME *with* showscreen, the app hangs before it ever starts (I wanted to print 'press a key to continue...' or whatever)

So, my test code atm, JUST writing a log file with a time stamp when I pause, when I resume and when I quit is working fine, but it hangs quite nastily if GLB_ON_PAUSE or GLB_ON_RESUME has any kind of loop.


[EDIT 5: Ok, the mouse problem reoccurred when I tried to circumnavigate the problem with using a while loop in GLB_ON_RESUME by using a PRINT, SHOWSCREEN then MOUSEWAIT instead. It seems to create problems. The mouse cursor gets locked to a part of the screen, and at the same time, it exhibits the same crash problem. Basically, SHOWSCREEN in GLB_ON_RESUME is a definite no-no - it causes the app to crash before it even executes the first time, and apparently so is MOUSEWAIT.  Also, GLB_ON_RESUME is being called the instant the app starts (and failing if I have a loop in there).]

I think I can work round that by setting flags and testing the code elsewhere, but (a) some clarification on what you can and cant do with GLB_ON_RESUME and GLB_ON_PAUSE would be nice, and (b) if you can, prevent nasty hang protection if I do something I shouldn't in code!

Does GLB_ON_PAUSE only fire once and halt at the end of code execution within it? therefore I don't need any kind of loop? And after GLB_ON_RESUME, the app would continue from where it left off? If so, in practice, I don't need ANY code, if I just want to pause and resume from where I was? Right?

If that's not how they work, please explain! Thanks.

Even if that is how they work, I think there's a few problems with them atm.

[EDIT... whatever... I've lost count... :

Oh hang on... because of how it's explained in the user manual, I assumed that GLB_ON_RESUME and GLB_ON_PAUSE were only called *IF* AUTOPAUSE TRUE was set... but that's not the case. They're being called ANYWAY. So it may be the combination of AUTOPAUSE and having SHOWSCREEN/MOUSEWAIT that's screwing things up. But I digress... I'll await some responses from Kitty!]

-----

Here's some lame but useful test code, especially since you cannot debug these new SUBs. It includes 3 commented out ways to kill your app (and possibly your pc...), and also conclusively proves that GLB_ON_RESUME is being called BEFORE the app starts the first time through. Do feel free to try with and without AUTOPAUSE TRUE set, too!

Code (glbasic) Select

AUTOPAUSE TRUE
GLOBAL logfile$
GLOBAL pause$
GLOBAL resume$
GLOBAL quit$
GLOBAL time$
GLOBAL hasResumed


logfile$ = PLATFORMINFO$("DOCUMENTS") + "/logfile.dat"

start:

getDetails()

hasResumed = FALSE // if you remove this, you'll see that hasResumed, which is only set TRUE in GLB_ON_RESUME, is true when the app is first executed.
WHILE TRUE
IF hasResumed = TRUE
PRINT "Successfully resumed!",0,0
ENDIF
showDetails()
SHOWSCREEN
WEND


FUNCTION getDetails:

INIOPEN logfile$
pause$ = "PAUSE LOG: " + INIGET$("PAUSE","PAUSE")
resume$ = "RESUME LOG: " + INIGET$("RESUME","RESUME")
quit$ = "QUIT LOG: " + INIGET$("QUIT","QUIT")
INIOPEN ""

ENDFUNCTION


FUNCTION showDetails:

LOCAL logExist

logExist = DOESFILEEXIST(logfile$)

IF logExist = FALSE
PRINT "NO LOG FILE!",0,20
ELSEIF logExist = TRUE
PRINT "LOG FILE FOUND...",0,20
PRINT "Results of last test...",0,40
PRINT pause$,0,70
PRINT resume$,0,100
PRINT quit$,0,130
ENDIF

ENDFUNCTION


SUB GLB_ON_RESUME:

time$ = MID$(PLATFORMINFO$("TIME"),11,-1)
INIOPEN logfile$
INIPUT "RESUME","RESUME","GLB_ON_RESUME @ " + time$
INIOPEN ""

hasResumed = TRUE


// NEVER, EVER DO THIS!!!!
// PRINT "I have successfully resumed from pause!",0,0
// PRINT "Touch to resume...",0,20
// SHOWSCREEN
// MOUSEWAIT



// AND NEVER, EVER DO THIS!!!

//WHILE TRUE
// PRINT "I have successfully resumed from pause!",0,0
// PRINT "Touch to resume...",0,20
// SHOWSCREEN // testing showscreen called WITHIN resume.... nope, that doesnt work!
//WEND

getDetails()

ENDSUB

SUB GLB_ON_PAUSE:

hasResumed = FALSE
time$ = MID$(PLATFORMINFO$("TIME"),11,-1)
INIOPEN logfile$
INIPUT "PAUSE","PAUSE","GLB_ON_PAUSE @ " + time$
INIOPEN ""


// WATCH, WHILE I KILL YOUR APP DEAD...

// WHILE TRUE
// HIBERNATE
// WEND

ENDSUB

SUB GLB_ON_QUIT:

time$ = MID$(PLATFORMINFO$("TIME"),11,-1)
INIOPEN logfile$
INIPUT "QUIT","QUIT","GLB_ON_QUIT @ " + time$
INIOPEN ""

ENDSUB
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-24
By the looks of it, PAUSE is called once when the window loses focus (and not just minimised) whilst RESUME is called twice when the window has focus again.  No idea why its twice  :blink:

Would be nice if those two subroutines were available in debug mode.

As far as I can tell, it looks like the program will stay in a suspension loop once the pause routine has finished.  It might be best to treat these like ON_QUIT and not do any graphics or such like once called.

Here's a little test program for you :

Code (glbasic) Select
GLOBAL a%,b%,c%

AUTOPAUSE TRUE

a%=0
b%=0
c%=0

WHILE TRUE
PRINT "MAIN LOOP:"+a%+" ON_PAUSE:"+b%+" ON_RESUME:"+c%,0,0
SHOWSCREEN
HIBERNATE
INC a%
WEND

SUB GLB_ON_PAUSE:
INC b%
ENDSUB

SUB GLB_ON_RESUME:
INC c%
ENDSUB


You will notice that the ON_RESUME variable increases twice after a window has been restored.  However, if you compile for full screen then the ON_RESUME variable only increases once.

Title: Re: V8 beta
Post by: jaywat on 2010-Aug-24
Quote from: MrTAToad on 2010-Aug-24
As far as I can tell, it looks like the program will stay in a suspension loop once the pause routine has finished.  It might be best to treat these like ON_QUIT and not do any graphics or such like once called.

I would agree this makes sense for GLB_ON_PAUSE, but I would have thought the point of GLB_ON_RESUME was that the program has resumed execution now, and therefore it would be entirely reasonable to display a 'click to resume' screen or something. I mean, ok, I can set a 'hasResumed' flag in GLB_ON_RESUME and jump to a pause screen from elsewhere in the code, but still, it seems that really, GLB_ON_RESUME actually HASNT resumed when it fires, or surely a SHOWSCREEN wouldnt have such dire consequences for your app?

The reason for doing the code example I did is because it's most close to what I actually want to do. That is: on an iPhone, I want to support PAUSE and RESUME from multi-tasking. Which, by the looks of it, for a straight PAUSE/RESUME, I literally wouldn't need to execute any code, other than save the game state.

Why even do that? Well, what if they put it into pause (ie, multi-tasking bar) and then never resume the app, but kill it instead? I can't save if they never resume. So I want to save on pause, and IF there's a savestate file, reload ONLY when the app is restarted afresh, NOT on RESUME. Although since GLB_ON_RESUME is called when the app is started fresh, I explicitly have to code round that.

That's not to mention that iPhone seems to treat ANY exit as a pause, rather than a quit, if the device is multi-tasking capable.

I think I still *could* do right now, assuming it works on iPhone. Just got to be extremely careful about how I code it to not do any of the things that will crash the app!
Title: Re: V8 beta
Post by: Hatonastick on 2010-Aug-24
Quote from: Quentin on 2010-Aug-24
right, I took it that some version of 8.0xx Beta was already installed :)
Yup which it is.  However running the updater on mine (currently version 8.064) it says it's up-to-date.  What Ian has posted was the information I was after ie. that even though the download webpage says 7 it is in fact 8.  Download limits + slow broadband speed = I like to make sure before I grab 130Mb or so. :)

PS Congratulations Gernot on such an awesome amount of work you've done on the upgrade from version 7 to 8.  :good: :booze:
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-24
QuoteI mean, ok, I can set a 'hasResumed' flag in GLB_ON_RESUME and jump to a pause screen from elsewhere in the code, but still, it seems that really, GLB_ON_RESUME actually HASNT resumed when it fires, or surely a SHOWSCREEN wouldnt have such dire consequences for your app?
Quite a few operating systems like to cause trouble when a windows focus is lost (DirectX being one of them).  For Apple machines, like ON_QUIT, you've probably only got a few microseconds to do anything before your program is forced to be minimised.

Setting a flag for the main program to deal with is probably the best way of maintaining compatibility (and ease) across all platforms.

Would be good to get it up and running for Mac and Linux too!
Title: Re: V8 beta
Post by: Kyo on 2010-Aug-24
Hi,
I download the version 7.341, how to compile for iPAD ?????

In version 7.341 the Polyvector don't show, in old version work fine ...
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-24
Download the new SDK. It's V8. There's an forum thread about iPad - just search.

The GLB_ON_PAUSE is just a "trigger" function to tell you that it's going to pause now. DO NOT LOOP HERE!

You can reset a time here, or put a global gPaused% flag.
The GLB_ON_RESUME tells you that the app is about to restart. Both command happen within a SHOWSCREEN if that matters. They can be called twice, yes. Just set global flags and maybe allocat
Title: Re: V8 beta
Post by: Slydog on 2010-Aug-24
Does that mean your normal code keeps running after a GLB_ON_PAUSE is triggered?
(and therefore need to implement GameState logic, like GS_RUNNING = 1, GS_PAUSED = 2, etc to be called in your main loop)
Or does all your code stop until a GLB_ON_RESUME is encountered?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-24
The main code carries on execution
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-25
Yes. Otherwise I had no idea about when it's resuming and stuff. Windows programs always run, they just idle sometimes.
Title: Re: V8 beta
Post by: jaywat on 2010-Aug-25
Ok. I'm a bit confused. So GLB_ON_PAUSE executes its code, then returns to your main code? But, certainly to be consistent cross platform, you should definitely not do a SHOWSCREEN anywhere (an iPhone app is killed off if it attempts to draw to screen when it doesnt have focus) ... so I'll have to implement a completely seperate 'lostfocus' routine in addition to my 'normal' pause routine, because that of course shows the 'paused-click to continue' type stuff and SHOWSCREENs.

But the thing is, in my experience, if you have ANY kind of loop WITHOUT a showscreen, that can kill your app too.... so my original question remains... what do I *do* while paused, even if I'm going to do it outside those subs, even if I want to do nothing but wait for the app to resume so I can display stuff again?

For example. Here's some really simple test code as a basic framework to include losing and regaining focus... except it crashes (app becomes non-responsive under Windows)... it never resumes from pause (and of course I can't step through it to debug!). So what should I be doing instead?

Just to clarify my point about a loop crashing if no showscreen... IF you add SHOWSCREEN to the lostFocusLoop in this code, it no longer crashes under Windows... except that's no good to me at all on an iPhone, because that WILL crash it!

Code (glbasic) Select


GLOBAL a%
GLOBAL b%
GLOBAL hasLostFocus%

mainLoop:

WHILE TRUE
IF hasLostFocus = FALSE
INC a%
PRINT a%,0,0
PRINT b%,0,20
SHOWSCREEN
ELSEIF hasLostFocus = TRUE
GOTO lostFocusLoop
ENDIF
WEND

lostFocusLoop:

WHILE hasLostFocus = TRUE
INC b%
WEND

GOTO mainLoop

SUB GLB_ON_RESUME:
hasLostFocus% = FALSE
ENDSUB

SUB GLB_ON_PAUSE:
hasLostFocus% = TRUE
ENDSUB
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-25
Ok, here's the background:

Windows programs work like:
Code (glbasic) Select

while true
    GetMessage()
    HandleMessage()
wend


Now, that does not fit into the procedural approach GLBasic has. So for your convenience I do:
Code (glbasic) Select

while true
  run, run, run
  showscreen
wend


where "showscreen" internally does:
Code (glbasic) Select

flip_backbuffer()
while(PeekMessage) {GetMessage(); HandleMessage()}


The "HandleMessage", however is where the "lost focus" hapens. There I kick-call the GLB_ON_PAUSE SUB to notify you. The game will not return from the showscreen command until it's unpaused again. (assuming AUTOPAUSE TRUE).

Did that clear things?


Title: Re: V8 beta
Post by: jaywat on 2010-Aug-25
Quote from: Kitty Hello on 2010-Aug-25
Did that clear things?

Not really, to be honest. I may just be being thick.

Given the example I posted above, how can I make a version of that basic framework that will work on my windows machine for development that will also work on an iphone? Ie, if I'm paused, 'do nothing', when I'm resumed... resume.

Or are you saying that for the purpose of development, I now need to have evaluations and code based on platform, then strip all the windows specific stuff out for final iphone deployment?

I guess all I'm really asking for is a working cross platform example of how to use these subs. Because everything I've tried so far just crashes.
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-25
Like this?
Code (glbasic) Select

GLOBAL gPause=FALSE

game:
if gPause
   DisplayPauseMessage();
   showscreen
   keywait
else
   UpdateGame()
   DrawGame()
   showscreen
endif
GOTO game

SUB GLB_ON_PAUSE:
gPause=TRUE
MUSICVOLUME 0
ENDSUB

SUB GLB_ON_RESUME:
MUSICVOLUME 1
ENDSUB


Title: Re: V8 beta
Post by: jaywat on 2010-Aug-25
Well, yes, except that doesnt work on a multi-tasking iPhone. Just tried it. It doesn't display the contents of my DisplayPauseMessage(), or wait for the keywait/mousewait, and the program executes from the beginning again (I just increment a variable and printed it, so it's pretty obvious to see if it continues from where it left off on resume or whether it restarts the whole app).

Which is pretty much what the symptoms were before GLB_ON_RESUME and GLB_ON_PAUSE were implemented.

Oh, and still gives the same 'Background GPU access not permitted' error if connected to xcode debugger.

EDIT: oh wait. that's because on the iPhone you HAVE to have AUTOPAUSE TRUE set for it to work, whereas on the PC, it works exactly the same without AUTOPAUSE set as it does with

EDIT2: Oh. No, still doesn't work. I'm not even going to try and describe the symptoms because it's different every time I run it. But most of the time, the app still crashes out completely per my original bug report
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-25
Do you have an 3GS or iPhone4? The others don't support multitasking.
Title: Re: V8 beta
Post by: jaywat on 2010-Aug-25
We're testing on a 3rd gen iPod Touch 32gb but also have access to an iPhone 3GS. If it didn't support multi-tasking, we couldnt be testing putting apps to the multi-task bar and resuming them!
Title: Re: V8 beta
Post by: namco on 2010-Aug-25
Quote
You can't update from v7.XXX to the new v8.XXX via the usual "INTERNET UPDATE" method - GLBasic produces an error message and bugs out (on Windows 7 anyway). Looking at the site's log file, versi 8.050 was non-beta and it's been updated a couple of times since. The new download is available here - http://www.glbasic.com/main.php?lang=en&site=download It states that it's v7, but it is actually v8.

Yeah I get the same problem in XP. It says something about the updater program terminating in an unusual way and seems to be tied to the mscrvt8.dll (I think).

I'm just going to back up the glbasic game source files, uninstall the old ver and install v8
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-25
That's the way to go. You can't live-update Version X to version Y. There's new compilers and stuff included.
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-25
Dont forget to update the text on http://www.glbasic.com/main.php?lang=en&site=download - it still mentions V7 :)
Title: Re: V8 beta
Post by: Kitty Hello on 2010-Aug-25
um? Update your cache?
Title: Re: V8 beta
Post by: MrTAToad on 2010-Aug-25
Yes, its correct now :)
Title: Re: V8 beta
Post by: Ozden79 on 2010-Aug-28
Ermm, can somebody, who tested, clearly state that whether iOS4 multitasking is working in V8 with AUTOPAUSE feature? My IPod Touch is 1st gen and IPad doesn't have iOS4 yet so can't test it myself.

Depending on it I want to upgrade my games to support this feature!

Thanks...