#include <GLApplication.h>
Inheritance diagram for pge::GLApplication:
Public Member Functions | |
GLApplication (int resX, int resY, int bits, bool fullscreen, const std::string &title) | |
virtual | ~GLApplication (void) |
bool | isWindowOpened (void) |
Protected Member Functions | |
void | initCall (void) |
void | reshapeCall (GLsizei width, GLsizei height) |
void | keyDownCall (int key) |
void | keyUpCall (int key) |
void | mousePressCall (int button, int x, int y) |
void | mouseReleaseCall (int button, int x, int y) |
void | mainLoopCall () |
Private Attributes | |
bool | m_windowOK |
|
Definition at line 17 of file GLApplication.cpp. References pge::SDLApplication::getTicks(), isWindowOpened(), m_windowOK, and pge::SDLApplication::openWindow().
00017 { 00018 00019 // Open a window 00020 m_windowOK = openWindow(resX, resY, bits, fullscreen, title); 00021 00022 if(isWindowOpened()) { 00023 00024 // Init OpenGL subsystem directly after opening the window. 00025 renderer::glInit(); 00026 00027 // Core Engine init 00028 CoreEngine::getInstance()->init(this, resX, resY); 00029 00030 } else { 00031 printf("Could not create the window."); 00032 } 00033 00034 #ifdef GLAPP_MAIN_LOOP 00035 m_delay = 15; 00036 m_lastTime = getTicks(); 00037 #endif 00038 } |
Here is the call graph for this function:
|
Definition at line 46 of file GLApplication.cpp.
00046 { 00047 } |
|
Implements pge::SDLApplication. Definition at line 87 of file GLApplication.cpp.
00087 { 00088 CoreEngine::getInstance()->init(); 00089 } |
|
Definition at line 55 of file GLApplication.cpp. References m_windowOK. Referenced by GLApplication().
00055 { 00056 return m_windowOK; 00057 } |
|
Implements pge::SDLApplication. Definition at line 119 of file GLApplication.cpp.
00119 { 00120 InputSystem::getInstance()->keyDown(key); 00121 } |
|
Implements pge::SDLApplication. Definition at line 129 of file GLApplication.cpp.
00129 { 00130 InputSystem::getInstance()->keyUp(key); 00131 } |
|
Implements pge::SDLApplication. Definition at line 171 of file GLApplication.cpp. References pge::SDLApplication::getMousePointer(), pge::SDLApplication::getResolutionHeight(), pge::SDLApplication::getResolutionWidth(), pge::SDLApplication::getTicks(), pge::SDLApplication::MouseCoordinate, pge::SDLApplication::setMousePointer(), pge::SDLApplication::sleep(), and pge::SDLApplication::swapBuffer().
00171 { 00172 00173 #ifdef GLAPP_MAIN_LOOP 00174 00175 unsigned int temp = 0; 00176 MouseCoordinate m; 00177 00178 00179 renderCall(); 00180 // swap the buffer 00181 swapBuffer(); 00182 00183 temp = getTicks(); 00184 // timer 00185 if(temp >= (m_lastTime + m_delay)) { 00186 timerCall(temp - m_lastTime); 00187 00188 // mouse motion 00189 m = getMousePointer(); 00190 mouseMotionCall(temp - m_lastTime, m.x, m.y); 00191 // Set mouse pointer to the middle of the screen. 00192 setMousePointer(getResolutionWidth() / 2, getResolutionHeight() / 2); 00193 00194 m_lastTime = temp; 00195 } 00196 00197 // TODO 00198 sleep(10); 00199 00200 #else 00201 CoreEngine::getInstance()->mainLoop(); 00202 #endif 00203 } |
Here is the call graph for this function:
|
Implements pge::SDLApplication. Definition at line 151 of file GLApplication.cpp.
00151 { 00152 InputSystem::getInstance()->mousePress(button, x, y); 00153 } |
|
Implements pge::SDLApplication. Definition at line 161 of file GLApplication.cpp.
00161 { 00162 InputSystem::getInstance()->mouseRelease(button, x, y); 00163 } |
|
Implements pge::SDLApplication. Definition at line 97 of file GLApplication.cpp.
00097 { 00098 CoreEngine::getInstance()->reshape(width, height); 00099 } |
|
Definition at line 71 of file GLApplication.h. Referenced by GLApplication(), and isWindowOpened(). |