Lugdunum  0.1.0
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lug::Graphics::Vulkan::Render::Window Class Referencefinal

#include <Window.hpp>

Inheritance diagram for lug::Graphics::Vulkan::Render::Window:
[legend]
Collaboration diagram for lug::Graphics::Vulkan::Render::Window:
[legend]

Classes

struct  AcquireImageData
 
struct  FrameData
 

Public Member Functions

 Window ()=delete
 
 Window (lug::Graphics::Vulkan::Renderer &renderer)
 
 Window (const Window &)=delete
 
 Window (Window &&)=delete
 
Windowoperator= (const Window &)=delete
 
Windowoperator= (Window &&)=delete
 
 ~Window ()
 
bool pollEvent (lug::Window::Event &) override
 Checks if an event is available from the window implementation, and fill it in the event parameter. More...
 
bool beginFrame (const lug::System::Time &elapsedTime) override final
 
bool endFrame () override final
 
const API::SwapchaingetSwapchain () const
 
::lug::Graphics::Render::ViewcreateView (::lug::Graphics::Render::View::InitInfo &initInfo) override final
 
bool render () override final
 
uint16_t getWidth () const override final
 
uint16_t getHeight () const override final
 
bool initRender ()
 
void destroyRender ()
 
bool initGui ()
 
- Public Member Functions inherited from lug::Graphics::Render::Window
 Window ()=default
 
 Window (const Window &)=delete
 
 Window (Window &&)=delete
 
Windowoperator= (const Window &)=delete
 
Windowoperator= (Window &&)=delete
 
- Public Member Functions inherited from lug::Window::Window
 Window (const Window &)=delete
 
 Window (Window &&)=delete
 
Windowoperator= (const Window &)=delete
 
Windowoperator= (Window &&)=delete
 
bool isOpen () const
 Determines if the window is open. More...
 
void close ()
 Close the window gracefully. More...
 
void setKeyRepeat (bool state)
 Enables or disables key repeat. More...
 
bool isKeyPressed (Keyboard::Key key) const
 Determines if a key pressed. More...
 
bool isMousePressed (Mouse::Button button) const
 Determines if a mouse button pressed. More...
 
const Math::Vec2i & getMousePos () const
 Retrieves the mouses position. More...
 
void setMousePos (const Math::Vec2i &mousePosition)
 Sets the mouse position. More...
 
Math::Vec2i getWindowSize () const
 Gets the window size. More...
 
void setMouseCursorVisible (bool visible)
 Sets the visibility of the mouse cursor (hide/show) More...
 
- Public Member Functions inherited from lug::Graphics::Render::Target
 Target ()=default
 
 Target (const Target &)=delete
 
 Target (Target &&)=delete
 
Targetoperator= (const Target &)=delete
 
Targetoperator= (Target &&)=delete
 
virtual ~Target ()=default
 
virtual ViewcreateView (View::InitInfo &initInfo)=0
 
const std::vector< std::unique_ptr< View > > & getRenderViews () const
 
std::vector< std::unique_ptr< View > > & getRenderViews ()
 

Static Public Member Functions

static std::unique_ptr< Windowcreate (lug::Graphics::Vulkan::Renderer &renderer, Window::InitInfo &initInfo)
 
- Static Public Member Functions inherited from lug::Window::Window
static std::unique_ptr< Windowcreate (const InitInfo &initInfo)
 Utility to create a window. More...
 

Private Member Functions

bool init (Window::InitInfo &initInfo)
 
bool initSurface ()
 
bool initSwapchainCapabilities ()
 
bool initPresentQueue ()
 
bool initSwapchain ()
 
bool initFramesData ()
 
bool buildBeginCommandBuffer ()
 
bool buildEndCommandBuffer ()
 
bool buildCommandBuffers ()
 

Private Attributes

InitInfo _initInfo
 
lug::Graphics::Vulkan::Renderer_renderer
 
API::Surface _surface {}
 
API::Swapchain _swapchain {}
 
const API::Queue_presentQueue {nullptr}
 
const API::QueueFamily_presentQueueFamily {nullptr}
 
uint32_t _currentImageIndex {0}
 
std::vector< FrameData_framesData
 
std::vector< AcquireImageData_acquireImageDatas
 
