Hello all,
I had a play around this afternoon and came up with this...
http://www.glbasic.com/showroom.php?site=games&game=iphonetouchfeatureexample&lang=en
it's basically a demo showing the touch control of the iphone programmed in GLBasic.
I also made this quick video to show how to compile to the iphone...
http://www.youtube.com/watch?v=eGdTdmCI34w
hope it helps.
Cheers
Unc
Should be useful to everyone!
QuoteShould be useful to everyone!
As long as they have a Mac. And an iPhone/iPod Touch:(
I want one now.
Nice one Uncle :)
If you need anything compiled for an iMac, I can do it for you.
Cant help with the iPhone/iPod though :)
Cheers MrTAToad :)
No problem!
Hi folks,
I downloaded the demo of GLBasic as I am interest in developing for the iphone. Is the demo not able to compile for the iphone?
If it is not a released feature, can you estimate when it will be available? And will GlBasic support the iphones accelerators too?
If the demo is V6, then it wont - you need to try the V7 RC2 version - available from the Shoutbox
Quote from: MikeHart on 2009-Aug-08
And will GlBasic support the iphones accelerators too?
Yes it will support accelerators. I think it treats them as joystick inputs. If I get time I will try and make a demo of this as well.
Nice video Uncle.
Accelo is a joystick in glbasic. Tryout joystick commands and dont forget to normalize for smoothly function
you like iPhone?
try things and let us know if its working or not and what must be added to glbasic. (not GPS, its working but hidden yet)
Thanks for the info!
Quote from: trucidare on 2009-Aug-09
Nice video Uncle.
Accelo is a joystick in glbasic. Tryout joystick commands and dont forget to normalize for smoothly function
you like iPhone?
try things and let us know if its working or not and what must be added to glbasic. (not GPS, its working but hidden yet)
The accelerometers are working well. The only thing I haven't been able to do is figure out when the orientation of the iPhone has changed i.e. landscape to portrait etc. Well I did work out a method but it was flaky at best. I've searched the iPhone SDK and Im still not sure how they do it. I think its part of the UIViewController class. But it would be good to have a get function to return the current orientation, then we can decide on how to handle the event.
Gernot is working for this.
To get the current orientation, just check which axis has the strongest amplitude. There's an image in the manual in uhm... "platform specific stuff" or so...
I'm working on a native landscape mode, where you can use SETSCREEN to rotate it.
Quote from: Kitty Hello on 2009-Aug-11
I'm working on a native landscape mode, where you can use SETSCREEN to rotate it.
Yes please, Yes please, Yes please, Yes please, Yes please, ....... =D
Out of curiosity:
What happens if you do SETSCREEN 160, 240, 1 on iPhone, ie. if you set the screen at 1/4 size (or any other non-native res)? Does it rescale to full-screen or it just doesn't work?
Just tried. It seems to ignore any sizes that aren't 320 x 480. Nothing is rescaled, and the program just run normally (like if you had selected 320 x 480).
@Uncle: Can you try to add 480x320 to the configuration file in the iphone section and let me know if it still runs in 320x480? Somewhere I saw an inline code for switch to landscape mode but cannot find the post.
Hi Andrew,
I have a question. In your video, you just changed the domain part in the bundle identifier inside the plist, but not build name and exe name.
I always got an code sign error if I didn't fill this in by hand. I have an app ID specially for this app Im creating. What did you do different so
you don't needed to do this?
Michael
Hi!
I install the SDK and view your video many times.
I follow all of your steps.... but.
I have this error with your sourcecode (perfect on win32):
Building target “iPhone†of project “iPhone†with configuration “Debug†â€" (2 errors, 1 warning)
Checking Dependencies
Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'iPhone-Info.plist'.
Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'iPhone-Info.plist'.
cd /Users/hark0/Desktop/iTouchMouse/XCode/GLBasic
setenv MACOSX_DEPLOYMENT_TARGET 10.5
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk -L/Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/build/Debug-iphonesimulator -L/Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/Lib -F/Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/build/Debug-iphonesimulator -filelist /Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/build/iPhone.build/Debug-iphonesimulator/iPhone.build/Objects-normal/i386/iPhone.LinkFileList -mmacosx-version-min=10.5 -lstdc++ -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -framework AudioToolbox -framework CoreLocation -framework OpenAL -lGLBasiciPhone-egl -lpng-gf -lPROGRAM -o /Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/build/Debug-iphonesimulator/iPhone.app/iPhone
ld warning: in /Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/Lib/libGLBasiciPhone-egl.a, file is not of required architecture
ld warning: in /Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/Lib/libpng-gf.a, file is not of required architecture
ld warning: in /Users/hark0/Desktop/iTouchMouse/XCode/GLBasic/Lib/libPROGRAM.a, file is not of required architecture
Undefined symbols:
"_iPhoneDeviceID", referenced from:
_main in main.o
"_GLB_iPhone_call_main", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
"_iPhoneDeviceID", referenced from:
_main in main.o
"_GLB_iPhone_call_main", referenced from:
_main in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Build failed (2 errors, 1 warning)
TIA in advance.
Try to build on release mode. First error will probably disappear.
And compile for the device and not simulator
(http://www.gigacrate.com/Blog/wp-content/uploads/2008/12/doh.gif)
I try again... thanks!!!
WELL...
SORRY FOR THE FIRST POST!!! (I have 2 hours fighting with certificates & keychains).
I just set to Release and Device 3.1.2.... and works PERFECT!!!!
THANKS!!!!
:good:
Great!! =D
De nada hombre, un placer.
QuoteI have 2 hours fighting with certificates & keychains)
They are a real pain.
Uncle,
A video is worth a thousand FAQs!- thanks- this is very helpful & very considerate of you to go to the effort of producing this.
Kind regards, Shawn
I've been compiling this to my iPhone, and the app opens, does nothing and then closes again.
I've heard it will close the app if something doesn't work. Its Windows build runs no problems, AFAIK I've made sure the files it accesses are written in the correct case.
I am using an iPhone 2G with XCode 4.0.1, compiling for iPhone iOS 3.0. I am using V8.078 of GLBasic.
Any help on this would be greatly appreciated. :)
I can verify it's not the loading of the sprite, it seems to be doing that just fine. I think it has something to do with polling the touchscreen.
in the glb-code you could use STDOUT "position" and then xcode will write your positions into the debug console. Then you can see where your program is crashing.
Thanks for that Backslider. When I get a moment to have another go at it I'll try that out. I suspect that it's throwing errors because it says that there are 16 different mouses (touches) available, which may be true for an iPad, but not for an iPhone. I'll see what happens...
Yeah it was MouseCount seeing 16 touches and the array is only 5.
I cobbled this together and it runs fine now.
FUNCTION updateMice:
gm = GETMOUSECOUNT()-1
IF gm>4 THEN gm=4
FOR imouse% = 0 TO gm
SETACTIVEMOUSE imouse%
MOUSESTATE mx%, my%, b1%, b2%
mouse[imouse].x=mx
mouse[imouse].y=my
mouse[imouse].active=b1
NEXT
ENDFUNCTION
A tip is to reverse the loop so that the active mouse exits the function on the default 0 state. :P
Here's my mouse update function: ;)
http://www.glbasic.com/forum/index.php?topic=4806.msg36640#msg36640
@Billamu: I had exactly the same error at first on iPhone :D
I solved the problem like this example:
type Mouse
x
y
endtype
global mouse[] as Mouse
dim mouse[getmousecount()]
...and it works.
Hallo,
this example is not work with XCode 4 and Lion. I have made 100 ciclus and tested ....... on the display from the IPohne i cand see anymore.
Sorry my english its so little bit.
Thx TFT
The only factor I haven't been able to do is determine when the direction of the iPhone has modified i.e. scenery to symbol etc. Well I did perform out a technique but it was flaky at best. I've explored the iPhone SDK and Im still not sure how they do it.