VkCV Framework  0.0.1
CV Vulkan framework
vkcv::Window Class Reference
Collaboration diagram for vkcv::Window:

Public Member Functions

bool isWindowOpen () const
 
GLFWwindow * getWindow () const
 
Windowoperator= (const Window &other)=delete
 
Windowoperator= (Window &&other)=default
 
int getWidth () const
 
int getHeight () const
 
virtual ~Window ()
 
void getFramebufferSize (int &width, int &height) const
 

Static Public Member Functions

static Window create (const char *windowTitle, int width=-1, int height=-1, bool resizable=false)
 
static void pollEvents ()
 

Public Attributes

event< int, int, int > e_mouseButton
 
event< double, double > e_mouseMove
 
event< double, double > e_mouseScroll
 
event< int, int > e_resize
 
event< int, int, int, int > e_key
 
event< unsigned int > e_char
 
event< int > e_gamepad
 

Protected Member Functions

 Window (GLFWwindow *window)
 

Protected Attributes

GLFWwindow * m_window
 

Static Private Member Functions

static void onMouseMoveEvent (GLFWwindow *window, double x, double y)
 
static void onMouseButtonEvent (GLFWwindow *callbackWindow, int button, int action, int mods)
 
static void onMouseScrollEvent (GLFWwindow *callbackWindow, double xoffset, double yoffset)
 A callback function for handling mouse scrolling events. More...
 
static void onResize (GLFWwindow *callbackWindow, int width, int height)
 
static void onKeyEvent (GLFWwindow *callbackWindow, int key, int scancode, int action, int mods)
 
static void onCharEvent (GLFWwindow *callbackWindow, unsigned int c)
 
static void onGamepadEvent (int gamepadIndex)
 A callback function for gamepad input events. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Window()

vkcv::Window::Window ( GLFWwindow *  window)
explicitprotected
Parameters
GLFWwindowof the class

References onCharEvent(), onKeyEvent(), onMouseButtonEvent(), onMouseMoveEvent(), onMouseScrollEvent(), and onResize().

Here is the call graph for this function:

◆ ~Window()

vkcv::Window::~Window ( )
virtual

Destructor of Window, terminates GLFW

References e_mouseButton, and vkcv::event< T >::unlock().

Here is the call graph for this function:

Member Function Documentation

◆ create()

Window vkcv::Window::create ( const char *  windowTitle,
int  width = -1,
int  height = -1,
bool  resizable = false 
)
static

creates a GLFWwindow with the parameters in the function

Parameters
[in]windowTitleof the window
[in]widthof the window (optional)
[in]heightof the window (optional)
[in]resizableresize ability of the window (optional)
Returns
Window class

◆ getFramebufferSize()

void vkcv::Window::getFramebufferSize ( int &  width,
int &  height 
) const

gets the windows framebuffer size

Parameters
width
height

◆ getHeight()

int vkcv::Window::getHeight ( ) const

gets the window height

Parameters
windowglfwWindow
Returns
int with window height

Referenced by vkcv::camera::CameraManager::addCamera(), vkcv::camera::CameraManager::CameraManager(), and vkcv::camera::CameraManager::mouseMoveCallback().

Here is the caller graph for this function:

◆ getWidth()

int vkcv::Window::getWidth ( ) const

gets the window width

Parameters
windowglfwWindow
Returns
int with window width

Referenced by vkcv::camera::CameraManager::addCamera(), vkcv::camera::CameraManager::CameraManager(), and vkcv::camera::CameraManager::mouseMoveCallback().

Here is the caller graph for this function:

◆ getWindow()

GLFWwindow * vkcv::Window::getWindow ( ) const

◆ isWindowOpen()

bool vkcv::Window::isWindowOpen ( ) const

checks if the window is still open, or the close event was called This function should be changed/removed later on

Returns
bool if the window is still open

◆ onCharEvent()

void vkcv::Window::onCharEvent ( GLFWwindow *  callbackWindow,
unsigned int  c 
)
staticprivate

char callback for any typed character

Parameters
[in]windowThe window that received the event
[in]cThe character that got typed

Referenced by Window().

Here is the caller graph for this function:

◆ onGamepadEvent()

void vkcv::Window::onGamepadEvent ( int  gamepadIndex)
staticprivate

A callback function for gamepad input events.

Parameters
gamepadIndexThe gamepad index.

◆ onKeyEvent()

void vkcv::Window::onKeyEvent ( GLFWwindow *  callbackWindow,
int  key,
int  scancode,
int  action,
int  mods 
)
staticprivate

key callback for the pressed key

Parameters
[in]windowThe window that received the event.
[in]keyThe keyboard key that was pressed or released.
[in]scancodeThe system-specific scancode of the key.
[in]actionGLFW_PRESS, GLFW_RELEASE or GLFW_REPEAT.
[in]modsBit field describing which modifier keys were held down.

Referenced by Window().

Here is the caller graph for this function:

◆ onMouseButtonEvent()

void vkcv::Window::onMouseButtonEvent ( GLFWwindow *  callbackWindow,
int  button,
int  action,
int  mods 
)
staticprivate

mouseButton callback for mouse buttons

Parameters
[in]buttonThe mouse button that was pressed or released.
[in]actionOne of GLFW_PRESS or GLFW_RELEASE. Future releases may add more actions.
[in]modsBit field describing which modifier keys were held down.

References e_mouseButton.

Referenced by Window().

Here is the caller graph for this function:

◆ onMouseMoveEvent()

void vkcv::Window::onMouseMoveEvent ( GLFWwindow *  window,
double  x,
double  y 
)
staticprivate

mouse callback for moving the mouse on the screen

Parameters
[in]windowThe window that received the event.
[in]xposThe new cursor x-coordinate, relative to the left edge of the content area.
[in]yposThe new cursor y-coordinate, relative to the top edge of the content area.

Referenced by Window().

Here is the caller graph for this function:

◆ onMouseScrollEvent()

void vkcv::Window::onMouseScrollEvent ( GLFWwindow *  callbackWindow,
double  xoffset,
double  yoffset 
)
staticprivate

A callback function for handling mouse scrolling events.

Parameters
[in]callbackWindowThe window that received the event.
[in]xoffsetThe extent of horizontal scrolling.
[in]yoffsetThe extent of vertical scrolling.

Referenced by Window().

Here is the caller graph for this function:

◆ onResize()

void vkcv::Window::onResize ( GLFWwindow *  callbackWindow,
int  width,
int  height 
)
staticprivate

resize callback for the resize option of the window

Parameters
[in]windowThe window that was resized.
[in]widthThe new width, in screen coordinates, of the window.
[in]heightThe new height, in screen coordinates, of the window.

Referenced by Window().

Here is the caller graph for this function:

◆ operator=() [1/2]

Window& vkcv::Window::operator= ( const Window other)
delete

Copy-operator of Window is deleted!

Parameters
otherOther instance of Window
Returns
Reference to itself

◆ operator=() [2/2]

Window& vkcv::Window::operator= ( Window &&  other)
default

Move-operator of Window uses default behavior!

Parameters
otherOther instance of Window
Returns
Reference to itself

◆ pollEvents()

void vkcv::Window::pollEvents ( )
static

polls all events on the GLFWwindow

Member Data Documentation

◆ e_mouseButton


The documentation for this class was generated from the following files: