iPhone/iPod software development thread

Arwin

Now Officially a Top 10 Poster
Moderator
Legend
Well, as I mentioned in another thread, I borrowed a MacBook for a few weeks, and in my first two evenings I managed to read a lot of stuff and set up everything necessary to be able to run the sample applications on both the Simulator and my actual iPod.

For this I had to:

(- find space on this MacBook, when I got it it had 600MB left, leaving me the task of finding stuff I could safely move, using an OS I'm not familiar with. A bit scary)
- download and install the iPhone SDK / XCode c.s. (needs about 3.5GB and can only be installed on the main OS/X drive, which is a shame - if I could have run everything from my external HDD that would have saved me a lot of time)
- download some sample apps to run on the simulator. This went fine.
- sign up and pay for the developer programme (79 euro a year), and wait for just over 24 hours to get the code (they mention it may take up to 24 hours, but I was still surprised it actually did take that long :D)
(- after running a few more examples I ran out of space again. This time I managed to find out where all the space had gone, and temporarily moved some iTune folders to the external HDD as well.)
- registering my dev programme
- creating a developer certificate
- creating an App ID certificate thingy
- registering my iPod for development
(some of these steps were a bit confusing partly because everything is set up for managing a team, and you have to create certificates and then approve and issue them to yourself)

But now I'm at the point where everything works, and all that is holding me back is knowledge of the iPhone OS and the actual programming. So now the rest of the time is going to be spent at trying to actually create something simple for my kid to play with to start with, and if I have enough time, maybe see if I can recreate one of my tools at work on the iPhone.

I think in general the development environment and everything surrounding it is well thought out by Apple. It's just a really big shame that it requires an actual Mac. That makes this a much bigger investment for me than it would have otherwise, and a much less certain thing for me to do, because even such a small investment as buying a Mac Mini is still unlikely to be made back from the App Store, I think. But we'll see - it's a valuable learning experience about UI programming, and that's what I wanted to get out from this most of all, and I'm sure I can at least share some insights between this and other platforms.

Anyone else here involved in this stuff? I'll be posting my experiences here over the next few weeks.

- The GLGravity demo is an interesting one by the way, I can see how this combined with a compas is very smart for doing augmented reality stuff with the sensors and with or without the camera.
 
Shouldn't this be in the tech thread ? ^_^

I will definitely go deeper with my iPhone app. But if it becomes work, I may not be able to share much.
 
I've been a Mac user since 2006 not because I'm a big fan of Apple, but because I love NeXTSTEP. I've done a bit of Cocoa programming but most of the programming I do is commandline.

There was a thread about iPhone games some weeks ago and that made me pull the trigger and get a new iPod Touch. I needed a bigger capacity iPod and it was the perfect excuse to play with the 3rd gen pixel shader hardware.

So I have everything setup already. My desktop is a Mac Pro so I had the required hardware and I'm currently porting my 3D engine (which targets the PSP) to the iPhone/iPod. So far I'm having lots of fun.

I usually release my code under a BSD license and might do the same for the engine once it's finished. Given the very limited amount of spare time I have it's going to take a while, though, but I'm sure we can share tips and experiences here.

Btw, we need an Apple icon ;)
 
Hi,

As one of my few PSP projects was a simple OpenGL experiment based on NeHe's tutorials, and I came across a couple of iPhone versions of these (which work after commenting out an extra main window being opened), I thought I might try and port this to the iPhone.

The application is a simple 3D text renderer (well for now the text is 2D, but you can place it anywhere in 3D space).

Now my main issue is the following. I actually send each character I need to draw as a structure to this function, which defines an as simple as possible polygon to represent each letter of the alphabet in relative terms, and draws it with the provided colors:

Code:
int DrawGLChar(struct gltext_Param * agl_Char)
{
	GLfloat x;
	GLfloat y;
	GLfloat z;
	GLfloat width;
	GLfloat height;
	GLfloat endwidth;

	x = agl_Char->x;
	y = agl_Char->y;
	z = agl_Char->z;
	width = agl_Char->width;
	height = agl_Char->height;
	endwidth = agl_Char->endwidth;
	agl_Char->drawnWidth = width;

	glColor3f((*agl_Char).Red, (*agl_Char).Green, (*agl_Char).Blue);				// vertexcolor
	switch ((*agl_Char).unicodechar)
	{
	case 65:
	glBegin(GL_POLYGON);
		glVertex3f(x - (width/2), y, z);
		glVertex3f(x - (width/2) + endwidth, y, z);
		glVertex3f(x, y + height, z);
	glEnd();
	glBegin(GL_POLYGON);
		glVertex3f(x + (width/2), y, z);
		glVertex3f(x + ((width/2) - endwidth), y, z);
		glVertex3f(x, y + height, z);
	glEnd();
	glBegin(GL_POLYGON);
		glVertex3f(x - width/4, y + height/2, z);
		glVertex3f(x + width/4, y + height/2, z);
		glVertex3f(x + width/4, y + height/2 - endwidth, z);
	glEnd();
	agl_Char->drawnWidth = width-endwidth;

	break;
	case 66:
etc.

Now as I understand it is not possible to work this way on the iPhone. Instead, I need to create arrays for the vertices and the colors separately? If so, how can I do this efficiently? Right now I'm thinking, add pointers to two arrays, one for the vertices and one for the colors. Is there a way to fill the arrays without stating in advance how many vertices / colors will be in there, or do I need to write a function that calculates this in advance? (I guess it's possible, I know how many vertices each character requires in my current implementation, but if not necessary I'd rather not!)

So structurally (and in pseudocode, my mind hasn't switched back to C just yet), I would need to do something like:

Code:
vertex_maxCount = getCount(*myText);
var GLFloat vertices[vertex_maxCount];
var GLFloat colors[vertex_maxCount];
vertex_Count = 0;
while(myText[i] != '\0')
{
addChar(&myChar,&vertices,&colors,&vertex_Count)
}
set glvertex and glcolor pointers to the vertices and colors arrays
tell gl to draw them ...

And then the addChar function becomes something like this:

Code:
- calculate the absolute values for and add the vertices to the vertices array at vertex_Count and raise vertex_Count by one
- add the colors to the vertices array using the same vertex_Count index

It should seem to work in theory? However, in the tutorial it seems you need to use vertexFaces values as well. Now here's a good point to point out I'm a complete 3D / OpenGL n00b, as I don't understand why that is?

(I must say that I think I can get into this stuff, and if I get this kind of thing to work and manage to manipulate the letters with multi-touch and jumble them using tilt, say, then I can definitely see myself forking out 500 euro for a Mac Mini ... )
 
Back
Top