Well I have stored the bricks in vectors, I am working on how to get the ball to hit the bricks. I want to know how to do collision detection.
void drawBottomBricks()
{
glEnable(GL_TEXTURE_2D);
glPushMatrix();
glBindTexture(GL_TEXTURE_2D, texture[3]);
float br_x = -135, br_y = 55, br_x_right = -100, br_y_top = 70, br_x_width = 35, br_y_height = 15;
vector <Brick> bricks;
for (int i = 0; i < 8; i++)
{
bricks.push_back(Brick(br_x, br_y, br_x_width, br_y_height));
br_x += br_x_width;
br_x_right += br_x_width;
glBegin(GL_POLYGON);
glTexCoord3f(0.0f, 0.0f, 0.0f);
glVertex3f(bricks[i].x, bricks[i].y + br_y_height, 0.0f);
glTexCoord3f(1.0f, 0.0f, 0.0f);
glVertex3f(bricks[i].x, bricks[i].y, 0.0f);
glTexCoord3f(1.0f, 1.0f, 0.0f);
glVertex3f(bricks[i].x + br_x_width, bricks[i].y, 0.0f);
glTexCoord3f(0.0f, 1.0f, 0.0f);
glVertex3f(bricks[i].x + br_x_width, bricks[i].y + br_y_height, 0.0f);
glEnd();
}
glPopMatrix();
glDisable(GL_TEXTURE_2D);
}