OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Tiling Help!


Post Reply New Thread Subscribe

 
Thread Tools
MACnus
Guest
 
Posts: n/a

Can any of you guys help me with this.
i can't anything out to my screen?
http://magnus.murel.no/Map.zip
i've tried to convert this to cocoa?
http://www.gamedev.net/reference/art...rticle1256.asp
QUOTE Thanks
witeshark

 
witeshark's Avatar
 
Member Since: Mar 09, 2004
Location: Miami FL
Posts: 2,860
witeshark will become famous soon enough
Mac Specs: G4 1Ghz OS X 10.4.7

witeshark is offline
I saw some map application, but it didn't render rightly
QUOTE Thanks
MACnus
Guest
 
Posts: n/a

I've have problems with this:
Code:
- (BOOL) draw_tiles
{
   int tile;
   int x,y;
   
   char map[MAP_SIZEY][MAP_SIZEX] = 
	{
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
		{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
	};

    for (y = 0; y < MAP_SIZEY; y++)
	{
		for (x = 0; x < MAP_SIZEX; x++)
		{   
			glLoadIdentity();
			tile = map[y][x];
			glBindTexture(GL_TEXTURE_2D, texture[tile]);
			glBegin(GL_QUADS);
				glTexCoord2f(0.0f, 0.0f);
					glVertex3f(float(x), float(y), 0.0f);
				glTexCoord2f(1.0f, 0.0f);
					glVertex3f(float(x + 1), float(y), 0.0f);
				glTexCoord2f(1.0f, 1.0f);
					glVertex3f(float(x + 1), float(y + 1), 0.0f);
				glTexCoord2f(0.0f, 1.0f);
					glVertex3f(float(x), float(y + 1), 0.0f);
			glEnd();
		}
	}
	return (1);
}
I get this error
Code:
MapView.m:121: error: parse error before "float"
MapView.m:123: error: parse error before "float"
MapView.m:125: error: parse error before "float"
MapView.m:127: error: parse error before "float"
What do I have to do?
QUOTE Thanks

Post Reply New Thread Subscribe


« OS X cf issue.. | GLUT & OpenGL problems »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 07:41 AM.

Powered by vBulletin
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?