2014-12-15 16:47:30 +01:00
|
|
|
/*
|
|
|
|
* =====================================================================================
|
|
|
|
*
|
|
|
|
* Filename: Application.cpp
|
|
|
|
*
|
2018-06-05 01:24:54 +02:00
|
|
|
* Description:
|
2014-12-15 16:47:30 +01:00
|
|
|
*
|
|
|
|
* Created: 14/12/2014 05:09:21
|
|
|
|
*
|
2018-06-12 09:24:43 +02:00
|
|
|
* Author: Quentin Bazin, <quent42340@gmail.com>
|
2014-12-15 16:47:30 +01:00
|
|
|
*
|
|
|
|
* =====================================================================================
|
|
|
|
*/
|
|
|
|
#include "Application.hpp"
|
|
|
|
#include "Config.hpp"
|
2015-07-17 17:08:53 +02:00
|
|
|
#include "Mouse.hpp"
|
2018-06-21 00:55:38 +02:00
|
|
|
|
2018-06-21 05:45:17 +02:00
|
|
|
#include "TextureLoader.hpp"
|
|
|
|
|
2018-06-21 00:55:38 +02:00
|
|
|
#include "GameState.hpp"
|
2014-12-15 16:47:30 +01:00
|
|
|
|
2018-06-14 02:38:02 +02:00
|
|
|
void Application::init() {
|
|
|
|
CoreApplication::init();
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2018-06-14 02:38:02 +02:00
|
|
|
createWindow(SCREEN_WIDTH, SCREEN_HEIGHT, APP_NAME);
|
2014-12-18 07:02:48 +01:00
|
|
|
m_window.setVerticalSyncEnabled(true);
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2018-06-21 00:55:38 +02:00
|
|
|
Mouse::setCursorVisible(false);
|
|
|
|
Mouse::setCursorGrabbed(true);
|
|
|
|
|
2018-06-21 05:45:17 +02:00
|
|
|
m_resourceHandler.loadConfigFile<TextureLoader>("resources/config/textures.xml");
|
2018-06-05 01:24:54 +02:00
|
|
|
|
2018-06-23 23:05:36 +02:00
|
|
|
Registry::setInstance(m_registry);
|
2018-12-20 02:51:30 +01:00
|
|
|
m_scriptEngine.init();
|
2018-06-23 23:05:36 +02:00
|
|
|
|
2018-06-14 02:38:02 +02:00
|
|
|
m_stateStack.push<GameState>();
|
2015-07-17 17:08:53 +02:00
|
|
|
}
|
|
|
|
|