Random Drawing issue

Member
Posts: 102
Joined: 2005.01
Post: #1
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.

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 Sad

edit: HAHAHAHHAHHAHAHAHAHAHAHAH glColor3f(0.0f, 0.0f, 0.0f); might have done it Annoyed anyway nevermind i was being stupid.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #2
Did you set up your projection and modelview matrices correctly? Did you call glFlush() or glFinish()?
Quote this message in a reply
Post Reply