Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2931 in orxonox.OLD for orxonox/trunk/importer/windowHandler.cc


Ignore:
Timestamp:
Nov 20, 2004, 1:33:51 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: included mouse-speed-turning (touch the screen and the object will start to move). Also included windows.h if in WIN32. general cleanup of framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/windowHandler.cc

    r2759 r2931  
    33#include "windowHandler.h"
    44#include <stdio.h>
    5 void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height)                // Resize And Initialize The GL Window
     5void WindowHandler::ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window
    66{
    7         if (height==0)                                                                          // Prevent A Divide By Zero By
     7        if (height==0)  // Prevent A Divide By Zero By
    88        {
    9                 height=1;                                                                               // Making Height Equal One
     9                height=1;// Making Height Equal One
    1010        }
    1111
    12         glViewport(0,0,width,height);                                           // Reset The Current Viewport
     12        glViewport(0,0,width,height); // Reset The Current Viewport
    1313
    14 
    15         glMatrixMode(GL_PROJECTION);                                            // Select The Projection Matrix
     14       
     15        glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
    1616        glLoadIdentity();       
    1717
     
    2121        gluLookAt (0,0,15, 0,0,0, 0,1,0);
    2222
    23         glMatrixMode(GL_MODELVIEW);                                                     // Select The Modelview Matrix
    24         glLoadIdentity();                                                                       // Reset The Modelview Matrix
     23        glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
     24        glLoadIdentity(); // Reset The Modelview Matrix
    2525
    2626}
     
    2929int WindowHandler::InitGL(GLvoid)                                                                               // All Setup For OpenGL Goes Here
    3030{
    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
     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
    3838
    3939    return TRUE;
     
    4141
    4242
    43 GLvoid WindowHandler::KillGLWindow(GLvoid)                                                              // Properly Kill The Window
     43GLvoid WindowHandler::KillGLWindow(GLvoid) // Properly Kill The Window
    4444{
    4545        SDL_Quit();
     
    6868        SDL_GL_GetAttribute( SDL_GL_STENCIL_SIZE, &size);
    6969
    70         ReSizeGLScene(width, height);                                           // Set Up Our Perspective GL Screen
     70        ReSizeGLScene(width, height); // Set Up Our Perspective GL Screen
    7171
    72         if (!InitGL())                                                                          // Initialize Our Newly Created GL Window
     72        if (!InitGL()) // Initialize Our Newly Created GL Window
    7373        {
    74                 KillGLWindow();                                                                 // Reset The Display
    75                 return FALSE;                                                                   // Return FALSE
     74          KillGLWindow();  // Reset The Display
     75          return FALSE;
    7676        }
    7777
    78         return TRUE;                                                                            // Success
     78        return TRUE;
    7979}
    8080
Note: See TracChangeset for help on using the changeset viewer.