Wasabi
|
#include <WWindowAndInputComponent.hpp>
Public Member Functions | |
WWindowAndInputComponent (class Wasabi *const app) | |
virtual WError | Initialize (int width, int height)=0 |
virtual bool | Loop ()=0 |
virtual void | Cleanup ()=0 |
virtual void * | GetPlatformHandle () const =0 |
virtual void * | GetWindowHandle () const =0 |
virtual VkSurfaceKHR | GetVulkanSurface () const =0 |
virtual void | GetVulkanRequiredExtensions (std::vector< const char * > &extensions)=0 |
virtual void | ShowErrorMessage (std::string error, bool warning=false)=0 |
virtual void | SetWindowTitle (const char *const title) |
virtual void | SetWindowPosition (int x, int y) |
virtual void | SetWindowSize (int width, int height) |
virtual void | MaximizeWindow () |
virtual void | MinimizeWindow () |
virtual uint32_t | RestoreWindow () |
virtual uint32_t | GetWindowWidth (bool framebuffer=true) const |
virtual uint32_t | GetWindowHeight (bool framebuffer=true) const |
virtual int | GetWindowPositionX () const |
virtual int | GetWindowPositionY () const |
virtual void | SetFullScreenState (bool bFullScreen) |
virtual bool | GetFullScreenState () const |
virtual void | SetWindowMinimumSize (int minX, int minY) |
virtual void | SetWindowMaximumSize (int maxX, int maxY) |
virtual bool | MouseClick (W_MOUSEBUTTON button) const =0 |
virtual double | MouseX (W_MOUSEPOSTYPE posT=MOUSEPOS_VIEWPORT, uint32_t vpID=0) const =0 |
virtual double | MouseY (W_MOUSEPOSTYPE posT=MOUSEPOS_VIEWPORT, uint32_t vpID=0) const =0 |
virtual double | MouseZ () const =0 |
virtual bool | MouseInScreen (W_MOUSEPOSTYPE posT=MOUSEPOS_VIEWPORT, uint32_t vpID=0) const =0 |
virtual void | SetMousePosition (double x, double y, W_MOUSEPOSTYPE posT=MOUSEPOS_VIEWPORT)=0 |
virtual void | SetMouseZ (double value)=0 |
virtual void | ShowCursor (bool bShow)=0 |
virtual void | SetCursorMotionMode (bool bEnable)=0 |
virtual void | SetQuitKeys (bool escape=true, bool cmdW=true)=0 |
virtual bool | KeyDown (uint32_t key) const =0 |
virtual void | InsertRawInput (uint32_t key, bool state)=0 |
Protected Attributes | |
class Wasabi * | m_app |
This defines the bare minimum requirements for an window/input component to be usable by Wasabi.
|
pure virtual |
Thus function is called by Wasabi before it exists to allow the window component to cleanup its resources. This function must be implemented by a child class.
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Retrieves the full-screen state of the window, see SetFullScreenState().
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the platform-specific handle needed by Vulkan. For example, on Windows, this must return the HINSTANCE of the application.
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the Vulkan extensions required to run this window manager.
extensions | A vector to be populated with required extensions |
Implemented in WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the Vulkan Surface that can be used to render.
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the platform-specific window handle. For example, on Windows, this must return the HWND created by Initialize().
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Retrieves the height of the client area of the window.
framebuffer | If true, this function retrieves the height of the frame buffer inside the window. Otherwise it returns the height of the window |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Retrieves the x-coordinate of the window on the screen.
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Retrieves the y-coordinate of the window on the screen.
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Retrieves the width of the client area of the window.
framebuffer | If true, this function retrieves the width of the frame buffer inside the window. Otherwise it returns the width of the window |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Initializes the window component if it is not initialized, otherwise it should resize the window (or equivalent surface) to the new size provided. This function must be implemented by a child class to initialize its resources and create/resize the window (or equivalent surface) for rendering.
width | Width of the window to be created/resized to |
height | Height of the window to be created/resized to |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Forcefully sets the state of a key.
key | Key to set |
state | State to set the key to, true being pressed and false being released |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Checks if a key is currently pressed.
key | Key to check |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
This function is called by Wasabi every frame to allow the window component to process any message pump or queue it has. This function must be implemented by a child class to perform any per-frame updates.
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Maximizes the window.
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Minimizes the window.
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Check if a mouse button is clicked.
button | Button to check |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Checks if the cursor is within the coordinate system posT.
posT | Coordinate system to check if the cursor is inside |
vpID | Unused |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the x position of the system cursor.
posT | The coordinate system which the position should be relative to |
vpID | Unused |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the y position of the system cursor.
posT | The coordinate system which the position should be relative to |
vpID | Unused |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Retrieves the current scroll value of the mouse wheel. When the mouse wheel is spun, each tick will increment or decrement this value.
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Restores the window (if it was minimized, it should make it appear).
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Enables or disables cursor motion mode. In motion mode, the cursor is locked in place, hidden, and all mouse input is made to be relative to that locked position
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Sets the screen to full-screen or windowed.
bFullScreen | true to set the window to full-screen mode, false to set it to windowed mode |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Sets the cursor position, relative to the rendering viewport.
x | New mouse position x |
y | New mouse position y |
posT | The coordinate system which the position should be relative to |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Sets the value of the mouse scroll.
value | New value to set |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Enables or disables closing the application when certain keys are pressed
escape | Whether or not to quit when escape is pressed |
cmdW | Whether or not to quit when cmd-W (Mac) is pressed |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Sets the maximum size the window can have.
maxX | Maximum width |
maxY | Maximum height |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Sets the minimum size the window can have.
minX | Minimum width |
minY | Minimum height |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Sets the position of the window on screen.
x | New x-coordinate of the window |
y | New y-coordinate of the window |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Sets the size of the window.
width | New window width |
height | New window height |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
inlinevirtual |
Sets the title of the window.
title | New title for the window |
Reimplemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Shows or hides the mouse cursor.
bShow | Whether to show or hide the cursor |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.
|
pure virtual |
Displays a platform-specific error or warning message.
error | Error message to display |
warning | whether or not to show a warning or error |
Implemented in WWindowsWindowAndInputComponent, and WGLFWWindowAndInputComponent.