API::CommandPool _commandPool {}
 
lug::Graphics::Vulkan::Gui _guiInstance
 
bool _isGuiInitialized
 

Additional Inherited Members

- Public Attributes inherited from lug::Window::Window
GamePadEvent _gamePadState {{0.0f, 0.0f}, {0.0f, 0.0f}}
 
TouchScreenEvent _touchScreenState {{{0, 0}, {0, 0}}, lug::Window::TouchScreenEvent::GestureState::None, false, false, false}
 
- Protected Member Functions inherited from lug::Window::Window
 Window ()
 
bool init (const InitInfo &initInfo)
 
void initKeyState ()
 Inits every key in _keyState to false. More...
 
void initMouseState ()
 Inits every button in _mouseState to false. More...
 
- Protected Attributes inherited from lug::Window::Window
priv::WindowImpl_impl {nullptr}
 
VideoMode _mode {800, 600, 8, 8, 8, 60}
 
std::unordered_map< Keyboard::Key, bool > _keyState
 
std::unordered_map< Mouse::Button, bool > _mouseState
 
Math::Vec2i _mousePosition {0, 0}
 
- Protected Attributes inherited from lug::Graphics::Render::Target
std::vector< std::unique_ptr< View > > _renderViews
 

Detailed Description

Definition at line 26 of file Window.hpp.

Constructor & Destructor Documentation

◆ Window() [1/4]

lug::Graphics::Vulkan::Render::Window::Window ( )
delete

◆ Window() [2/4]

lug::Graphics::Vulkan::Render::Window::Window ( lug::Graphics::Vulkan::Renderer renderer)

Definition at line 27 of file Window.cpp.

◆ Window() [3/4]

lug::Graphics::Vulkan::Render::Window::Window ( const Window )
delete

◆ Window() [4/4]

lug::Graphics::Vulkan::Render::Window::Window ( Window &&  )
delete

◆ ~Window()

lug::Graphics::Vulkan::Render::Window::~Window ( )
virtual

Reimplemented from lug::Graphics::Render::Window.

Definition at line 29 of file Window.cpp.

Member Function Documentation

◆ operator=() [1/2]

Window& lug::Graphics::Vulkan::Render::Window::operator= ( const Window )
delete

◆ operator=() [2/2]

Window& lug::Graphics::Vulkan::Render::Window::operator= ( Window &&  )
delete

◆ pollEvent()

bool lug::Graphics::Vulkan::Render::Window::pollEvent ( lug::Window::Event event)
overridevirtual

Checks if an event is available from the window implementation, and fill it in the event parameter.

Parameters
[out]eventEvent input, to be filled by pollEvent.
Returns
True if an event was polled, false otherwise.

Reimplemented from lug::Window::Window.

Definition at line 33 of file Window.cpp.

◆ beginFrame()

bool lug::Graphics::Vulkan::Render::Window::beginFrame ( const lug::System::Time elapsedTime)
finaloverridevirtual

Implements lug::Graphics::Render::Window.

Definition at line 58 of file Window.cpp.

◆ endFrame()

bool lug::Graphics::Vulkan::Render::Window::endFrame ( )
finaloverridevirtual

Implements lug::Graphics::Render::Window.

Definition at line 128 of file Window.cpp.

◆ getSwapchain()

const API::Swapchain & Window::getSwapchain ( ) const
inline

Definition at line 1 of file Window.inl.

◆ createView()

lug::Graphics::Render::View * lug::Graphics::Vulkan::Render::Window::createView ( ::lug::Graphics::Render::View::InitInfo initInfo)
finaloverride

Definition at line 172 of file Window.cpp.

◆ render()

bool lug::Graphics::Vulkan::Render::Window::render ( )
finaloverridevirtual

Implements lug::Graphics::Render::Target.

Definition at line 184 of file Window.cpp.

◆ getWidth()

uint16_t Window::getWidth ( ) const
inlinefinaloverridevirtual

Implements lug::Graphics::Render::Target.

Definition at line 5 of file Window.inl.

◆ getHeight()

uint16_t Window::getHeight ( ) const
inlinefinaloverridevirtual

Implements lug::Graphics::Render::Target.

Definition at line 9 of file Window.inl.

◆ create()

std::unique_ptr< Window > lug::Graphics::Vulkan::Render::Window::create ( lug::Graphics::Vulkan::Renderer renderer,
Window::InitInfo initInfo 
)
static

Definition at line 199 of file Window.cpp.

◆ initRender()

bool lug::Graphics::Vulkan::Render::Window::initRender ( )

Definition at line 625 of file Window.cpp.

◆ destroyRender()

void lug::Graphics::Vulkan::Render::Window::destroyRender ( )

Definition at line 639 of file Window.cpp.

◆ initGui()

bool lug::Graphics::Vulkan::Render::Window::initGui ( )

Definition at line 284 of file Window.cpp.

◆ init()

bool lug::Graphics::Vulkan::Render::Window::init ( Window::InitInfo initInfo)
private

Definition at line 584 of file Window.cpp.

◆ initSurface()

bool lug::Graphics::Vulkan::Render::Window::initSurface ( )
private

Init surface

Returns
Success

Definition at line 213 of file Window.cpp.

◆ initSwapchainCapabilities()

bool lug::Graphics::Vulkan::Render::Window::initSwapchainCapabilities ( )
private

Definition at line 233 of file Window.cpp.

◆ initPresentQueue()

bool lug::Graphics::Vulkan::Render::Window::initPresentQueue ( )
private

Definition at line 294 of file Window.cpp.

◆ initSwapchain()

bool lug::Graphics::Vulkan::Render::Window::initSwapchain ( )
private

Definition at line 342 of file Window.cpp.

◆ initFramesData()

bool lug::Graphics::Vulkan::Render::Window::initFramesData ( )
private

Definition at line 417 of file Window.cpp.

◆ buildBeginCommandBuffer()

bool lug::Graphics::Vulkan::Render::Window::buildBeginCommandBuffer ( )
private

Definition at line 482 of file Window.cpp.

◆ buildEndCommandBuffer()

bool lug::Graphics::Vulkan::Render::Window::buildEndCommandBuffer ( )
private

Definition at line 551 of file Window.cpp.

◆ buildCommandBuffers()

bool lug::Graphics::Vulkan::Render::Window::buildCommandBuffers ( )
private

Definition at line 580 of file Window.cpp.

Member Data Documentation

◆ _initInfo

InitInfo lug::Graphics::Vulkan::Render::Window::_initInfo
private

Definition at line 86 of file Window.hpp.

◆ _renderer

lug::Graphics::Vulkan::Renderer& lug::Graphics::Vulkan::Render::Window::_renderer
private

Definition at line 88 of file Window.hpp.

◆ _surface

API::Surface lug::Graphics::Vulkan::Render::Window::_surface {}
private

Definition at line 89 of file Window.hpp.

◆ _swapchain

API::Swapchain lug::Graphics::Vulkan::Render::Window::_swapchain {}
private

Definition at line 90 of file Window.hpp.

◆ _presentQueue

const API::Queue* lug::Graphics::Vulkan::Render::Window::_presentQueue {nullptr}
private

Definition at line 92 of file Window.hpp.

◆ _presentQueueFamily

const API::QueueFamily* lug::Graphics::Vulkan::Render::Window::_presentQueueFamily {nullptr}
private

Definition at line 93 of file Window.hpp.

◆ _currentImageIndex

uint32_t lug::Graphics::Vulkan::Render::Window::_currentImageIndex {0}
private

Definition at line 94 of file Window.hpp.

◆ _framesData

std::vector<FrameData> lug::Graphics::Vulkan::Render::Window::_framesData
private

Definition at line 96 of file Window.hpp.

◆ _acquireImageDatas

std::vector<AcquireImageData> lug::Graphics::Vulkan::Render::Window::_acquireImageDatas
private

Definition at line 98 of file Window.hpp.

◆ _commandPool

API::CommandPool lug::Graphics::Vulkan::Render::Window::_commandPool {}
private

Definition at line 100 of file Window.hpp.

◆ _guiInstance

lug::Graphics::Vulkan::Gui lug::Graphics::Vulkan::Render::Window::_guiInstance
private

Definition at line 102 of file Window.hpp.

◆ _isGuiInitialized

bool lug::Graphics::Vulkan::Render::Window::_isGuiInitialized
private

Definition at line 104 of file Window.hpp.


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