1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00
openrw/tests/test_globals.hpp

33 lines
498 B
C++
Raw Normal View History

2013-12-12 11:58:14 +01:00
#ifndef _TESTGLOBABLS_HPP_
#define _TESTGLOBABLS_HPP_
#include <SFML/Window.hpp>
2013-12-20 17:02:46 +01:00
#include <engine/GameWorld.hpp>
2013-12-12 11:58:14 +01:00
// Many tests require OpenGL be functional, seems like a reasonable solution.
class Global
{
public:
sf::Window wnd;
2013-12-20 17:02:46 +01:00
GameWorld* e;
2013-12-12 11:58:14 +01:00
Global() {
wnd.create(sf::VideoMode(640, 360), "Testing");
glewExperimental = GL_TRUE;
glewInit();
2014-02-10 13:09:16 +01:00
e = new GameWorld("test_data");
2013-12-12 11:58:14 +01:00
}
~Global() {
wnd.close();
}
static Global& get()
{
static Global g;
return g;
}
};
#endif