GLBasic forum

Main forum => GLBasic - en => Topic started by: Apidya on 2010-Jan-04

Title: a Simple Iphone App Code?
Post by: Apidya on 2010-Jan-04
hiya there,

I am new to the forum. I would like to see a simple iphone app code to know what look like and how easy it is to code...

If I get the GL Basic then add on would be Iphone SDK or should I get the GLBasic SDK premium ?
What so good about the GLBasic 3D addon?

I am sure the  GLBasic SDK auf CD is important in case if my hard drive bugged up (touch woods that it doesnt happen :) )

Title: Re: a Simple Iphone App Code?
Post by: Kitty Hello on 2010-Jan-05
The CD is not really required. You can download the setup again w/o troubles.
The 3D addon is required for INLINE stuff (you need premium for that) and 3D objects. On the iPhone, usually 2D and NET_addon suffice.
Title: Re: a Simple Iphone App Code?
Post by: Apidya on 2010-Jan-05
can you show me  Simple GL Basic of Iphone App code pls before I make my mind up of buying it?
please.

cheers
Title: Re: a Simple Iphone App Code?
Post by: Moru on 2010-Jan-05
There is no real difference in iPhone app code... just about anything written for the PC you just compile for the iPhone and transfer to your mac-computer and compile for the iPhone (You do have a mac, right? :-)
Title: Re: a Simple Iphone App Code?
Post by: Apidya on 2010-Jan-05
Quote
You do have a mac, right? :-)

no I dont have mac :(  but it is important to have mac? if yes then which mac computer should i get?
Title: Re: a Simple Iphone App Code?
Post by: erico on 2010-Jan-05
this is only my opinion not advice since macs are expensive and I personally don't like them much....
...you could go for a mini-mac, but check what the people on the forum has to say, specially those that are already producing for the i-phone.

cheers
Title: Re: a Simple Iphone App Code?
Post by: Kitty Hello on 2010-Jan-05
yes. Just get the cheapest x86 Mac you can get.
Title: Re: a Simple Iphone App Code?
Post by: MrTAToad on 2010-Jan-05
The Mac mini would be fine - although if you dont have a monitor, that would have to be brought separately.

My sprite testing code for the iPhone looks like :

Code (glbasic) Select
// --------------------------------- //
// Project: TestSpriteSpeed
// Start: Sunday, August 16, 2009
// IDE Version: 7.082

TYPE tSprite
x
y
dirX
dirY
scale
scaleDir
angle
image%
ENDTYPE

LOCAL sprites[] AS tSprite
LOCAL spr AS tSprite
LOCAL loop%
LOCAL currentTimer
LOCAL nextTimer
LOCAL speed

SETSCREEN 640,480,0
SEEDRND GETTIMERALL()
LIMITFPS -1
SETTRANSPARENCY 0
LOADFONT "smalfont.png",0
SETFONT 0

SETTRANSPARENCY RGB(255,0,255)
LOADSPRITE "Media/plasma.bmp",1
LOADSPRITE "Media/plasma2.bmp",2
LOADSPRITE "Media/plasma3.bmp",3
SEEDRND GETTIMERALL()

FOR loop%=1 TO 1000
spr.image%=RND(2)+1
spr.x=RND(640)
spr.y=RND(480)
spr.dirX=RND(6.0)-3.0
spr.dirY=RND(6.0)-3.0
spr.scale=RND(3)-1.5
spr.scaleDir=RND(2)-1.0
spr.angle=RND(359.0)

DIMPUSH sprites[],spr
NEXT

initAppTime()
speed=updateAppTime()
WHILE TRUE
FOREACH spr IN sprites[]
ROTOZOOMSPRITE spr.image%,spr.x,spr.y,spr.angle,spr.scale
INC spr.x,spr.dirX*speed*0.25
IF spr.x<=0.0
spr.x=0.0
spr.dirX=0.0-spr.dirX
ELSE
IF spr.x>=640.0
spr.x=640.0
spr.dirX=0.0-spr.dirX
ENDIF
ENDIF

INC spr.y,spr.dirY*speed*0.25
IF spr.y<=0.0
spr.y=0.0
spr.dirY=0.0-spr.dirY
ELSE
IF spr.y>=480.0
spr.y=480.0
spr.dirY=0.0-spr.dirY
ENDIF
ENDIF

INC spr.angle,0.08*speed
IF spr.angle>=360.0
DEC spr.angle,360.0
ENDIF

INC spr.scale,spr.scaleDir*0.075*speed
IF spr.scale>=4.0
spr.scale=4.0
spr.scaleDir=0.0-spr.scaleDir
ELSE
IF spr.scale<=0.25
spr.scale=0.25
spr.scaleDir=0.0-spr.scaleDir
ENDIF
ENDIF

NEXT

PRINT AppTime_UPS,0,0
SHOWSCREEN
speed=updateAppTime()
WEND


and doesn't really require any modification for Windows, Linux, Mac etc.
Title: Re: a Simple Iphone App Code?
Post by: codegit on 2010-Jan-06
If you have the budget, then a MacBook is cool as well. As stated before make sure its an "intel/x86" mac. You will also have to become an Apple iphone developer and this will cost you $99.00.
Title: Re: a Simple Iphone App Code?
Post by: Apidya on 2010-Jan-06
thank you for all the reply.

How much is the mac computer?

Is Apple Imac Combi Computer worth getting?
Title: Re: a Simple Iphone App Code?
Post by: Apidya on 2010-Jan-06
?   :)
Title: Re: a Simple Iphone App Code?
Post by: MikeHart on 2010-Jan-06
Look at http://www.apple.com for the prices. OR for used ones on EBay or other places.

