.. index:: pair: class; EE::Window::Window .. _doxid-class_e_e_1_1_window_1_1_window: class EE::Window::Window ======================== .. toctree:: :hidden: enum_EE_Window_Window_MessageBoxType.rst class_EE_Window_Window_FrameData.rst Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Window { public: // typedefs typedef std::function :target:`WindowResizeCallback`; typedef std::function :target:`WindowRequestCloseCallback`; typedef std::function :target:`WindowQuitCallback`; // enums enum :ref:`MessageBoxType`; // classes class :ref:`FrameData`; // construction :target:`Window`(:ref:`WindowSettings` Settings, :ref:`ContextSettings` Context, :ref:`Clipboard`* Clipboard, :ref:`Input`* Input, :ref:`CursorManager`* CursorManager); virtual :target:`~Window`(); // methods virtual bool :ref:`create`(:ref:`WindowSettings` Settings, :ref:`ContextSettings` Context) = 0; virtual void :ref:`makeCurrent`() = 0; virtual :ref:`Uint32` :target:`getWindowID`() = 0; virtual void :ref:`toggleFullscreen`() = 0; virtual void :ref:`setTitle`(const std::string& title) = 0; virtual std::string :ref:`getTitle`(); virtual bool :ref:`setIcon`(const std::string& path) = 0; virtual void :ref:`minimize`(); virtual void :ref:`maximize`(); virtual bool :ref:`isMaximized`(); virtual void :ref:`hide`(); virtual void :ref:`raise`(); virtual void :ref:`flash`(:ref:`WindowFlashOperation` op); virtual void :ref:`show`(); virtual void :ref:`setPosition`(int Left, int Top); virtual :ref:`Vector2i` :ref:`getPosition`(); virtual void :ref:`setDefaultContext`(); virtual bool :ref:`isActive`() = 0; virtual bool :ref:`isVisible`() = 0; virtual bool :ref:`hasFocus`() = 0; virtual bool :ref:`hasInputFocus`() = 0; virtual bool :ref:`hasMouseFocus`() = 0; virtual void :ref:`setSize`(:ref:`Uint32` Width, :ref:`Uint32` Height); virtual void :ref:`setSize`(:ref:`Uint32` Width, :ref:`Uint32` Height, bool isWindowed) = 0; virtual :ref:`Sizei` :ref:`getSize`(); :ref:`Vector2f` :ref:`getCenter`(); virtual std::vector<:ref:`DisplayMode`> :ref:`getDisplayModes`() const = 0; virtual void :ref:`setGamma`(:ref:`Float` Red, :ref:`Float` Green, :ref:`Float` Blue) = 0; virtual void :ref:`setCurrentContext`(:ref:`eeWindowContex` Context); virtual :ref:`eeWindowContex` :ref:`getContext`() const; virtual :ref:`eeWindowHandle` :ref:`getWindowHandler`() = 0; virtual void :ref:`clear`(); virtual void :ref:`display`(bool clear = false); virtual const :ref:`System::Time`& :ref:`getElapsed`() const; virtual :ref:`Uint32` :ref:`getFPS`() const; virtual bool :ref:`isWindowed`() const; virtual bool :ref:`isResizeable`() const; virtual const :ref:`Uint32`& :ref:`getWidth`() const; virtual const :ref:`Uint32`& :ref:`getHeight`() const; virtual const :ref:`Sizei`& :ref:`getDesktopResolution`(); virtual void :ref:`centerToDisplay`(); virtual :ref:`Rect` :ref:`getBorderSize`(); virtual :ref:`Float` :ref:`getScale`(); bool :ref:`isRunning`() const; bool :ref:`isOpen`() const; virtual void :ref:`close`(); void :ref:`setView`(const :ref:`View`& view, bool forceRefresh = false); const :ref:`View`& :ref:`getView`() const; const :ref:`View`& :ref:`getDefaultView`() const; void :ref:`setup2D`(const bool& KeepView = true); void :ref:`set2DProjection`(const :ref:`Uint32`& Width, const :ref:`Uint32`& Height); void :ref:`setProjection`(const :ref:`Transform`& transform); void :ref:`setViewport`(const :ref:`Int32`& x, const :ref:`Int32`& y, const :ref:`Uint32`& Width, const :ref:`Uint32`& Height); :ref:`Rect` :ref:`getViewport`(const :ref:`View`& view); void :ref:`setClearColor`(const :ref:`RGB`& Color); :ref:`RGB` :ref:`getClearColor`() const; bool :ref:`takeScreenshot`(std::string filepath = "", const :ref:`Image::SaveType`& Format = Image::SaveType::SAVE_TYPE_PNG); const :ref:`WindowInfo`* :ref:`getWindowInfo`() const; void :ref:`setFrameRateLimit`(const :ref:`Uint32`& setFrameRateLimit); :ref:`Uint32` :ref:`getFrameRateLimit`(); :ref:`Clipboard`* :ref:`getClipboard`() const; :ref:`Input`* :ref:`getInput`() const; :ref:`CursorManager`* :ref:`getCursorManager`() const; :ref:`Uint32` :ref:`pushResizeCallback`(const :ref:`WindowResizeCallback`& cb); void :ref:`popResizeCallback`(const :ref:`Uint32`& CallbackId); virtual void :ref:`startOnScreenKeyboard`(); virtual void :ref:`stopOnScreenKeyboard`(); virtual bool :ref:`isOnScreenKeyboardActive`() const; virtual void :ref:`startTextInput`(); virtual bool :ref:`isTextInputActive`() const; virtual void :ref:`stopTextInput`(); virtual void :ref:`setTextInputRect`(const :ref:`Rect`& rect); virtual void :ref:`clearComposition`(); virtual bool :ref:`hasScreenKeyboardSupport`(); virtual bool :ref:`isScreenKeyboardShown`(); virtual bool :ref:`isThreadedGLContext`(); virtual void :ref:`setGLContextThread`(); virtual void :ref:`unsetGLContextThread`(); void :ref:`runMainLoop`(std::function func, int fps = -1); virtual int :ref:`getCurrentDisplayIndex`(); :ref:`Vector2f` :target:`mapPixelToCoords`(const :ref:`Vector2i`& point); :ref:`Vector2f` :target:`mapPixelToCoords`(const :ref:`Vector2i`& point, const :ref:`View`& view); :ref:`Vector2i` :target:`mapCoordsToPixel`(const :ref:`Vector2f`& point); :ref:`Vector2i` :target:`mapCoordsToPixel`(const :ref:`Vector2f`& point, const :ref:`View`& view); void :target:`setCloseRequestCallback`(const :ref:`WindowRequestCloseCallback`& closeRequestCallback); void :target:`setQuitCallback`(const :ref:`WindowQuitCallback`& quitCallback); const :ref:`System::Time`& :ref:`getSleepTimePerSecond`() const; const :ref:`System::Time`& :ref:`getRenderTimePerSecond`() const; const :ref:`Sizei`& :ref:`getLastWindowedSize`() const; virtual bool :ref:`hasNativeMessageBox`() const; virtual bool :ref:`showMessageBox`(const :ref:`MessageBoxType`& type, const std::string& title, const std::string& message); :ref:`InputMethod`& :target:`getIME`(); const std::function& :target:`getMainLoop`(); }; .. _details-class_e_e_1_1_window_1_1_window: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Methods ------- .. index:: pair: function; create .. _doxid-class_e_e_1_1_window_1_1_window_1a0953e28f8f30f6d9cc21b9551369874f: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool create(:ref:`WindowSettings` Settings, :ref:`ContextSettings` Context) = 0 Creates a new window and GL context .. index:: pair: function; makeCurrent .. _doxid-class_e_e_1_1_window_1_1_window_1af47eeb09cd1899373755778b45298db5: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void makeCurrent() = 0 Bind the OpenGL context to the current window .. index:: pair: function; toggleFullscreen .. _doxid-class_e_e_1_1_window_1_1_window_1a753f38d0783b5a93b72d8a9541384b01: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void toggleFullscreen() = 0 Toogle the screen to Fullscreen, if it's in fullscreen toogle to windowed mode. .. index:: pair: function; setTitle .. _doxid-class_e_e_1_1_window_1_1_window_1a677e116739aaf581975bbda7a2d8123d: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setTitle(const std::string& title) = 0 Set the window title .. index:: pair: function; getTitle .. _doxid-class_e_e_1_1_window_1_1_window_1a0dcf177a1c8e273ef5f1023001056077: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::string getTitle() .. rubric:: Returns: The window title .. index:: pair: function; setIcon .. _doxid-class_e_e_1_1_window_1_1_window_1af4c817bcf11abd24871c906f96db0d11: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool setIcon(const std::string& path) = 0 Set the :ref:`Window ` icon .. index:: pair: function; minimize .. _doxid-class_e_e_1_1_window_1_1_window_1ae9cf3e95fb9971898ea16ec5819bc41f: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void minimize() This will attempt to iconify/minimize the window. .. index:: pair: function; maximize .. _doxid-class_e_e_1_1_window_1_1_window_1a845992480d225bee92399c39a24ff87b: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void maximize() Maximize the :ref:`Window ` .. index:: pair: function; isMaximized .. _doxid-class_e_e_1_1_window_1_1_window_1abb175cfe4b94cbebcef1b616b746c4b0: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isMaximized() .. rubric:: Returns: true if the window is maximized .. index:: pair: function; hide .. _doxid-class_e_e_1_1_window_1_1_window_1ae4efba31aaeb749e2713da723a771b68: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void hide() This will attempt to hide the window .. index:: pair: function; raise .. _doxid-class_e_e_1_1_window_1_1_window_1a5cf60524f7fcb0243cd6820db0b4d930: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void raise() This will attempt to raise the window .. index:: pair: function; flash .. _doxid-class_e_e_1_1_window_1_1_window_1a66020a85a9d36be12ae2b41e7134de4a: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void flash(:ref:`WindowFlashOperation` op) Request a window to demand attention from the user. .. index:: pair: function; show .. _doxid-class_e_e_1_1_window_1_1_window_1a74b052f1a4f1e8b5ce126422ab6d7a0c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void show() This will attempt to show the window .. index:: pair: function; setPosition .. _doxid-class_e_e_1_1_window_1_1_window_1aecddce049fdd84dcaea42d1072d8a642: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setPosition(int Left, int Top) This will attemp to move the window over the desktop to the position .. index:: pair: function; getPosition .. _doxid-class_e_e_1_1_window_1_1_window_1a6f2b3a919ddb2c482cde72ce24f37409: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Vector2i` getPosition() .. rubric:: Returns: The Current :ref:`Window ` Position .. index:: pair: function; setDefaultContext .. _doxid-class_e_e_1_1_window_1_1_window_1ac0dbd1f396e10c431193178a94ed92b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setDefaultContext() Set as current context the default context ( the context used for the window creation ) .. index:: pair: function; isActive .. _doxid-class_e_e_1_1_window_1_1_window_1aa22d25fcd77802098b7e5165ebe75a0c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isActive() = 0 .. rubric:: Returns: If the current window is active. This means that the window :ref:`hasInputFocus() ` and :ref:`hasMouseFocus() `. .. index:: pair: function; isVisible .. _doxid-class_e_e_1_1_window_1_1_window_1a1e50fa60022dd348b07d623583ee4ffa: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isVisible() = 0 .. rubric:: Returns: If the current window is visible .. index:: pair: function; hasFocus .. _doxid-class_e_e_1_1_window_1_1_window_1a8fe6e3b13e4bd8e8b355ed79bba04780: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool hasFocus() = 0 .. rubric:: Returns: If the current window has focus (same as :ref:`hasInputFocus() ` or(||) :ref:`hasMouseFocus() `) .. index:: pair: function; hasInputFocus .. _doxid-class_e_e_1_1_window_1_1_window_1a36a20cf9de13fdb05952e1894e0774de: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool hasInputFocus() = 0 .. rubric:: Returns: If the current window has input focus .. index:: pair: function; hasMouseFocus .. _doxid-class_e_e_1_1_window_1_1_window_1abc7770fcd529b5a2819496673ad12e88: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool hasMouseFocus() = 0 .. rubric:: Returns: If the current window has input focus .. index:: pair: function; setSize .. _doxid-class_e_e_1_1_window_1_1_window_1a113facd2e23bbf459e15fc398f63b443: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setSize(:ref:`Uint32` Width, :ref:`Uint32` Height) Set the size of the window for a windowed window .. index:: pair: function; setSize .. _doxid-class_e_e_1_1_window_1_1_window_1af4c994edab22de832b2624cb80651753: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setSize(:ref:`Uint32` Width, :ref:`Uint32` Height, bool isWindowed) = 0 Change the window size or the screen resolution .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - Width - New screen width * - Height - New screen height * - isWindowed - Windowed or Fullscreen .. index:: pair: function; getSize .. _doxid-class_e_e_1_1_window_1_1_window_1ac255e4ad84e4444a41803fc54d3e4324: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Sizei` getSize() .. rubric:: Returns: The window size .. index:: pair: function; getCenter .. _doxid-class_e_e_1_1_window_1_1_window_1ad8b34e84c9d170cd01b4a32673bd0229: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Vector2f` getCenter() .. rubric:: Returns: The window center point .. index:: pair: function; getDisplayModes .. _doxid-class_e_e_1_1_window_1_1_window_1a4fadda2fa13081b41f3388fcdf7125ed: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual std::vector<:ref:`DisplayMode`> getDisplayModes() const = 0 .. rubric:: Returns: The resolutions that support the video card .. index:: pair: function; setGamma .. _doxid-class_e_e_1_1_window_1_1_window_1ac613bfc30ed41dadd2090c79473f71fb: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setGamma(:ref:`Float` Red, :ref:`Float` Green, :ref:`Float` Blue) = 0 Set the Screen Gamma. Default is (1,1,1). Accept values between 0.1 and 10. .. index:: pair: function; setCurrentContext .. _doxid-class_e_e_1_1_window_1_1_window_1a5ddd8d4cd822b3f5fcd56d30c95ba1fd: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setCurrentContext(:ref:`eeWindowContex` Context) The the OpenGL context as the current context .. index:: pair: function; getContext .. _doxid-class_e_e_1_1_window_1_1_window_1ac61a046af20012ed683c3639b292e322: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`eeWindowContex` getContext() const .. rubric:: Returns: The current OpenGL context .. index:: pair: function; getWindowHandler .. _doxid-class_e_e_1_1_window_1_1_window_1a89cab06b588f980d4d351c3d067167fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`eeWindowHandle` getWindowHandler() = 0 .. rubric:: Returns: The window handler .. index:: pair: function; clear .. _doxid-class_e_e_1_1_window_1_1_window_1a698268fa34c9194c33e559139ad8db8e: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void clear() Clear the window back buffer This function is usually called once every frame, to clear the previous frame content. .. index:: pair: function; display .. _doxid-class_e_e_1_1_window_1_1_window_1a76fbdc6db694cd092f5bb965a4c72fdf: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void display(bool clear = false) Render the :ref:`Scene ` to Screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - clear - Clear after swapping buffers? It will not work if the target platform is Emscripten. Since there's no swap buffers. .. index:: pair: function; getElapsed .. _doxid-class_e_e_1_1_window_1_1_window_1a031832677d03084fa2166a1a53ed30a2: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const :ref:`System::Time`& getElapsed() const .. rubric:: Returns: The elapsed time for the last frame rendered .. index:: pair: function; getFPS .. _doxid-class_e_e_1_1_window_1_1_window_1a70020e73b414dd629e6491d02a72fd26: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Uint32` getFPS() const .. rubric:: Returns: The current frames per second of the screen .. index:: pair: function; isWindowed .. _doxid-class_e_e_1_1_window_1_1_window_1aa43d03d58a47e80c564583e94e9aeb61: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isWindowed() const .. rubric:: Returns: If the screen is windowed .. index:: pair: function; isResizeable .. _doxid-class_e_e_1_1_window_1_1_window_1aa37ea7a4cd1c07a2c539211941dc2ce1: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isResizeable() const .. rubric:: Returns: If the main window is resizeable .. index:: pair: function; getWidth .. _doxid-class_e_e_1_1_window_1_1_window_1a998f12aa808b841e0e3babe3b892c51f: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const :ref:`Uint32`& getWidth() const .. rubric:: Returns: The :ref:`Window ` Width .. index:: pair: function; getHeight .. _doxid-class_e_e_1_1_window_1_1_window_1ad3930eeb242a3ff5e6e8e3330a2d8032: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const :ref:`Uint32`& getHeight() const .. rubric:: Returns: The :ref:`Window ` Height .. index:: pair: function; getDesktopResolution .. _doxid-class_e_e_1_1_window_1_1_window_1aeb04d38a637f6b79b8f15c534530e487: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual const :ref:`Sizei`& getDesktopResolution() .. rubric:: Returns: The current desktop resolution .. index:: pair: function; centerToDisplay .. _doxid-class_e_e_1_1_window_1_1_window_1ad381a1146b7d6eac88382af5da020bca: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void centerToDisplay() Center the window to the desktop ( if windowed ) .. index:: pair: function; getBorderSize .. _doxid-class_e_e_1_1_window_1_1_window_1a168e6e8cba7981fb35d889544ae1142a: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Rect` getBorderSize() .. rubric:: Returns: The window borders size .. index:: pair: function; getScale .. _doxid-class_e_e_1_1_window_1_1_window_1ac4faccf1d80d0ce822ededd1940f5686: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual :ref:`Float` getScale() .. rubric:: Returns: The size of the pixel in screen coordinates. This is the device scale factor. .. index:: pair: function; isRunning .. _doxid-class_e_e_1_1_window_1_1_window_1ac3cf51799e98b989cc3e9f4233e364bc: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isRunning() const .. rubric:: Returns: If the aplication is running returns true ( If you Init correctly the window and is running ). .. index:: pair: function; isOpen .. _doxid-class_e_e_1_1_window_1_1_window_1a1d85b87a87afe4da50705e8704ad599d: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isOpen() const .. rubric:: Returns: If the window was created .. index:: pair: function; close .. _doxid-class_e_e_1_1_window_1_1_window_1a758a66c7c45b96018ebaf8e8bfc1c221: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void close() Close the window if is running .. index:: pair: function; setView .. _doxid-class_e_e_1_1_window_1_1_window_1ac0df92af47fa10c008b4164fc4b88e08: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setView(const :ref:`View`& view, bool forceRefresh = false) Set the current active view .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - view - New view to use (pass GetDefaultView() to set the default view) * - forceRefresh - Forces the view refresh even if is the same as the last one. .. index:: pair: function; getView .. _doxid-class_e_e_1_1_window_1_1_window_1a5b72363073aac5c1f2345dd4c93742e5: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`View`& getView() const Get the current view .. index:: pair: function; getDefaultView .. _doxid-class_e_e_1_1_window_1_1_window_1a1bb340c916b47e5e795957f3db0a2721: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`View`& getDefaultView() const Get the default view of the window .. index:: pair: function; setup2D .. _doxid-class_e_e_1_1_window_1_1_window_1ac2b8e8ef306f2e65f9ebdfe68d005a0e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setup2D(const bool& KeepView = true) This will set the default rendering states and view to render in 2D mode .. index:: pair: function; set2DProjection .. _doxid-class_e_e_1_1_window_1_1_window_1acec2d52bfc00698d474167614fb63deb: .. ref-code-block:: cpp :class: doxyrest-title-code-block void set2DProjection(const :ref:`Uint32`& Width, const :ref:`Uint32`& Height) Set a new 2D projection matrix .. index:: pair: function; setProjection .. _doxid-class_e_e_1_1_window_1_1_window_1acf545046dd6e19b809ea44d4e6147afd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setProjection(const :ref:`Transform`& transform) Set a new projection matrix .. index:: pair: function; setViewport .. _doxid-class_e_e_1_1_window_1_1_window_1a04bdf156110a4f6bcc05e24cae02e822: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setViewport(const :ref:`Int32`& x, const :ref:`Int32`& y, const :ref:`Uint32`& Width, const :ref:`Uint32`& Height) Set the current Viewport ( and creates a new ortho proyection if needed ) .. index:: pair: function; getViewport .. _doxid-class_e_e_1_1_window_1_1_window_1a9783b2fe9f2c633ca28810bf372c8430: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Rect` getViewport(const :ref:`View`& view) .. rubric:: Returns: The viewport in pixels of the view .. index:: pair: function; setClearColor .. _doxid-class_e_e_1_1_window_1_1_window_1aedc5a8dd34fcf237b200cb4f28257833: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setClearColor(const :ref:`RGB`& Color) Set the window background color .. index:: pair: function; getClearColor .. _doxid-class_e_e_1_1_window_1_1_window_1abccb60ba3d638487a05f44a421f6bdc7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`RGB` getClearColor() const .. rubric:: Returns: The background clear color .. index:: pair: function; takeScreenshot .. _doxid-class_e_e_1_1_window_1_1_window_1a5386638af8e7ba22a6a260af87405b63: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool takeScreenshot(std::string filepath = "", const :ref:`Image::SaveType`& Format = Image::SaveType::SAVE_TYPE_PNG) Captures the window front buffer and saves it to disk. You have to call it before :ref:`Display `, and after render all the objects. If the file path is empty will save the files like 0001.bmp, and will check if the file exists, otherwise will create 0002.bmp, and so on... You can set only the path to save the files, like "screenshots/" .. rubric:: Returns: False if failed, otherwise returns True .. index:: pair: function; getWindowInfo .. _doxid-class_e_e_1_1_window_1_1_window_1a98ae1946e031a385d9373cf63f1c38f4: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`WindowInfo`* getWindowInfo() const .. rubric:: Returns: The pointer to the :ref:`Window ` Info ( read only ) .. index:: pair: function; setFrameRateLimit .. _doxid-class_e_e_1_1_window_1_1_window_1a68f3e4d9e973d2f9dc7c40a0366f6926: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFrameRateLimit(const :ref:`Uint32`& setFrameRateLimit) Set a frame per second limit. It's not 100 % accurate. .. index:: pair: function; getFrameRateLimit .. _doxid-class_e_e_1_1_window_1_1_window_1a6554b2d922064dc3939f165b17ad4b64: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Uint32` getFrameRateLimit() Get a frame per second limit. .. index:: pair: function; getClipboard .. _doxid-class_e_e_1_1_window_1_1_window_1a4711713732ec3721d0f48d6885a76877: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Clipboard`* getClipboard() const .. rubric:: Returns: The clipboard manager .. index:: pair: function; getInput .. _doxid-class_e_e_1_1_window_1_1_window_1a2a46f19428a15a88c0f6cc4770f974aa: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Input`* getInput() const .. rubric:: Returns: The input manager .. index:: pair: function; getCursorManager .. _doxid-class_e_e_1_1_window_1_1_window_1a6fc89ca2a9300c6b8cbf5d7bca17ff18: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`CursorManager`* getCursorManager() const .. rubric:: Returns: The cursor manager .. index:: pair: function; pushResizeCallback .. _doxid-class_e_e_1_1_window_1_1_window_1adb8d4e85aa5cb2cb07580e15697e36c6: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Uint32` pushResizeCallback(const :ref:`WindowResizeCallback`& cb) Push a new window resize callback. .. rubric:: Returns: The Callback Id .. index:: pair: function; popResizeCallback .. _doxid-class_e_e_1_1_window_1_1_window_1a5546a290cebb82fceefe8b0ed8667ed9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void popResizeCallback(const :ref:`Uint32`& CallbackId) Pop the callback id indicated. .. index:: pair: function; startOnScreenKeyboard .. _doxid-class_e_e_1_1_window_1_1_window_1ac49182e90cc4781207bbd0b173a15ab2: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void startOnScreenKeyboard() Show the on-screen keyboard if supported. .. index:: pair: function; stopOnScreenKeyboard .. _doxid-class_e_e_1_1_window_1_1_window_1a118ac72990fcd1b0530193e3d7a066a6: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void stopOnScreenKeyboard() Hide the on-screen keyboard if supported. .. index:: pair: function; isOnScreenKeyboardActive .. _doxid-class_e_e_1_1_window_1_1_window_1ac2d124988b15823472824218a6e17170: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isOnScreenKeyboardActive() const .. rubric:: Returns: True if on-screen keyboard is active. .. index:: pair: function; startTextInput .. _doxid-class_e_e_1_1_window_1_1_window_1a43cf351ec695c4ebb3da0092730c21e3: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void startTextInput() Start accepting Unicode text input events. .. rubric:: See also: :ref:`stopTextInput() ` :ref:`setTextInputRect() ` :ref:`hasScreenKeyboardSupport() ` .. index:: pair: function; isTextInputActive .. _doxid-class_e_e_1_1_window_1_1_window_1aaaf4d2587d447f10bf8c18c08205f2e4: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isTextInputActive() const Return whether or not Unicode text input events are enabled. .. rubric:: See also: :ref:`startTextInput() ` :ref:`stopTextInput() ` .. index:: pair: function; stopTextInput .. _doxid-class_e_e_1_1_window_1_1_window_1aded4fb34dc9370c0e0500fd6c624780a: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void stopTextInput() Stop receiving any text input events. .. rubric:: See also: :ref:`startTextInput() ` :ref:`hasScreenKeyboardSupport() ` .. index:: pair: function; setTextInputRect .. _doxid-class_e_e_1_1_window_1_1_window_1ac76b7930b338b6499bc46f5583999c49: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setTextInputRect(const :ref:`Rect`& rect) Set the rectangle used to type Unicode text inputs. This is used as a hint for IME and on-screen keyboard placement. .. rubric:: See also: :ref:`startTextInput() ` .. index:: pair: function; clearComposition .. _doxid-class_e_e_1_1_window_1_1_window_1a36ef2fd8d0bd4a4ee56760f180c8250d: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void clearComposition() Dismiss the composition window/IME without disabling the subsystem. .. rubric:: See also: :ref:`startTextInput ` :ref:`stopTextInput ` .. index:: pair: function; hasScreenKeyboardSupport .. _doxid-class_e_e_1_1_window_1_1_window_1a85120564d5fa03570e96005bc0d33126: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool hasScreenKeyboardSupport() Returns whether the platform has some screen keyboard support. .. note:: Not all screen keyboard functions are supported on all platforms. .. rubric:: Returns: true if some keyboard support is available else false. .. rubric:: See also: :ref:`isScreenKeyboardShown() ` .. index:: pair: function; isScreenKeyboardShown .. _doxid-class_e_e_1_1_window_1_1_window_1a90a51d181c7e518ce3c6568f90462cf3: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isScreenKeyboardShown() Returns whether the screen keyboard is shown for given window. .. rubric:: Returns: true if screen keyboard is shown else false. .. rubric:: See also: :ref:`hasScreenKeyboardSupport() ` .. index:: pair: function; isThreadedGLContext .. _doxid-class_e_e_1_1_window_1_1_window_1ac07dba9041baf068b92e3f8fe21a869c: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool isThreadedGLContext() .. rubric:: Returns: True if the current window support a threaded GL Context. This means that supports OpenGL Shared Contexts ( multithreaded opengl contexts ). \* Only supported with SDL2 backend. .. index:: pair: function; setGLContextThread .. _doxid-class_e_e_1_1_window_1_1_window_1a21b6262b4dc55897d69abec6685c893a: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void setGLContextThread() Activates the shared GL context in the current thread. .. index:: pair: function; unsetGLContextThread .. _doxid-class_e_e_1_1_window_1_1_window_1a47bad78439f6ca25df81b9f250c9d361: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual void unsetGLContextThread() Deactviates the shared GL context in the current thread. .. index:: pair: function; runMainLoop .. _doxid-class_e_e_1_1_window_1_1_window_1ab702b44229596ad6921a8688a8665ca8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void runMainLoop(std::function func, int fps = -1) Runs the main loop function passed as parameter .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - func - The main loop function * - fps - The desired FPS ( 0 = infinite, < 0 keep current setting ) .. index:: pair: function; getCurrentDisplayIndex .. _doxid-class_e_e_1_1_window_1_1_window_1aed26cbe67282f20b82bb066861c3028e: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual int getCurrentDisplayIndex() .. rubric:: Returns: The current display index. .. index:: pair: function; getSleepTimePerSecond .. _doxid-class_e_e_1_1_window_1_1_window_1ae363f40d0bbef1597d466c699af8a675: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`System::Time`& getSleepTimePerSecond() const In case of a frame rate limit is set, this will return the time spent sleeping per second. .. index:: pair: function; getRenderTimePerSecond .. _doxid-class_e_e_1_1_window_1_1_window_1ad2b006b51361301bfcd1397d8bbe6479: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`System::Time`& getRenderTimePerSecond() const In case of a frame rate limit is set, this will return the time spent doing work/rendering per second. .. index:: pair: function; getLastWindowedSize .. _doxid-class_e_e_1_1_window_1_1_window_1a8c982b69ad74c5fa795995a55c9e80c6: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Sizei`& getLastWindowedSize() const .. rubric:: Returns: The last windowed size of the window .. index:: pair: function; hasNativeMessageBox .. _doxid-class_e_e_1_1_window_1_1_window_1a6c23743c91b1d3804b6cd15d37f95e1b: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool hasNativeMessageBox() const .. rubric:: Returns: True if implements native message boxes .. index:: pair: function; showMessageBox .. _doxid-class_e_e_1_1_window_1_1_window_1ad8b69375332f7f2933eece7cb4477ec0: .. ref-code-block:: cpp :class: doxyrest-title-code-block virtual bool showMessageBox(const :ref:`MessageBoxType`& type, const std::string& title, const std::string& message) Shows a native message box. .. rubric:: Returns: True if message box was shown