I am beginning with OpenGL, and I want to make a very simple game with airplanes. Now I have a PNG of an airplane seen from above, and I want to draw this on the screen. Currently I only know how to draw triangles that rotate:
float angle = 0.0f;
void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glRotatef(angle, 0.0f, 0.0f, 1.0f);
glBegin(GL_TRIANGLES);
glVertex2f(-0.5,-0.5);
glVertex2f(0.5,0.0);
glVertex2f(0.0,0.5);
glEnd();
glPopMatrix();
glutSwapBuffers();
angle += 0.1;
}
Can anyone help me? Thanks.