Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

MainApp Class Reference

#include <Main.h>

Inherits OpenGLApp.

Inheritance diagram for MainApp:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 MainApp ()
virtual ~MainApp ()
bool initialize ()
bool deInitialize ()
bool load ()
bool unload ()
bool drawFrame ()
bool update ()
void drawLoading (float percent=0.0f)
void handleChar (char ch)
void keyDown (unsigned int key)

Private Attributes

SoundMedia soundMedia
unsigned int m_currentScene
Scenem_currScene
Scenem_sceneMenu
Scenem_sceneDemo
Scenem_scenePlay
Scenem_sceneJoin
Scenem_sceneScores

Detailed Description

Definition at line 20 of file Main.h.


Constructor & Destructor Documentation

MainApp::MainApp  ) 
 

Definition at line 26 of file DeFacto/Main.cpp.

References g_selectedScene, m_currentScene, m_currScene, m_sceneDemo, m_sceneJoin, m_sceneMenu, m_scenePlay, m_sceneScores, SCENE_MENU, and SCENE_UNDEFINED.

MainApp::~MainApp  )  [virtual]
 

Definition at line 45 of file DeFacto/Main.cpp.


Member Function Documentation

bool MainApp::deInitialize  )  [virtual]
 

Reimplemented from Application.

Definition at line 175 of file DeFacto/Main.cpp.

References SoundMedia::deInitialize(), Gne::disconnect(), Gne::isRunning(), LOG_NEWLINE, LOG_SUCCESS, m_currScene, m_sceneDemo, m_sceneJoin, m_sceneMenu, m_scenePlay, m_sceneScores, and soundMedia.

Here is the call graph for this function:

bool MainApp::drawFrame  )  [virtual]
 

Reimplemented from Application.

Definition at line 51 of file DeFacto/Main.cpp.

References Application::defaultFont, OpenGLConsole::draw(), Scene::drawFrame(), OpenGLFont::endTextMode(), OpenGLApp::flush(), g_fps, g_fullscreen, g_showFPS, g_time, m_currentScene, m_currScene, OpenGLFont::print(), SCENE_DEMO, OpenGLFont::setColor(), and OpenGLFont::startTextMode().

Here is the call graph for this function:

void MainApp::drawLoading float  percent = 0.0f  ) 
 

renderer->setMask(COLOR); renderer->setDepthFunc(DEPTH_NONE); renderer->setTextures(m_texLoading); renderer->setBlending(ONE, ONE); renderer->apply();

glPushAttrib(GL_LIGHTING_BIT); { glDisable(GL_LIGHTING);

glBegin(GL_QUADS); glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0, 1); glVertex2f(0.0f, 0.0f);

glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0, 0); glVertex2f(0.0f, (float)g_height);

glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1, 0); glVertex2f((float)g_width, (float)g_height);

glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1, 1); glVertex2f((float)g_width, 0.0f); glEnd();

} glPopAttrib();

Definition at line 284 of file DeFacto/Main.cpp.

References Application::defaultFont, OpenGLFont::endTextMode(), OpenGLApp::flush(), g_height, g_width, OpenGLFont::print(), OpenGLFont::setColor(), and OpenGLFont::startTextMode().

Referenced by update().

Here is the call graph for this function:

void MainApp::handleChar char  ch  )  [virtual]
 

Reimplemented from Application.

Definition at line 328 of file DeFacto/Main.cpp.

References g_console, Console::handleChar(), m_currentScene, m_currScene, and SCENE_MENU.

Here is the call graph for this function:

bool MainApp::initialize  )  [virtual]
 

Reimplemented from Application.

Definition at line 152 of file DeFacto/Main.cpp.

References Application::camera, SoundMedia::initialize(), LOG_NEWLINE, LOG_SUCCESS, m_sceneDemo, m_sceneJoin, m_sceneMenu, m_scenePlay, m_sceneScores, Camera::setPosition(), and soundMedia.

Here is the call graph for this function:

void MainApp::keyDown unsigned int  key  )  [virtual]
 

case '1': g_selectedScene = SCENE_SELECTPROFILE; break;

case '2': g_selectedScene = SCENE_MENU; break;