If the IMac is worth it? It depends on what you want to use it for. I love mine and it is my work machine but if you are mainly a windows user and just want to compile IPhone apps, then get a small MiniMac .
Title: Re: a Simple Iphone App Code?
Post by: kamakazieturtle on 2010-Jan-08
Just out of curiosity, is it required to have a mac to compile for the iphone? Or do you just need one for testing?
Title: Re: a Simple Iphone App Code?
Post by: codegit on 2010-Jan-08
Quote from: kamakazieturtle on 2010-Jan-08
Just out of curiosity, is it required to have a mac to compile for the iphone? Or do you just need one for testing?

You will need a MAC to compile for iPhone.  :good:
Title: Re: a Simple Iphone App Code?
Post by: Hatonastick on 2010-Jan-08
Hmm does the license for the SDK state that you need Apple hardware, or just the software (OS)?  I might see if I can dig up Gernots post with the quote from the iPod SDK license.

If the license just requires the OS, has anyone got details on what to buy (hardware, software) to get it all running for development purposes?

Edit: Never mind.  According to the post by Gernot the license says something like: "You agree not to install parts of the SDK on non Apple branded hardware".  That rules me out...
Title: Re: a Simple Iphone App Code?
Post by: codegit on 2010-Jan-09
I am aware that you can use a netbook with OSX. I thought it was illegal. I'm just trying to give the correct information.  :)
Title: Re: a Simple Iphone App Code?
Post by: Hatonastick on 2010-Jan-09
Heh, I never noticed the 'parts' bit before.  If that's in their actual license, then that's daft.  I just quoted what Gernot posted, I don't know if it's a direct quote from the original license, or just what he interpreted the license to say.

If it is 'parts', then what parts are they talking about?  And if it does say 'parts', installing the entire SDK on non-Apple hardware would be against the agreement.  I'd go searching for the actual license, but I couldn't be bothered.  =D
Title: Re: a Simple Iphone App Code?
Post by: doimus on 2010-Jan-09
It says "parts" just to prohibit you to use ANYTHING from the SDK on non-apple software.

After all, ALL is just the sum of PARTS.

This way, you violate the agreement if you copy a single byte from the SDK.  You would have a hard time in court explaining why one byte isn't PART of the SDK. :rtfm:

Title: Re: a Simple Iphone App Code?
Post by: okee on 2010-Jan-09
A mac mini seems the cheapest option if you're not into Macs
You can also install Windows XP on the Mac very easily through
Bootcamp, so do your development in GLbasic on windows restart
and boot into OSX and then compile your app from the directory
you saved it in on XP.
Title: Re: a Simple Iphone App Code?
Post by: kamakazieturtle on 2010-Jan-09
Its alright, I can't afford a new machine let alone an iphone right now anyway. GP2X is still my favorite thing to dev for, think I'm just gonna hold off for the Pandora.  :S
Title: Re: a Simple Iphone App Code?
Post by: Gary on 2010-Jan-11
I use a macmini for my development which is used for nothing else but GLbasic and programming and its fine.

