GLBasic forum

Main forum => GLBasic - en => Topic started by: MrTAToad on 2009-Jul-20

Title: V7
Post by: MrTAToad on 2009-Jul-20
I see PeekMessage isn't documented...
Title: Re: V7
Post by: 9940 on 2009-Jul-20
MOVEFILE/MOVEDIR are needed  :|

Quote
function copy: a$, b$
copyfile a$, b$
killfile a$
endfunction

Yes, it works.. but if you have a huge file/dir it may take long time    
and may not be enough space
Title: Re: V7
Post by: Moru on 2009-Jul-20
Pressing F1 on this command in the editor: GETLASTERROR$()
doesn't work. It won't go green in the editor either.

There is a link missing on the bottom of the help for GETLASTERROR$():
"See also NETGETLASTERROR$()"

And how do I start macros? Is it possible to pass the active gbas-file?s name and path to the macro?
Title: Re: V7
Post by: Kitty Hello on 2009-Jul-21
ok, fixed the "won't go green" bug.
The manual text for me is:
Code (glbasic) Select

Returns an error code followed by a short text describing the last error.

Following the defiend error codes:

0 success
3 file does not exist
4 wrong argument
5 string is too long
7 not enough memory
8 wrong dimension
9 out of dimesioned range (makes the program end)
20 no more data available

See also NETGETLASTERROR$()

Not for you?
Title: Re: V7
Post by: Moru on 2009-Jul-21
Yes, what I meant is that the "See also"-link isn't a link, usually you can just click the link to get to the command.
Title: Re: V7
Post by: MrTAToad on 2009-Jul-21
What does PlatformInfo$("") return on an iPhone ?
Title: Re: V7
Post by: Kitty Hello on 2009-Jul-21
see manual for platforminfo$() ?

The macros are described in the manual: GLBasic intern/tools. It should be pretty straightforward when you execute the first one, it shows you the environment variables set.
Title: Re: V7
Post by: MrTAToad on 2009-Jul-21
Platforminfo$ has :

"LINUX" = Linux operating system
"WIN32" = Windows Desktop (9x, NT, XP, 2003, ...)
"WINCE" = PocketPC
"GP2X" = GP2X
"MACOSX"= Mac OS X

Unfortunately the iPhone isn't detailed...
Title: Re: V7
Post by: Moru on 2009-Jul-21
Quote from: Kitty Hello on 2009-Jul-21
The macros are described in the manual: GLBasic intern/tools. It should be pretty straightforward when you execute the first one, it shows you the environment variables set.

Yes I read that part but it says nothing about where to put those macro files or where/how to execute them. I have looked all over the tools menu and the buttons but there is nothing about macros?
Title: Re: V7
Post by: Kitty Hello on 2009-Jul-21
Menu: Tools/Macro/Edit?
If it's not there, it's (again) a bug.
Title: Re: V7
Post by: MrTAToad on 2009-Jul-21
Yes, its not there :)
Title: Re: V7
Post by: Schranz0r on 2009-Jul-21
in the german version:

Top Menu:

Werkzeuge/Macros/bearbeiten/

It is not in the Popupmenu!
Title: Re: V7
Post by: Moru on 2009-Jul-22
The GEN... commands don't feel intuitive, would it be better with FREESPRITE AND FREEFILE or something similar?

The description would be something like this:
Generate the next free index for a sprite or a file.

Code (glbasic) Select
GLOBAL ball = FREESPRITE()
LOADSPRITE "ball.png", ball
DRAWSPRITE ball, 50, 50


I have realy been looking forward to this command :-)
Title: Re: V7
Post by: MrTAToad on 2009-Jul-22
The online documentation is a bit clearer with it :)

But yes, GENx does seem a bit of a strange name to give it...
Title: Re: V7
Post by: Moru on 2009-Jul-22
for me NEWSPRITE creates a new sprite, not a handle :-)
Title: Re: V7
Post by: Kitty Hello on 2009-Jul-22
GEN is generate like the OpenGL commands: glGenTexture...
Title: Re: V7
Post by: Hemlos on 2009-Jul-22
I code based on identities indexed sequentially with sprites id's

So


