.. index:: pair: class; EE::Window::Engine .. _doxid-class_e_e_1_1_window_1_1_engine: class EE::Window::Engine ======================== .. toctree:: :hidden: Overview ~~~~~~~~ The window management class. Here the engine starts working. (Singleton Class). :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Engine { public: // construction :target:`~Engine`(); // methods :ref:`EE::Window::Window`* :ref:`createWindow`(:ref:`WindowSettings` Settings, :ref:`ContextSettings` Context = :ref:`ContextSettings`()); void :ref:`destroyWindow`(:ref:`EE::Window::Window`* window); :ref:`EE::Window::Window`* :ref:`getCurrentWindow`() const; void :ref:`setCurrentWindow`(:ref:`EE::Window::Window`* window); :ref:`Uint32` :ref:`getWindowCount`() const; bool :ref:`isRunning`() const; bool :ref:`existsWindow`(:ref:`EE::Window::Window`* window); void :target:`forEachWindow`(std::function`*)> cb); :ref:`EE::Window::Window`* :target:`getWindowID`(const :ref:`Uint32`& winID); :ref:`WindowSettings` :ref:`createWindowSettings`(std::string iniPath, std::string iniKeyName = "EEPP"); :ref:`WindowSettings` :ref:`createWindowSettings`(:ref:`IniFile`* ini, std::string iniKeyName = "EEPP"); :ref:`ContextSettings` :ref:`createContextSettings`(std::string iniPath, std::string iniKeyName = "EEPP"); :ref:`ContextSettings` :ref:`createContextSettings`(:ref:`IniFile`* ini, std::string iniKeyName = "EEPP", bool vsyncEnabledByDefault = true); void :ref:`enableSharedGLContext`(); void :ref:`disableSharedGLContext`(); bool :ref:`isSharedGLContextEnabled`(); bool :ref:`isThreaded`(); :ref:`Uint32` :ref:`getMainThreadId`(); bool :ref:`isMainThread`() const; :ref:`PlatformHelper`* :ref:`getPlatformHelper`(); :ref:`DisplayManager`* :ref:`getDisplayManager`(); bool :ref:`openURI`(const std::string& url); static bool :target:`isEngineRunning`(); static bool :target:`isRunninMainThread`(); }; .. _details-class_e_e_1_1_window_1_1_engine: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ The window management class. Here the engine starts working. (Singleton Class). Methods ------- .. index:: pair: function; createWindow .. _doxid-class_e_e_1_1_window_1_1_engine_1ad151935cfee2f87f9652be8e5ea8ea49: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE::Window::Window`* createWindow(:ref:`WindowSettings` Settings, :ref:`ContextSettings` Context = :ref:`ContextSettings`()) Creates a new window. .. index:: pair: function; destroyWindow .. _doxid-class_e_e_1_1_window_1_1_engine_1a4b5c1c1e2866c18e394b7a2c069ba2de: .. ref-code-block:: cpp :class: doxyrest-title-code-block void destroyWindow(:ref:`EE::Window::Window`* window) Destroy the window instance, and set as current other window running ( if any ). This function is only useful for multi-window environment. Avoid using it with one window context. .. index:: pair: function; getCurrentWindow .. _doxid-class_e_e_1_1_window_1_1_engine_1a2ae305b0ee63ba8176da7717e41ebe6b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`EE::Window::Window`* getCurrentWindow() const .. rubric:: Returns: The current :ref:`Window ` context. .. index:: pair: function; setCurrentWindow .. _doxid-class_e_e_1_1_window_1_1_engine_1af527f1ee0a9e3a241541276ffe1b33ea: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setCurrentWindow(:ref:`EE::Window::Window`* window) Set the window as the current. .. index:: pair: function; getWindowCount .. _doxid-class_e_e_1_1_window_1_1_engine_1a8c766341387edbed729fd9d03f82e8cf: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Uint32` getWindowCount() const .. rubric:: Returns: The number of windows created. .. index:: pair: function; isRunning .. _doxid-class_e_e_1_1_window_1_1_engine_1a3ae62b8a2ea1fef6f7c8457e24d77943: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isRunning() const .. rubric:: Returns: If any window is created. .. index:: pair: function; existsWindow .. _doxid-class_e_e_1_1_window_1_1_engine_1a7402c70ceef226f9906bd007e2e9cb5b: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool existsWindow(:ref:`EE::Window::Window`* window) .. rubric:: Returns: If the window instance is inside the window list. .. index:: pair: function; createWindowSettings .. _doxid-class_e_e_1_1_window_1_1_engine_1a88e7c85fe481f85f98932cba2abe056a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`WindowSettings` createWindowSettings(std::string iniPath, std::string iniKeyName = "EEPP") Constructs :ref:`WindowSettings ` from an ini file It will search for the following properties: Width :ref:`Window ` width Height :ref:`Window ` height BitColor 32,16,8 Windowed bool Resizeable bool Backend SDL2 WinIcon The path to the window icon WinTitle The window default title .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - iniPath - The ini file path * - iniKeyName - The ini key name to search the properties .. index:: pair: function; createWindowSettings .. _doxid-class_e_e_1_1_window_1_1_engine_1add8f33838c71a54364993b659d9f8292: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`WindowSettings` createWindowSettings(:ref:`IniFile`* ini, std::string iniKeyName = "EEPP") Constructs :ref:`WindowSettings ` from an ini file instance It will search for the following properties: Width :ref:`Window ` width Height :ref:`Window ` height BitColor 32,16,8 Windowed bool Resizeable bool Backend SDL2 WinIcon The path to the window icon WinTitle The window default title .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - ini - The ini file instance * - iniKeyName - The ini key name to search the properties .. index:: pair: function; createContextSettings .. _doxid-class_e_e_1_1_window_1_1_engine_1a875c701e94c608571d1bacc18ffb7a1a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ContextSettings` createContextSettings(std::string iniPath, std::string iniKeyName = "EEPP") Constructs :ref:`ContextSettings ` from an ini file It will search for the following properties: VSync bool GLVersion Selects the default renderer: 2 for OpenGL 2, 3 for OpenGL 3, 4 for OpenGL ES 2 DoubleBuffering bool DepthBufferSize int StencilBufferSize int .. code-block:: cpp @param iniPath The ini file path @param iniKeyName The ini key name to search the properties .. index:: pair: function; createContextSettings .. _doxid-class_e_e_1_1_window_1_1_engine_1a606986c454ad845242fab98a1cd2531e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`ContextSettings` createContextSettings(:ref:`IniFile`* ini, std::string iniKeyName = "EEPP", bool vsyncEnabledByDefault = true) Constructs :ref:`ContextSettings ` from an ini file instance It will search for the following properties: VSync bool GLVersion Selects the default renderer: 2 for OpenGL 2, 3 for OpenGL 3, 4 for OpenGL ES 2 DoubleBuffering bool DepthBufferSize int StencilBufferSize int .. code-block:: cpp @param ini The ini file instance @param iniKeyName The ini key name to search the properties .. index:: pair: function; enableSharedGLContext .. _doxid-class_e_e_1_1_window_1_1_engine_1a6987628f7360eb932490aa7c15ae814f: .. ref-code-block:: cpp :class: doxyrest-title-code-block void enableSharedGLContext() Enabling Shared GL Context allows asynchronous OpenGL resource loading ( only if is supported by the backend and the OS, SDL 2 backend is the only one supported ). \* If the TextureLoader is threaded, will upload the texture in another thread to the GPU. So, it will not block the main rendering thread. \* Shared GL Context is disabled by default. .. index:: pair: function; disableSharedGLContext .. _doxid-class_e_e_1_1_window_1_1_engine_1ab26a7cd717ebfca7e320cd754fd48ec9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void disableSharedGLContext() Disable the Shared GL Context .. rubric:: See also: :ref:`enableSharedGLContext() ` .. index:: pair: function; isSharedGLContextEnabled .. _doxid-class_e_e_1_1_window_1_1_engine_1a94dc62d53776fdec049dca6c5c7890ad: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isSharedGLContextEnabled() .. rubric:: Returns: If the Shared GL Context is enabled and ready to use. .. index:: pair: function; isThreaded .. _doxid-class_e_e_1_1_window_1_1_engine_1a7c744b94daeef7a48516874e844a03ef: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isThreaded() .. rubric:: Returns: Indicates if the current running platform/OS supports threads (always true except for emscripten) .. index:: pair: function; getMainThreadId .. _doxid-class_e_e_1_1_window_1_1_engine_1a979985bf7d8fdaf1332f501d083008ff: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Uint32` getMainThreadId() .. rubric:: Returns: The id of the thread that was used to initialize the OpenGL Context. .. index:: pair: function; isMainThread .. _doxid-class_e_e_1_1_window_1_1_engine_1a8dc3c97496471ab1f742d03a01cf6a13: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isMainThread() const .. rubric:: Returns: True if the current thread is the main thread. .. index:: pair: function; getPlatformHelper .. _doxid-class_e_e_1_1_window_1_1_engine_1a3512f7d6b4b0aa896768f6e6e67a1489: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`PlatformHelper`* getPlatformHelper() .. rubric:: Returns: The instance of platform class that provides some helpers for some platforms .. index:: pair: function; getDisplayManager .. _doxid-class_e_e_1_1_window_1_1_engine_1a92c5281755186ff4a713ad843b611556: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`DisplayManager`* getDisplayManager() .. rubric:: Returns: The display manager. Holds the physical displays information. .. index:: pair: function; openURI .. _doxid-class_e_e_1_1_window_1_1_engine_1ada47c24a464c96f12feedeea9ca32c9c: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool openURI(const std::string& url) Open a URL in a separate, system-provided application. .. rubric:: Returns: true if success