#pragma region Copyright /* Toxid Game Copyright (C) 2002-2008 Nuclex Development Labs */ #pragma endregion #ifndef TOXID_UI_UISERVER_H #define TOXID_UI_UISERVER_H #include "Toxid.h" #include "Main.h" #include #include #include namespace Toxid { // ------------------------------------------------------------------------------------------- // namespace { /// Centers a dialog on the screen /// Size of the dialog to be centered /// /// A box describing the positioning and sizing of the centered dialog /// inline Box2 centerDialog(const Point2 &Size) { Point2 Pos = (Point2( Main::getInstance().getVideoDevice()->getDisplayMode().Resolution, StaticCastTag() ) - Size) / 2; return Box2(Pos, Pos + Size); } } // ------------------------------------------------------------------------------------------- // /// Manages the game's user interface class UIServer : public sigc::trackable { /// Initializes a new user interface server public: UIServer(const string &sThemeFile = "Toxid.theme.xml"); // // UIServer implementation // /// Retrieves the currently active screen /// The currently active screen public: const shared_ptr &getScreen() const; /// Switches the active screen /// Other screen to become active public: void setScreen(const shared_ptr &spScreen); /// Lets the user interface server draw the current screen /// Video rendering context to use for drawing /// Audio rendering context to use for audio playback public: void renderFrame( const shared_ptr &spVideoRC, const shared_ptr &spAudioRC ); /// Theme which defines the GUI's look private: GUI::DynamicTheme m_Theme; /// Vertex drawer used to draw the theme private: Video::VertexDrawer m_VertexDrawer; /// Stores the previously active screen private: shared_ptr m_spPreviousScreen; }; // ------------------------------------------------------------------------------------------- // } // namespace Toxid #endif // TOXID_UI_UISERVER_H