case '3': g_selectedScene = SCENE_CREATE; break;

case '4': g_selectedScene = SCENE_JOIN; break;

case '5': g_selectedScene = SCENE_PLAY; break;

case '6': g_selectedScene = SCENE_SCORES; break;

Reimplemented from Application.

Definition at line 338 of file DeFacto/Main.cpp.

References g_console, g_drawConsole, Console::handleKey(), Application::setKey(), and Application::toggleFullscreen().

Here is the call graph for this function:

bool MainApp::load  )  [virtual]
 

Reimplemented from Application.

Definition at line 211 of file DeFacto/Main.cpp.

References Application::defaultFont, g_fullscreen, GL_ARB_fragment_shader_supported, GL_ARB_shader_objects_supported, GL_ARB_vertex_shader_supported, OpenGLApp::hDC, LF_SHADING, Scene::load(), Music::load(), Renderer::lock(), LOG_ERROR, LOG_NEWLINE, LOG_SUCCESS, m_currScene, Application::renderer, and Application::showCursor().

Here is the call graph for this function:

bool MainApp::unload  )  [virtual]
 

Reimplemented from Application.

Definition at line 259 of file DeFacto/Main.cpp.

References Application::defaultFont, LOG_NEWLINE, LOG_SUCCESS, m_sceneDemo, m_sceneJoin, m_sceneMenu, m_scenePlay, m_sceneScores, Music::stop(), Music::unload(), and Scene::unload().

Here is the call graph for this function:

bool MainApp::update  )  [virtual]
 

Vec3 clr; if (msg.playerid == 0) clr = Vec3(1.0f, 0.0f, 0.0f); else if (msg.playerid == 1) clr = Vec3(0.0f, 1.0f, 0.0f); else clr = Vec3(0.0f, 0.0f, 1.0f);

Reimplemented from Application.

Definition at line 84 of file DeFacto/Main.cpp.

References Console::addEx(), SPlayer::chatClr, drawLoading(), g_selectedScene, Player::getName(), Gne::getNextMessage(), Gne::getPlayerById(), Gne::isMessagePending(), Gne::isRunning(), Scene::load(), m_currentScene, m_currScene, m_sceneDemo, m_sceneJoin, m_sceneMenu, m_scenePlay, m_sceneScores, msgstruct::msg, msgstruct::playerid, SCENE_DEMO, SCENE_JOIN, SCENE_MENU, SCENE_PLAY, SCENE_SCORES, Scene::unload(), Scene::update(), Vec4::x, Vec3::x, Vec4::y, Vec3::y, Vec4::z, and Vec3::z.

Here is the call graph for this function:


Member Data Documentation

unsigned int MainApp::m_currentScene [private]
 

Definition at line 38 of file Main.h.

Referenced by drawFrame(), handleChar(), MainApp(), and update().

Scene* MainApp::m_currScene [private]
 

Definition at line 40 of file Main.h.

Referenced by deInitialize(), drawFrame(), handleChar(), load(), MainApp(), and update().

Scene* MainApp::m_sceneDemo [private]
 

Definition at line 42 of file Main.h.

Referenced by deInitialize(), initialize(), MainApp(), unload(), and update().

Scene* MainApp::m_sceneJoin [private]
 

Definition at line 44 of file Main.h.

Referenced by deInitialize(), initialize(), MainApp(), unload(), and update().

Scene* MainApp::m_sceneMenu [private]
 

Definition at line 41 of file Main.h.

Referenced by deInitialize(), initialize(), MainApp(), unload(), and update().

Scene* MainApp::m_scenePlay [private]
 

Definition at line 43 of file Main.h.

Referenced by deInitialize(), initialize(), MainApp(), unload(), and update().

Scene* MainApp::m_sceneScores [private]
 

Definition at line 45 of file Main.h.

Referenced by deInitialize(), initialize(), MainApp(), unload(), and update().

SoundMedia MainApp::soundMedia [private]
 

Definition at line 37 of file Main.h.

Referenced by deInitialize(), and initialize().


Generated on Sun Jun 5 15:50:02 2005 for Defacto by  doxygen 1.4.3