iDevGames Forums
Random Drawing issue - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Random Drawing issue (/thread-4994.html)



Random Drawing issue - Coin - Sep 25, 2005 12:15 PM

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.


Random Drawing issue - akb825 - Sep 25, 2005 12:56 PM

Did you set up your projection and modelview matrices correctly? Did you call glFlush() or glFinish()?