- glMatrixMode(GL_PROJECTION); // Select the modelview matrix
- glLoadIdentity(); // Reset the modelview matrix
- glOrtho(0,640,0,480,0,100);
- glEnable(GL_TEXTURE_2D);
- glShadeModel(GL_FLAT);
- glEnable(GL_DEPTH_TEST);
- //glDepthFunc(GL_LESS);
- glClearColor(1.0f, 0.0f, 0.0f, 0.0f);
- glClear(GL_COLOR_BUFFER_BIT);
- glBlendFunc(GL_SRC_ALPHA,GL_ONE);
- glBindTexture(GL_TEXTURE_2D, textures[2].texID);
- //glEnable(GL_BLEND);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f); glVertex3i(0, 0, 0); // Bottom left of the texture and quad
- glTexCoord2f(1.0f, 0.0f); glVertex3i( 640, 0, 0); // Bottom right of the texture and quad
- glTexCoord2f(1.0f, 1.0f); glVertex3i( 640, 480, 0); // Top right of the texture and quad
- glTexCoord2f(0.0f, 1.0f); glVertex3i(0, 480, 0); // Top left of the texture and quad
- glEnd();
- glBindTexture(GL_TEXTURE_2D, textures[2].texID);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f); glVertex3i(ship[0][0]-32, ship[0][1]-32, 0); // Bottom left of the texture and quad
- glTexCoord2f(1.0f, 0.0f); glVertex3i( ship[0][0]+32, ship[0][1]-32, 0); // Bottom right of the texture and quad
- glTexCoord2f(1.0f, 1.0f); glVertex3i( ship[0][0]+32, ship[0][1]+32,0); // Top right of the texture and quad
- glTexCoord2f(0.0f, 1.0f); glVertex3i(ship[0][0]-32, ship[0][1]+32, 0); // Top left of the texture and quad
- glEnd();