Changeset 2931 in orxonox.OLD for orxonox/trunk/importer/windowHandler.cc
- Timestamp:
- Nov 20, 2004, 1:33:51 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/importer/windowHandler.cc
r2759 r2931 3 3 #include "windowHandler.h" 4 4 #include <stdio.h> 5 void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height) 5 void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window 6 6 { 7 if (height==0) 7 if (height==0) // Prevent A Divide By Zero By 8 8 { 9 height=1; 9 height=1;// Making Height Equal One 10 10 } 11 11 12 glViewport(0,0,width,height); 12 glViewport(0,0,width,height); // Reset The Current Viewport 13 13 14 15 glMatrixMode(GL_PROJECTION); 14 15 glMatrixMode(GL_PROJECTION); // Select The Projection Matrix 16 16 glLoadIdentity(); 17 17 … … 21 21 gluLookAt (0,0,15, 0,0,0, 0,1,0); 22 22 23 glMatrixMode(GL_MODELVIEW); 24 glLoadIdentity(); 23 glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix 24 glLoadIdentity(); // Reset The Modelview Matrix 25 25 26 26 } … … 29 29 int WindowHandler::InitGL(GLvoid) // All Setup For OpenGL Goes Here 30 30 { 31 glEnable(GL_TEXTURE_2D); 32 glShadeModel(GL_SMOOTH); 33 glClearColor(0.00f, 0.00f, 0.00f, 0.0f); 34 glClearDepth(1.0f); 35 glEnable(GL_DEPTH_TEST); 36 glDepthFunc(GL_LEQUAL); 37 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); 31 glEnable(GL_TEXTURE_2D); // Enable Texture Mapping 32 glShadeModel(GL_SMOOTH); // Enable Smooth Shading 33 glClearColor(0.00f, 0.00f, 0.00f, 0.0f); // Black Background 34 glClearDepth(1.0f); // Depth Buffer Setup 35 glEnable(GL_DEPTH_TEST); // Enables Depth Testing 36 glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do 37 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations 38 38 39 39 return TRUE; … … 41 41 42 42 43 GLvoid WindowHandler::KillGLWindow(GLvoid) 43 GLvoid WindowHandler::KillGLWindow(GLvoid) // Properly Kill The Window 44 44 { 45 45 SDL_Quit(); … … 68 68 SDL_GL_GetAttribute( SDL_GL_STENCIL_SIZE, &size); 69 69 70 ReSizeGLScene(width, height); 70 ReSizeGLScene(width, height); // Set Up Our Perspective GL Screen 71 71 72 if (!InitGL()) 72 if (!InitGL()) // Initialize Our Newly Created GL Window 73 73 { 74 KillGLWindow();// Reset The Display75 return FALSE; // Return FALSE74 KillGLWindow(); // Reset The Display 75 return FALSE; 76 76 } 77 77 78 return TRUE; // Success78 return TRUE; 79 79 } 80 80
Note: See TracChangeset
for help on using the changeset viewer.