| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
|
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 | |
![]() Member Since: Mar 09, 2004
Location: Miami FL
Posts: 2,860
![]() Mac Specs: G4 1Ghz OS X 10.4.7
|
|
| QUOTE Thanks | |
|
Guest
Posts: n/a
|
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);
}
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" |
||||
| QUOTE Thanks | |||||
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
All times are GMT -4. The time now is 07:41 AM.
Powered by vBulletin