VulkanEngine 0.1
Graphics engine using Vulkan
Loading...
Searching...
No Matches
VulkanEngine::GLFWWindow Class Reference

An implementation of VulkanEngine::Window which uses the GLFW library. More...

#include <GLFWWindow.h>

Inheritance diagram for VulkanEngine::GLFWWindow:
VulkanEngine::Window

Public Member Functions

 GLFWWindow (int _width, int _height, const std::string &_title, bool _full_screen)
 
virtual ~GLFWWindow ()
 Desctructor.
 
virtual bool initialize (bool invisible=false)
 
virtual void update ()
 Do anything needed to update the window.
 
virtual const std::vector< const char * > getRequiredVulkanInstanceExtensions () const
 
virtual bool shouldClose ()
 
virtual void setWidth (uint32_t _width)
 
virtual void setHeight (uint32_t _height)
 
virtual void setTitle (const std::string &new_title)
 
virtual vk::SurfaceKHR getVkSurface ()
 
- Public Member Functions inherited from VulkanEngine::Window
 Window (uint32_t _width, uint32_t _height, const std::string &_title, bool _full_screen)
 
 ~Window ()
 Desctructor.
 
virtual bool initialize (bool invisible=false)=0
 
virtual const std::vector< const char * > getRequiredVulkanInstanceExtensions () const =0
 
virtual vk::SurfaceKHR getVkSurface ()=0
 
virtual std::shared_ptr< MouseInputgetMouseInput () const
 Get a MouseInfo instance which retrieves values from this Window instance.
 
virtual std::shared_ptr< KeyboardInputgetKeyboardInput () const
 Get keyboard input instance for this window.
 
virtual void update ()=0
 Do anything needed to update the window.
 
virtual bool shouldClose ()=0
 
virtual void setWidth (uint32_t _width)
 
virtual void setHeight (uint32_t _height)
 
virtual void setTitle (const std::string &new_title)
 
uint32_t getWidth () const
 
uint32_t getHeight () const
 
uint32_t getFramebufferWidth () const
 
uint32_t getFramebufferHeight () const
 
const std::string & getTitle () const
 
bool isFullScreen () const
 
bool sizeHasChanged () const
 

Additional Inherited Members

- Protected Member Functions inherited from VulkanEngine::Window
void mousePositionCallback (double xpos, double ypos)
 
void mouseScrollCallback (double xoffset, double yoffset)
 
void mouseButtonPressedCallback (bool left_pressed, bool right_pressed, bool middle_pressed)
 Callback which gets the current status of mouse buttons.
 
void keyboardButtonPressedCallback (int scancode, const KeyboardInput::KeyInfo &key_info)
 
- Protected Attributes inherited from VulkanEngine::Window
uint32_t width
 The current width of the window.
 
uint32_t height
 The current height of the window.
 
uint32_t framebuffer_width
 The width of the window's framebuffer.
 
uint32_t framebuffer_height
 The height of the window's framebuffer.
 
std::string title
 The title of the window.
 
bool full_screen
 Whether or not the window is set to full screen.
 
bool size_changed
 
std::shared_ptr< MouseInputmouse_input
 The MouseInput instance connected to this Window.
 
std::shared_ptr< KeyboardInputkeyboard_input
 The KeyboardInput instance connect to this Window.
 

Detailed Description

An implementation of VulkanEngine::Window which uses the GLFW library.

Constructor & Destructor Documentation

◆ GLFWWindow()

VulkanEngine::GLFWWindow::GLFWWindow ( int  _width,
int  _height,
const std::string &  _title,
bool  _full_screen 
)

Contructor.

Parameters
_widthThe desired initial width of the window.
_heightThe desired initial height of the window.
_titleThe title of the window.
_full_screenIf true the window will be initialized to full screen.

Member Function Documentation

◆ getRequiredVulkanInstanceExtensions()

const std::vector< const char * > VulkanEngine::GLFWWindow::getRequiredVulkanInstanceExtensions ( ) const
virtual
Returns
The required vulkan extensions for using GLFW.

Implements VulkanEngine::Window.

◆ getVkSurface()

vk::SurfaceKHR VulkanEngine::GLFWWindow::getVkSurface ( )
virtual

Get the Vulkan surface defined for this window.

Returns
The vk::SurfaceKHR.

Implements VulkanEngine::Window.

◆ initialize()

bool VulkanEngine::GLFWWindow::initialize ( bool  invisible = false)
virtual

Initialize the window.

Parameters
invisibleIf set to true the window will be invisible.
Returns
True if initialization succeded without error.

Implements VulkanEngine::Window.

◆ setHeight()

void VulkanEngine::GLFWWindow::setHeight ( uint32_t  _height)
virtual

Sets the height of the window.

Parameters
_heightThe height value to set.

Reimplemented from VulkanEngine::Window.

◆ setTitle()

void VulkanEngine::GLFWWindow::setTitle ( const std::string &  new_title)
virtual

Set window title.

Parameters
new_titleThe new window title.

Reimplemented from VulkanEngine::Window.

◆ setWidth()

void VulkanEngine::GLFWWindow::setWidth ( uint32_t  _width)
virtual

Sets the width of the window.

Parameters
_widthThe width value to set.

Reimplemented from VulkanEngine::Window.

◆ shouldClose()

bool VulkanEngine::GLFWWindow::shouldClose ( )
virtual
Returns
True if the window should close.

Implements VulkanEngine::Window.

◆ update()

void VulkanEngine::GLFWWindow::update ( )
virtual

Do anything needed to update the window.

Implements VulkanEngine::Window.


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