Hi,
I have a problem with compiling under XCode 3.2. Use GLBasic 8.x Demo from your site. I'm test "Pong" project. After some setup GLBasic environment, have XCode folder with message
_______________________________________
*** Configuration: IPHONE ***
precompiling:
GPC - GLBasic Precompiler V.8.044 SN:9bc42999 - 2D, WIN32
Wordcount:74 commands
compiling:
arch:
Creating .app for PongBW
before copy...
...build the Project in: C:\Users\_All_\Desktop\GLPrg\GLBasic\Samples\_Projects_\Pong\XCode on Mac,
then compile and release.
success
_______________________________________
*** Finished ***
Elapsed: 4.6 sec. Time: 20:20
Build: 1 succeeded.
Copy to virtual system MacOS to Desktop and open project. Configure paths to Frameworks.
I make all steps in this guide http://www.glbasic.com/xmlhelp.php?lang=en&id=313&action=view and still have error
[BEROR] error: There is no SDK with the name or path `iphoneos3.0`
Another question. Can't choose compiling to `Simulator` and have error 'SDK Missing'
For clearly please see this shots from Mac OS
http://scan3d.ru/public_downloads/GLBasic/glbasic_01.jpg
http://scan3d.ru/public_downloads/GLBasic/glbasic_02.jpg
http://scan3d.ru/public_downloads/GLBasic/glbasic_03.jpg
Another good point. If create default GL Project from Standard XCode template - all work and compile fine!
How fix this?
I'm beginner under MacOS, but have good skill under Windows programming and understand - need configure paths and some setup environment.
If possible, make complete guide (step by step may be useful for another like me).
If you need more info from my side, please tell me and I make it.
Thanks!
I believe the problem is that you have to purchase the "GLBasic SDK premium"
Here:
http://www.glbasic.com/main.php?site=order&lang=en#PayPay-2009 (http://www.glbasic.com/main.php?site=order&lang=en#PayPay-2009)
Also, GLBasic doesn't work with xcode simulator.
Go to Project > Edit Active Target "iPhone" > Base SDK and set IOS Device to your current OS number (It'll probably show "3.xx Missing") - changed mine to 4.1 (the current update for iPod Touch). Exit then click where it says Base SDK Missing and click on Release. This works everytime for me.
:)
You can't run the "Simulator" - it has to be "Release"
This is for the Premium version only.
Thanks for fast answers!
I'm download your precompiled example " iPhone Touch demo" and move to Mac OS.
Make all your changes and ... can change to Simulator and don`t have errors after loading project!
But after start compiling still have several errors. See pictures below
http://scan3d.ru/public_downloads/GLBasic/steep01.jpg
http://scan3d.ru/public_downloads/GLBasic/steep02.jpg
http://scan3d.ru/public_downloads/GLBasic/steep03.jpg
http://scan3d.ru/public_downloads/GLBasic/steep04.jpg
http://scan3d.ru/public_downloads/GLBasic/steep05.jpg
You have SIMULATOR selected. You need to use DEVICE and RELEASE mode, not DEBUG.
Not working with Emulator?! I'm confused. It is incredible for real develop.
Thanks for patience and my terrible English. ;)
The emulator runs under the Intel processor, whilst iPhone's use ARM. Gernot did say why the emulator cant be used, but I cant find the post
Ian Price may be, you're wrong.
Unfortunately, my English is not too good, so, please, read this http://en.wikipedia.org/wiki/Virtualization.
In a word, it doesn't matter what platform you're working with, basic tools use full virtualization
http://en.wikipedia.org/wiki/Full_virtualization
Any application made with XCODE can be launched in an emulation mode. It is compiled using ARMV6-7 architecture and runs on simulator, which means that project settings are the same as in the GLBasis generated project. It shows that internal XCODE simulator supports ARM architecture emulation.
I have a couple of questions to developers:
1. Will Newton SDK sample run on iPhone or iPad correctly? I'm not concerned about the speed right now, but the possibility itself.
2. Are there any examples of using Box2D physics for iPhone? (source-files I mean) What are the restrictions?
3. What are the additional restrictions for compiling a project for iPhone, except those described in help section? I mean some programming/memory management refinement, if there are any at all.
4. By the way, how exactly is memory unloading organized? Is there any kind of a memory manager or maybe methods of working with memory for iPhone?
Thank you for your time!
QuoteIan Price may be, you're wrong.
Unfortunately, my English is not too good, so, please, read this http://en.wikipedia.org/wiki/Virtualization.
It has nothing to do with virtualisation. XCode won't/can't run GLBasic iPhone apps under SIMULATION, ask Kitty Hello for specific the reasons. You have to create the game for an actual device and not run it in DEBUG mode. MrTatoad stated the same.
[EDIT] Made clearer. Maybe?
Do you have all provisioning and keychain and all the other stuff setup on MacOS?
The "simulator" in Windows GLB :)
Quote from: VlasovAlexey on 2010-Nov-30
Any application made with XCODE can be launched in an emulation mode. It is compiled using ARMV6-7 architecture and runs on simulator, which means that project settings are the same as in the GLBasis generated project. It shows that internal XCODE simulator supports ARM architecture emulation.
I have a couple of questions to developers:
1. Will Newton SDK sample run on iPhone or iPad correctly? I'm not concerned about the speed right now, but the possibility itself.
2. Are there any examples of using Box2D physics for iPhone? (source-files I mean) What are the restrictions?
3. What are the additional restrictions for compiling a project for iPhone, except those described in help section? I mean some programming/memory management refinement, if there are any at all.
4. By the way, how exactly is memory unloading organized? Is there any kind of a memory manager or maybe methods of working with memory for iPhone?
Hi,
the "Simulator" Apple ships is not an "emulator". You would have to compile x86 code for testing your iPhone program on a Mac - which is very silly, because you have no gravity and stuff. Get a real device and it's OK.
You can compile for iPhone with the FREE version. However, the running program will indicate that and quit after I think 5 minutes or so.
Questions:
1. Newton is not ported, yet. For iPhone you want the 2D Box2D physics engine, which is supported.
2. Yes, it works. You have to set a compiler flag due to a GCC optimization bug, though. Search the forums. Very few example projects, yet. But in the App-Store thread there is one.
3. There's no restrictions. GLBasic compiles to C++/objC code and you compile a real XCode project. You can extend it to whatever you want with inline code.
4. To unload memory, you can free sprites (LOADSPRITE "", id%), sounds and release array memory with DIM arr[0].
HTH,
-Gernot
OK. It works with 7.203 GLBasic. But if I use newer version 8.х, I get this compilation error message:
---
Linking <path to build>build/Release-iphoneos/iTouchMouse.app/iTouchMouse(1 error)
collect 2: Id terminated with signal 6(Abort trap)
Command <path to GCC Compiler> failed with exit code 1
---
I think the problem is in the compiler or the project's settings. What version XCode and Iphone SDK should be to use GLBasic 8.х?
You need to use the latest XCode with the latest iOS (or an XCode that compiles to the same version of iOS as your iDevice). XCode and iOS recently had updates. Download both, install XCode, then try compiling again.
I'm not sure your error is related to that though - I recently updated my iPod, but not my XCode and I got errors, but they weren't the same you are reporting. My errors were obvious in the fact that XCode was an old version and iOS 4.2 wasn't supported. But anyway, update everything, and try again. Let us know how you got on.
Remember you must ensure that you are writing for a DEVICE (not a simulator) and that the BASESDK matches your iPhone/iPod/iPad iOS.
After very strange manipulation with XCode versions all works fine.
Another problem. 3D Examples doesn't load textures and models. Simply - all media not found.
I put Resources to media folder. But still get "flat" render.
You can download "Islands" example compiled by me for IPhone.
http://scan3d.ru/public_downloads/IslandsBug.zip
Thanks for Help!
p.s. " iPhone Touch demo" load sprite fine...
try a drawsprite for the texture to see if it was loaded properly? It should work, as there are 3D examples on youtube that use textures.
If you past all files to same root - all work fine.
Example:
[Folder] _CodeSignature
[Folder] Media
Icon.png
Info.plist
iPhone-Info.plist
Islands
PkgInfo
ResourceRules.plist
Textures and Sprites not displayed. Now move "Media" files to root:
[Folder] _CodeSignature
[Folder] Media
Icon.png
Info.plist
iPhone-Info.plist
---------------------
Land.bmp
Water.bmp
---------------------
Islands
PkgInfo
ResourceRules.plist
and now work fine. This rule work for any 3D Examples for me.
Finally, model loading is very slow(1-1,2Mb per second) on "Animation" example.
I'll do more tests later but I had the same problem. I modified the 3D Maze example to work using only mouse controls (aka touch controls), and then tried to compile for iOS. There were three problems:
1) No textures applied to the 3D objects, leaving me with a screen of white and grey.
2) MOUSEAXIS(0), supposed to return the mouse's X speed, consistently returns 319 above the actual speed. There seems to be no problem with MOUSEAXIS(1) - Y speed.
3) GETMOUSECOUNT() consistently returns 4. Isn't it supposed to return the number of fingers being used on the multitouch screen?
For the record, I HAVE tried Vlasov's 'solution' and using the Media folder. I made sure that all files were added in XCode's resource list, and I confirmed that they are all added correctly in the .plists and other files inside the .app. Regardless of whether the media folder is used, all 3D objects were not textured.
If anyone is willing to try it, paste this over the main loop in the example and try compiling:
WHILE TRUE
dtime = GETTIMER()
// Show FPS / FPS anzeigen
fps = ((1000/dtime)+fps)/2
delay=delay+dtime
IF delay>1000 // 1/2 sec
delay=0
ShowFPS=fps
ENDIF
// limit on slow machines / begrenzen f. langsame Rechner
dtime = MIN(dtime, 16)
// For nicer textures / für schönere Texturen
X_MIPMAPPING TRUE
// 3D Viewport
X_MAKE3D 1, 800, 45
// Set Camera / Kamera setzen
X_CAMERA ply_x, sz*.75, ply_y, ply_x+COS(ply_dir)*sz, sz*.7, ply_y+SIN(ply_dir)*sz
// Only draw front faces / Nur vorferseiten zeichnen
X_SPOT_LT 0, RGB(255,255,255), ply_x, sz*.75, ply_y, ply_x+COS(ply_dir)*sz, sz*.7, ply_y+SIN(ply_dir)*sz, 360
X_FOG RGB(0,0,0), TRUE, 0.01, 0
X_CULLMODE 1
// Draw walls / Wände zeichnen
X_SETTEXTURE 0, -1
X_DRAWOBJ 0,0
X_SETTEXTURE 1, -1
INC offset#, 0.005
X_SETTEXTUREOFFSET offset, offset
X_DRAWOBJ 1,0
// Floor and walls are different objects, since GLBasic handles
// one texture per object. You could have drawn all needed
// Textures in one sprite and use texture coordinates
// to display only parts of the sprite - would be faster
// Boden und Wände sind 2 Objekte, da GLBasic jedem Objekt eine
// eingene Textur zuweist. Man kann alle benötigten Texturen in
// ein Sprite zeichnen und dann mit Texturkoordinaten nur
// einen Bereich davon verwenden - das wäre schneller
//mx=GETJOYY(0)*dtime/100
mx=GETMOUSECOUNT()*MOUSEAXIS(0)*dtime/100
//my=0
// IF KEY(200) THEN my=1
// IF KEY(208) THEN my=-1
my1=my1 - GETMOUSECOUNT()*MOUSEAXIS(1)
my=my1*dtime/10000
//my=-GETJOYZ(0)
// Remember current position / Aktuelle Position merken
ply_x_old = ply_x
ply_y_old = ply_y
// Try moving in 'x' / Versuchen in 'x' Richtung zu bewegen
ply_x=ply_x+my*COS(ply_dir)*sz*dtime/1000
// IF X_COLLISIONAABB(0,0,ply_x, sz/2, ply_y, sz/4, sz/2, sz/4) THEN ply_x=ply_x_old
IF X_COLLISION(0, 0, sz/4, ply_x, sz/2, ply_y) THEN ply_x = ply_x_old
ply_y=ply_y+my*SIN(ply_dir)*sz*dtime/1000
// Try moving in 'y' / Versuchen in 'y' Richtung zu bewegen
// IF X_COLLISIONAABB(0,0,ply_x, sz/2, ply_y, sz/4, sz/2, sz/4) THEN ply_y=ply_y_old
IF X_COLLISION(0, 0, sz/4, ply_x, sz/2, ply_y) THEN ply_y = ply_y_old
// Turn player / Spieler drehen
ply_dir=ply_dir+mx
X_MAKE2D
// Visualize level data in 2D / Level Daten in 2D zeichnen
ALPHAMODE 1
FOR X=0 TO BOUNDS(Level[], 0)-1; FOR y=0 TO BOUNDS(Level[], 1)-1
IF Level[X][y] THEN DRAWRECT X*10, y*10+20, 10, 10, RGB(128,128,128)
NEXT;NEXT
DRAWRECT ply_x*10/sz-4, ply_y*10/sz+20-4, 7, 7, RGB(255,255,255)
ALPHAMODE 0
PRINT "0:"+FORMAT$(3, 0, MOUSEAXIS(0))+" 1:" + FORMAT$(3,0,MOUSEAXIS(1)) + " #:" + GETMOUSECOUNT(), 0,0
SHOWSCREEN
WEND
EDIT: And btw 2D apps that I have tested seem to load media fine...
try disabling the used features one by one. Light/fog/texture offset.
I've tried previous versions without texture offset and lighting, but not fog. I would try but I'm having problems compiling at the moment. I'll post when I get things working again...