mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-03 02:48:32 -06:00
Remove DummyWindowWrapper and implement default methods into WindowWrapper
This commit is contained in:
@@ -52,46 +52,53 @@ public:
|
||||
/**
|
||||
* This method clears all the rendering windows with the specified \p clearColor. In
|
||||
* most OpenGL cases, this will end up with one or mode <code>glClear</code> calls.
|
||||
* This method defaults to a no-op.
|
||||
* \param clearColor The color with which to clear all windows
|
||||
*/
|
||||
virtual void clearAllWindows(const glm::vec4& clearColor) = 0;
|
||||
virtual void clearAllWindows(const glm::vec4& clearColor);
|
||||
|
||||
/**
|
||||
* Returns whether the current window has been resized recently.
|
||||
* Returns whether the current window has been resized recently. On default, this
|
||||
* method always returns <code>false</code>.
|
||||
* \return <code>true</code> if the current window has been resized recently,
|
||||
* <code>false</code> otherwise
|
||||
*/
|
||||
virtual bool windowHasResized() const = 0;
|
||||
virtual bool windowHasResized() const;
|
||||
|
||||
/**
|
||||
* Returns the average frametime in seconds.
|
||||
* Returns the average frametime in seconds. On default, this method returns
|
||||
* <code>0.0</code>.
|
||||
* \return The average frametime in seconds
|
||||
*/
|
||||
virtual double averageDeltaTime() const = 0;
|
||||
virtual double averageDeltaTime() const;
|
||||
|
||||
/**
|
||||
* Returns the location of the mouse cursor in pixel screen coordinates.
|
||||
* Returns the location of the mouse cursor in pixel screen coordinates. On default,
|
||||
* this method returns <code>0,0</code>.
|
||||
* \return The location of the mouse cursor in pixel screen coordinates
|
||||
*/
|
||||
virtual glm::vec2 mousePosition() const = 0;
|
||||
virtual glm::vec2 mousePosition() const;
|
||||
|
||||
/**
|
||||
* Returns a bitmask of the status of all available mouse buttons. Bit <code>i</code>
|
||||
* is <code>1</code> if mouse button <code>i</code> is pressed down;
|
||||
* <code>false</code> otherwise.
|
||||
* <code>false</code> otherwise. On default, this method returns that none of the
|
||||
* buttons is pressed.
|
||||
* \param maxNumber The maximum number of mouse buttons that should be queried
|
||||
* \return A bitmask showing the status of all mouse buttons (up to \p maxNumber)
|
||||
*/
|
||||
virtual uint32_t mouseButtons(int maxNumber = 8) const = 0;
|
||||
virtual uint32_t mouseButtons(int maxNumber = 8) const;
|
||||
|
||||
/**
|
||||
* Returns the size of the currently active window in pixel coordinates.
|
||||
* Returns the size of the currently active window in pixel coordinates. On default,
|
||||
* this method returns a window size of <code>0,0</code>.
|
||||
* \return The size of the currently active window in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentWindowSize() const = 0;
|
||||
virtual glm::ivec2 currentWindowSize() const;
|
||||
|
||||
/**
|
||||
* Returns the resolution of the currently active window in pixel coordinates.
|
||||
* Returns the resolution of the currently active window in pixel coordinates. On
|
||||
* default, this method returns the same size as #currentWindowSize.
|
||||
* \return The resolution of the currently active window in pixel coordinates
|
||||
*/
|
||||
virtual glm::ivec2 currentWindowResolution() const;
|
||||
@@ -99,23 +106,26 @@ public:
|
||||
/**
|
||||
* Returns <code>true</code> if the current rendering method is regular, i.e., it is
|
||||
* a flat projection without non-linear distortions. Returns <code>false</code> in
|
||||
* other cases, for example fisheye projections.
|
||||
* other cases, for example fisheye projections. On default, this method will return
|
||||
* <code>true</code>.
|
||||
* \return Whether the current rendering method is a regular method
|
||||
*/
|
||||
virtual bool isRegularRendering() const;
|
||||
|
||||
/**
|
||||
* Returns the currently employed view-projection matrix.
|
||||
* Returns the currently employed view-projection matrix. On default, this method will
|
||||
* return the identity matrix.
|
||||
* \return The currently employed view-projection matrix
|
||||
*/
|
||||
virtual glm::mat4 viewProjectionMatrix() const = 0;
|
||||
virtual glm::mat4 viewProjectionMatrix() const;
|
||||
|
||||
/**
|
||||
* Sets the near and far clipping planes of the rendering window.
|
||||
* Sets the near and far clipping planes of the rendering window. This method defaults
|
||||
* to a no-op.
|
||||
* \param near The near clipping plane
|
||||
* \param far The far clipping plane
|
||||
*/
|
||||
virtual void setNearFarClippingPlane(float near, float far) = 0;
|
||||
virtual void setNearFarClippingPlane(float near, float far);
|
||||
|
||||
/**
|
||||
* Returns the location and size of the current viewport (<code>x</code>,
|
||||
@@ -128,29 +138,31 @@ public:
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if there is an external control connected, i.e., an
|
||||
* application that can receive control commands.
|
||||
* application that can receive control commands. On default, this method will return
|
||||
* <code>false</code>.
|
||||
* \return If there is an external control connected
|
||||
*/
|
||||
virtual bool isExternalControlConnected() const;
|
||||
|
||||
/**
|
||||
* Sends a \p message to an external control.
|
||||
* Sends a \p message to an external control. This method defaults to a no-op.
|
||||
* \param message The message to be sent
|
||||
*/
|
||||
virtual void sendMessageToExternalControl(const std::vector<char>& message) const;
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the rendering is a single viewport with an single
|
||||
* window; <code>false</code> otherwise.
|
||||
* window; <code>false</code> otherwise. On default, this method returns
|
||||
* <code>true</code>
|
||||
* \returns <code>true</code> if the rendering is a single viewport with an single
|
||||
* widnow; <code>false</code> otherwise
|
||||
*/
|
||||
virtual bool isSimpleRendering() const;
|
||||
|
||||
/**
|
||||
* Advises the windowing system to take a screenshot.
|
||||
* Advises the windowing system to take a screenshot. This method defaults to a no-op.
|
||||
*/
|
||||
virtual void takeScreenshot() const = 0;
|
||||
virtual void takeScreenshot() const;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user