#include <App.hpp>
Collaboration diagram for BARE2D::App:Public Member Functions | |
| App () | |
| ~App () | |
| void | run () |
| Runs the program! Starts the update-draw loop. More... | |
| ScreenList * | getScreenList () |
| Returns the screen list, where the program can add more screens, set entry points, etc. More... | |
| Window * | getWindow () |
| InputManager * | getInputManager () |
Private Member Functions | |
| void | init () |
| Initializes the applet and engine. Creates a window, held within this App. Only for internal use. More... | |
| void | update (double dt) |
| Updates input, output, etc. Only for internal use. More... | |
| void | draw () |
| Draws the current screen, based on that screen's drawing protocol. More... | |
| void | updateInput () |
| Updates any input, and throws it down the pipeline! More... | |
| void | pollSDLInput () |
| Polls inputs from SDL and updates the inputmanager as appropriate. More... | |
| void | exitApp () |
| Calls the screen's exit function, and then cleans this class up for destruction. More... | |
Private Attributes | |
| bool | m_isGameRunning = false |
| bool | m_isInited = false |
| std::unique_ptr< ScreenList > | m_screenList |
| InputManager * | m_inputManager = nullptr |
| Timer * | m_timer = nullptr |
| Window * | m_window = nullptr |
| BARE2D::App::App | ( | ) |
| BARE2D::App::~App | ( | ) |
Definition at line 19 of file App.cpp.
References exitApp(), m_inputManager, m_isGameRunning, m_screenList, m_timer, and m_window.
Here is the call graph for this function:
|
private |
Draws the current screen, based on that screen's drawing protocol.
Definition at line 130 of file App.cpp.
References BARE2D::Window::getHeight(), BARE2D::Window::getWidth(), m_screenList, m_window, and BARE2D::RUNNING.
Referenced by run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Calls the screen's exit function, and then cleans this class up for destruction.
Definition at line 179 of file App.cpp.
References m_isGameRunning.
Referenced by pollSDLInput(), update(), and ~App().
Here is the caller graph for this function:| InputManager * BARE2D::App::getInputManager | ( | ) |
| ScreenList * BARE2D::App::getScreenList | ( | ) |
Returns the screen list, where the program can add more screens, set entry points, etc.
Definition at line 68 of file App.cpp.
References m_screenList.
| Window * BARE2D::App::getWindow | ( | ) |
|
private |
Initializes the applet and engine. Creates a window, held within this App. Only for internal use.
Definition at line 80 of file App.cpp.
References BARE2D::Window::create(), BARE2D::DOUBLE_INIT, BARE2D::init(), m_inputManager, m_isInited, m_screenList, m_timer, m_window, BARE2D::Timer::setDeltaTimeLimit(), and BARE2D::throwFatalError().
Referenced by App(), and run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Polls inputs from SDL and updates the inputmanager as appropriate.
Definition at line 145 of file App.cpp.
References exitApp(), BARE2D::BARECEGUI::getContext(), BARE2D::BARECEGUI::getInstance(), BARE2D::BARECEGUI::handleSDLEvent(), m_inputManager, BARE2D::InputManager::pressKey(), BARE2D::InputManager::releaseKey(), BARE2D::InputManager::setMousePosition(), and BARE2D::InputManager::setMouseScrollwheelPosition().
Referenced by updateInput().
Here is the call graph for this function:
Here is the caller graph for this function:| void BARE2D::App::run | ( | ) |
Runs the program! Starts the update-draw loop.
Definition at line 29 of file App.cpp.
References draw(), BARE2D::Timer::endTimer(), BARE2D::Timer::getDeltaTime(), init(), BARE2D::initGLErrorCallback(), BARE2D::Timer::integrateFrame(), BARE2D::LOW, m_isGameRunning, m_isInited, m_screenList, m_timer, m_window, BARE2D::Timer::startTimer(), BARE2D::Window::swapBuffer(), and update().
Here is the call graph for this function:
|
private |
Updates input, output, etc. Only for internal use.
Definition at line 109 of file App.cpp.
References BARE2D::CHANGE_NEXT, BARE2D::CHANGE_PREV, BARE2D::EXIT_APPLICATION, exitApp(), m_screenList, BARE2D::RUNNING, and updateInput().
Referenced by run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Updates any input, and throws it down the pipeline!
Definition at line 139 of file App.cpp.
References m_inputManager, pollSDLInput(), and BARE2D::InputManager::update().
Referenced by update().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 51 of file App.hpp.
Referenced by getInputManager(), init(), pollSDLInput(), updateInput(), and ~App().
|
private |
|
private |
|
private |
|
private |
|
private |