Drawing rectangles in a for()
Hi
I''m making a program with that function
void DrawBlocks(BLOCK *blocks)
{
glColor3f(0.0, 1.0, 0.0);
for(int i = 0 ; i < nbBlocks - 5; i++)
{
glPushMatrix();
glTranslatef(blocks.x,blocks.y, 0.0);
glVertex3f(-3.0, -0.5, 0.0);
glVertex3f(-3.0, 0.5, 0.0);
glVertex3f(3.0, 0.5, 0.0);
glVertex3f(3.0, -0.5, 0.0);
glPopMatrix();
}
}
unfortunately i get a fatal error on the entire program and when i use the microsoft visual C++ debugger i get the crash in that function when it loop for the 18th time.
Anyone knows if that thing has somthing to do with the matrix stack?
Thx alot
Kiroke </i>
Kirokewww.geocities.com/kiroke2
once you use blocks as a single variable then as an array. accoring to your function def it should be treated like an array, therefore you have to use blocks.x
@$3.1415rin
@$3.1415rin
are you forgetting GLbegin(GL_QUADS)/GLend(); by any chance??
http://www.lectersoft.com
http://www.lectersoft.com
http://www.lectersoft.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement