The start screen is just a JPEG textured to a polygon the size of the screen, see code....
int StartScreen(void) { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clears screen glMatrixMode(GL_PROJECTION); //Selects projection matrix glLoadIdentity(); glOrtho(0,1024,0,768,-1,1); //Changes to orthographic projection in order to display text on top glMatrixMode(GL_MODELVIEW); //Selects modelview matrix glLoadIdentity(); GLfloat emission[] = {0.8f, 0.8f, 0.8f, 0.0f}; glMaterialfv (GL_FRONT, GL_EMISSION, emission ); glDepthRange (0, 0.3); glBindTexture(GL_TEXTURE_2D, TextureArray[7]); //Front screen JPEG glBegin(GL_QUADS); //Begins draw procedure with triangles selected glTexCoord2f(0.0f, 0.0f); glVertex2i(0, 0); glTexCoord2f(1.0f, 0.0f); glVertex2i(1024, 0); glTexCoord2f(1.0f, 1.0f); glVertex2i(1024, 768); glTexCoord2f(0.0f, 1.0f); glVertex2i(0, 768); glEnd (); glFlush(); return TRUE;}
Sound is very basic...
PlaySound("Data/reload.wav", NULL, SND_ASYNC);
I am gonna probably look into updating the sound
Input is Windows input using
case WM_KEYDOWN:
within the WndProc procedure
but to get around the problem of pressing and holding the key and getting an initial move then a pause then a constant move I added this in a different procedure instead of using the WndProc...
void MoveCamera(bool keys[]){ if (( keys[VK_UP] ) || (keys['W'])) {........
yeah the framerate is stumping me at moment, really not sure how to improve it any more.
I exported the data from 3DS Max using Deep Exploration and it creates display lists. I have optimised the polygons within 3DS Max as much as I can but am still left with 8000ish polygons with everything, obviously not everything is drawn at once in OpenGL but a lot of it is.
I have tested it without the majority of polygons and it speeds right up to a few hundred fps so I know this is the bottleneck but it is just a case of finding a way around it.
[edited by - rickp101 on June 19, 2003 7:42:42 AM]