2 Copyright (C) 2009 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef _GAMEENGINE_H_
23 #define _GAMEENGINE_H_
25 //#include "core/Config.h"
29 #if defined(_MSC_VER) || defined(_WINDOWS_) || defined(_WIN32)
33 #define usleep(x) Sleep(x/1000)
39 * \brief Namespace which holds all the classes of the engine
44 * \brief Main game engine class. Calls the other parts of the engine.
50 * \brief Returns pointer to the GameEngine class.
52 * \return Pointer to the game engine
54 static GameEngine
*get(void);
57 * \brief Initializes the other parts of the engine and starts the game.
59 * Returns when the engine has been closed.
60 * \param root Path to the data of the game
61 * \return Returns false if there have been errors, else returns true.
63 bool run(std::string root
);
66 * \brief Stops the game forcefully at the next frame
71 * \brief Sets the root directory.
73 * Do not use this function!
75 void setRootDirectory(std::string dir
);
77 * \brief Returns the root directory specified by run().
79 * \return Engine's root directory
81 std::string
getRootDirectory(void);