I was trying to build a game like this
and i want to create and destroy these ships at runtime , I have used GL_QUADS and used an image to plot over the QUAD, how can I dynamically create multiple Quads,paste (ship) image over them and destroy them when they collide with the canon ball, thanks
here is a chunk of code
ship = SOIL_load_OGL_texture(
"ship2.png",
SOIL_LOAD_RGBA,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_INVERT_Y
);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3f(1, 1, 1);
glBindTexture(GL_TEXTURE_2D, ship);
glBegin(GL_QUADS);
glTexCoord2d(0, 0);
glVertex2d(450 - x, 0);
glTexCoord2d(1, 0);
glVertex2d(500 - x, 0);
glTexCoord2d(1, 1);
glVertex2d(500 - x, 100);
glTexCoord2d(0, 1);
glVertex2d(450 - x, 100);
glEnd();