When I come to reset up my mac I would personally advise against going the bootcamp method of running windows and go for the Parallels option, simply because unless you are running anything other than GLBasic and maybe a few other "simple" programs, the loss in speed you get running via "emulation" far outweighs the hassles of booting in windows, compiling the code, copying it to a drive both the PC and mac can read and write to, shutting down, booting to mac, compiling, uploading to the iPhone, finding out you missed something out and having to boot back to Windows again. Bootcamp is fast and it does run exactly like Windows should (some might say slow, buggy and crashes a lot lol). But unless you have software that needs every CPU cycle then go for Parallels. You cant really run cpu intensive 3d windows games on the mac mini anyway

I havent tried it but I would imagine that Parallels can run GLBasic fine and be totally useable. Also it removes the need to partition the drive and suddenly realise that 30gb was not really enough for windows and all the graphics, sounds, code and other programs
Title: Re: a Simple Iphone App Code?
Post by: MrTAToad on 2010-Jan-11
Oh yes, Parallels runs GLBasic fine.  You lose hardware acceleration (and your program will tell you about it), so you will lose a lot of speed.
Title: Re: a Simple Iphone App Code?
Post by: MikeHart on 2010-Jan-11
I use vmware fusion 3 and it supports directx 9 and opengl 2.1 very good and fast. Virtualbox is very good too.
Title: Re: a Simple Iphone App Code?
Post by: Sokurah on 2010-Jan-12
Quote from: doimus on 2010-Jan-09
This way, you violate the agreement if you copy a single byte from the SDK.  You would have a hard time in court explaining why one byte isn't PART of the SDK. :rtfm:

Well, "who cares?" - it's not like they're ever gonna to come by your house and check what hardware you have. ;)
Title: Re: a Simple Iphone App Code?
Post by: bigsofty on 2010-Jan-12
Gernot went to great extents to get Apple to accept GLBasic as a development platform for iTunes... one of which, is to agree to develop on Apple hardware... this discussion is not one that will be read in a favourable light within Apple with regards to Gernots agreement.

My advice is not to discuss Hackintoshes on these forums, especially in the same context as GLBasic or none of us may end up publishing anything on the Appstore, Apple hardware based or not...

Maybe time for a thread lock?
Title: Re: a Simple Iphone App Code?
Post by: codegit on 2010-Jan-12
Quote from: bigsofty on 2010-Jan-12
Gernot went to great extents to get Apple to accept GLBasic as a development platform for iTunes... one of which, is to agree to develop on Apple hardware... this discussion is not one that will be read in a favourable light within Apple with regards to Gernots agreement.

My advice is not to discuss Hackintoshes on these forums, especially in the same context as GLBasic or none of us may end up publishing anything on the Appstore, Apple hardware based or not...

Maybe time for a thread lock?

I agree!!!  ;)

If anybody is interested, this is how I do it.

I have an old XP laptop networked to my MacBook Pro. EASY PEASY  8)
Title: Re: a Simple Iphone App Code?
Post by: doimus on 2010-Jan-12
Quote from: Sokurah on 2010-Jan-12

Well, "who cares?" - it's not like they're ever gonna to come by your house and check what hardware you have. ;)

Be careful when underestimating "THEIR" power. After all, it's THEM who killed Kenny. >:D  Bastards. :P

To people who run Win in parallels: how do you transfer data between Win and OSX - do Parallels have "Shared folders", like VirtualBox?
Title: Re: a Simple Iphone App Code?
Post by: Kitty Hello on 2010-Jan-14
I have no idea if it's illegal to run OS-X on a non-Mac.
Is it leagal to install it in vmware? At least VMWare supports it IMO.
Title: Re: a Simple Iphone App Code?
Post by: bigsofty on 2010-Jan-14
Quote from: Kitty Hello on 2010-Jan-14
I have no idea if it's illegal to run OS-X on a non-Mac.
Is it leagal to install it in vmware? At least VMWare supports it IMO.

1) Yes, on 1st ( http://blog.cytalk.com/2009/11/installation-of-os-x-on-non-apple-hardware-is-illegal/ )
2) There's no official Virtual machine, capable of installing OSX, distro for Win32 and there won't be, Apple has an agreement with VMWare (even if VMware agreed to support OSX on Win32 it would still break the OS X End User License Agreement (EULA), to install it, so your back to point one) not to create one.

Both of the above CAN be done via various hacks/patches but in my own experience and what I've read online, you will run into a lot of problems with Xcode.
Title: Re: a Simple Iphone App Code?
Post by: Kitty Hello on 2010-Jan-14
I see. I think about getting a mac mini then. :/