Page principale   Liste des namespaces   Hiérarchie des classes   Liste par ordre alphabétique   Liste des composants   Liste des fichiers   Composants   Déclarations  

ExManagerOutput.cpp

Aller à la documentation de ce fichier.
00001 /*
00002  * ExNihilo 3D Engine
00003  * 
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * Please read AUTHORS file !!!
00019  * 
00020  * $Id: ExManagerOutput.cpp,v 1.13 2002/08/06 16:52:59 binny Exp $
00021  *
00022  */
00023 
00024 #include "ExManagerOutput.h"
00025 
00026 ExManagerOutput::ExManagerOutput(void)
00027 {
00028 Guard(ExManagerOutput::ExManagerOutput(void))
00029 
00030 UnGuard
00031 }
00032 
00033 ExManagerOutput::~ExManagerOutput(void)
00034 {
00035 Guard(ExManagerOutput::~ExManagerOutput(void))
00036 UnGuard
00037 }
00038 
00039 void ExManagerOutput::Reset(void)
00040 {
00041         Init();
00042 }
00043 
00044 void ExManagerOutput::Init(void)
00045 {
00046 Guard(ExManagerOutput::Init(void))
00047         glShadeModel(GL_SMOOTH);                                                        // Enable Smooth Shading
00048         glClearColor(0.0f, 0.0f, 0.0f, 0.5f);                           // Black Background
00049         glClearDepth(1.0f);                                                                     // Depth Buffer Setup
00050         glDepthFunc(GL_LEQUAL);                                                         // The Type Of Depth Testing To Do
00051         glCullFace(GL_BACK);
00052         glEnable(GL_CULL_FACE);
00053         //glEnable(GL_LIGHTING);
00054         glEnable(GL_COLOR_MATERIAL );
00055         glEnable(GL_DEPTH_TEST);
00056         glEnable(GL_AUTO_NORMAL);
00057         glEnable(GL_NORMALIZE);
00058         glEnable(GL_ALPHA_TEST);
00059         glLightModelf(GL_LIGHT_MODEL_TWO_SIDE,GL_FALSE);
00060         glLineWidth(1.5);
00061 UnGuard
00062 }
00063 
00064 void ExManagerOutput::Reshape(int w,int h)
00065 {
00066 Guard(ExManagerOutput::Reshape(int w,int h))
00067         ManagerWindow->SetResolution(w,h);
00068         glMatrixMode(GL_PROJECTION);
00069         glLoadIdentity();
00070         glViewport(0,0,ManagerWindow->GetResolutionX(),ManagerWindow->GetResolutionY());
00071         gluPerspective(ManagerCam->GetCurrentCam()->GetZoom(),
00072                 (1.0f *ManagerWindow->GetResolutionX() / ManagerWindow->GetResolutionY()),
00073                 ManagerCam->GetCurrentCam()->GetClipNear(),
00074                 ManagerCam->GetCurrentCam()->GetClipFar());
00075         glMatrixMode(GL_MODELVIEW);
00076         glLoadIdentity();
00077         ManagerCam->GetCurrentCam()->Draw();
00078 UnGuard
00079 }
00080 
00081 void ExManagerOutput::DrawScene(void)
00082 {
00083 Guard(ExManagerOutput::DrawScene(void))
00084 int plok=0;
00085         plok++;
00086         glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
00087     //0 Command
00088         ManagerCommand->ApplyAction();
00089         //1 Animation
00090         //2 Collision detection
00091         //3 Camera Postion and vue
00092     ManagerCam->Draw(ManagerWindow->GetResolutionX(),ManagerWindow->GetResolutionY());
00093 
00094         if(ManagerWindow->GetMotionBlurState()){ManagerWindow->MotionBlur();}
00095 
00096         //4 Draw Map
00097         ManagerMap->Draw();
00098         //5 Call Pvs to draw object
00099         ManagerPVS->DrawAllObject();
00100         
00101         //6 Draw interface 
00102         if(ManagerWindow->GetInterfaceState()){ManagerInterface->DrawInterface();}
00103         if(ManagerWindow->GetFpsState ()) { ManagerWindow->ShowFps(); }
00104         if(ManagerWindow->GetGrilleState()){glCallList(GRILLE);}
00105         if(ManagerWindow->GetNetstatState()){ManagerWindow->ShowNetStat();}
00106         
00107         
00108         
00109         //7 Draw Spirit
00110         ManagerWindow->Specialeffect();
00111         //8 Draw Menu
00112         //if(ManagerWindow->GetMenuState()){ManagerMenu->DrawMenu();}
00113         //9 Draw console
00114         if(ManagerWindow->GetConsoleState()){ManagerConsole->DrawConsole();}    
00115         glutSwapBuffers();
00116 UnGuard
00117 }
00118 

Généré le Tue Aug 6 20:25:29 2002 pour ExNihilo par doxygen1.2.17