Random Drawing issue
For some crazy reason this wont draw, i am either high or stupid and possibly both. I cant figure this out which is odd because i havnt had this problem since ever.
this code is run through 100 times and the x value is right i havnt actually checked the y values of the tiles but i dont see how that is the problem. I feel really stupid posting this
edit: HAHAHAHHAHHAHAHAHAHAHAHAH glColor3f(0.0f, 0.0f, 0.0f); might have done it
anyway nevermind i was being stupid.
Code:
- (void)drawDuring:(NSRect)bounds
{
int a;
for (a = 0 ; a < [[game board] count] ; a++) {
Tile *drawTile = [[Tile alloc] init];
drawTile = [[game board] objectAtIndex:a];
glBindTexture(GL_TEXTURE_2D, plains);
NSLog(@"%d", [drawTile x]);
glPushMatrix();
glTranslatef([drawTile x] , [drawTile y], 0.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 1.0f); glVertex2f(0.0f, 0.0f);
glTexCoord2f(1.0f, 1.0f); glVertex2f(32.0f, 0.0f);
glTexCoord2f(1.0f, 0.0f); glVertex2f(32.0f, 32.0f);
glTexCoord2f(0.0f, 0.0f); glVertex2f(0.0f, 32.0f);
glEnd();
glPopMatrix();
}
}this code is run through 100 times and the x value is right i havnt actually checked the y values of the tiles but i dont see how that is the problem. I feel really stupid posting this

edit: HAHAHAHHAHHAHAHAHAHAHAHAH glColor3f(0.0f, 0.0f, 0.0f); might have done it
anyway nevermind i was being stupid.
Did you set up your projection and modelview matrices correctly? Did you call glFlush() or glFinish()?