Campfire=Emitter_Create()
EntityPlayerID=1
loadsprite "Player.png",EntityPlayerID

Much easier to remember than a number obviously.
This is what is neccesary for creating an entity infrastructure.
Title: Re: V7
Post by: Moru on 2009-Jul-22
I've been using something like this:

Code (glbasic) Select

ball_id = LoadSprite("ball.png")
DRAWSPRITE ball_id, 50, 50

FUNCTION LoadSprite: File$
    STATIC id%

    INC id, 1
    LOADSPRITE File$, id
    RETURN id
ENDFUNCTION


This new command will make it a lot smoother since sprites and anims share the index number.
Title: Re: V7
Post by: Hemlos on 2009-Jul-23
Quote from: Moru on 2009-Jul-22

This new command will make it a lot smoother since sprites and anims share the index number.

I like it, i will use it with my PS for sure...it works the same exact way...calling an emitter auto indexes the next image for a new emitter...using the loadsprite index, and a name stores the index.

hence, ball=Emitter_CreateSystem("ball.png")

So, using it will compliment the SpriteZ API im working on.

Revamped to work with the IDE naming conventions:

Code (Tested and Working, Auto Index images) Select

FUNCTION LOADIMAGE: File$
    STATIC id%

    INC id, 1
    LOADSPRITE File$, id
    RETURN id
ENDFUNCTION


Edit: Im probably going to alter it to be global, instead of static, in order to pass the identity to the emitter, and visa versa.
Title: Re: V7
Post by: Hatonastick on 2009-Jul-23
Question about v7 and iPhone: Do we need a Mac to compile?
Title: Re: V7
Post by: codegit on 2009-Jul-23
Quote from: Hatonastick on 2009-Jul-23
Question about v7 and iPhone: Do we need a Mac to compile?

I believe that you do have to have a Mac to compile for iPhone.
Title: Re: V7
Post by: Kitty Hello on 2009-Jul-23
Yes, unfortunately. Someone told me it's possible to install OSX on an EEE-PC or an Acer Asprite One, though, which are very cheap.

I think about a software distribution service for iPhone as well, so you don't need one.
Title: Re: V7
Post by: Hatonastick on 2009-Jul-23
That's unfortunate.  A pity Apple wouldn't play ball.  Oh well, have to wait and see what the future holds.

Interesting idea Gernot, my only concern is it could be a lot of added work for you.  Especially if (and I can't see why it wont) the iPhone side of GLB takes off.  I'm continually impressed with the work you do on GLB mate.
Title: Re: V7
Post by: Ian Price on 2009-Jul-23
Silly question, where is the V7 download? Is it the download on the front page? It states "Current version" but does that mean current stable version or bang upto date version?
Title: Re: V7
Post by: Ian Price on 2009-Jul-23
Cheers. I don't bother reading the shoutbox, so I missed it. You'd think something as important as that would hit the NEWS first ;)
Title: Re: V7
Post by: johngood on 2009-Jul-25
Hi,
This code works in 6.248

Dim grid%[24][24]
Local handle%, one%
Local mx, my, x, y




handle=OPENFILE(1,"GLBNew2.bdt",TRUE)
FOR y = 0 TO 21
  FOR x = 0 TO 21
  READBYTE handle,one
     IF CHR$(one) = 6
     mx = x
     my = y
     ENDIF
  NEXT
NEXT

But gives the following Error in 7.057

CALLBYNAME "GLB_ON_QUIT" *** failed ***
Error:
No file

Regards,
johngood.
Title: Re: V7
Post by: Moru on 2009-Jul-25
The error is only a warning and you need to read the help-file about the .app dir that is created when compiling. All datafiles, images, sound and other files you are using in your program needs to move into that directory, then your code should work.
Title: Re: V7
Post by: johngood on 2009-Jul-25
Sorry!  ;/

My understanding was that the .App directory was only for Mac related projects.

Regards,
johngood.
Title: Re: V7
Post by: Hemlos on 2009-Aug-03
Quote from: Kitty Hello on 2009-Jul-22
GEN is generate like the OpenGL commands: glGenTexture...



Ahh i missed that new command set, I will rewrite my api using this GENSPRITE() structure....  :good: