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

Public Member Functions

 Window ()
 
 Window (const char *title, int width=-1, int height=-1, bool resizable=false)
 
 Window (const Window &other)=delete
 
Windowoperator= (const Window &other)=delete
 
bool isOpen () const
 
GLFWwindow * getWindow () const
 
const std::string & getTitle () const
 
int getWidth () const
 
int getHeight () const
 
bool isResizable () const
 
virtual ~Window ()
 
void getFramebufferSize (int &width, int &height) const
 
SwapchainHandle getSwapchainHandle () const
 

Static Public Member Functions

static WindowgetFocusedWindow ()
 
static bool hasOpenWindow ()
 
static void pollEvents ()
 
static const std::vector< std::string > & getExtensions ()
 

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
 

Private Attributes

std::string m_title
 
bool m_resizable
 
bool m_shouldClose
 
GLFWwindow * m_window
 
SwapchainHandle m_swapchainHandle
 
event_handle< int, int > m_resizeHandle
 

Friends

class WindowManager
 
class SwapchainManager
 

Detailed Description

Constructor & Destructor Documentation

◆ Window() [1/3]

vkcv::Window::Window ( )

creates an uninitialized Window

◆ Window() [2/3]

vkcv::Window::Window ( const char *  title,
int  width = -1,
int  height = -1,
bool  resizable = false 
)
explicit

creates a Window with the parameters

Parameters
[in]titletitle of the window
[in]widthwidth of the window (optional)
[in]heightheight of the window (optional)
[in]resizableresize ability of the window (optional)

◆ Window() [3/3]

vkcv::Window::Window ( const Window other)
delete

Copy-constructor of Window

Parameters
otherOther instance of Window

◆ ~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

◆ getExtensions()

const std::vector< std::string > & vkcv::Window::getExtensions ( )
static
Returns

◆ getFocusedWindow()

Window & vkcv::Window::getFocusedWindow ( )
static

gets the currently focused window and returns it only accessible to WindowManager

Returns

◆ getFramebufferSize()

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

destroys the window gets the windows framebuffer size

Parameters
width
height

◆ getHeight()

int vkcv::Window::getHeight ( ) const

gets the window height

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:

◆ getSwapchainHandle()

SwapchainHandle vkcv::Window::getSwapchainHandle ( ) const

gets the SwapchainHandle corresponding to the swapchain of the window

Returns

◆ getTitle()

const std::string & vkcv::Window::getTitle ( ) const

gets the window title

Returns
string with window title

◆ getWidth()

int vkcv::Window::getWidth ( ) const

gets the window width

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

◆ hasOpenWindow()

bool vkcv::Window::hasOpenWindow ( )
static

checks if any GLFWWindows are open

Returns
bool if a window is open

◆ isOpen()

bool vkcv::Window::isOpen ( ) 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

◆ isResizable()

bool vkcv::Window::isResizable ( ) const

is the window resizable

Returns
bool with window resizable

◆ operator=()

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

Copy-operator of Window

Parameters
otherOther instance of Window
Returns
Reference to itself

◆ pollEvents()

void vkcv::Window::pollEvents ( )
static

polls all events on the GLFWwindow

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

Here is the call graph for this function:

Member Data Documentation

◆ e_mouseButton


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