OGRE 2.3.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::VulkanWin32Window Class Reference

#include <OgreVulkanWin32Window.h>

+ Inheritance diagram for Ogre::VulkanWin32Window:

Public Types

enum  Backend { BackendX11 = 1u << 0u }
 
enum  SwapchainStatus { SwapchainAcquired , SwapchainUsedInRendering , SwapchainPendingSwap , SwapchainReleased }
 

Public Member Functions

 VulkanWin32Window (const String &title, uint32 width, uint32 height, bool fullscreenMode)
 
virtual ~VulkanWin32Window ()
 
void _initialize (TextureGpuManager *textureGpuManager) override
 
virtual void _initialize (TextureGpuManager *textureGpuManager, const NameValuePairList *miscParams)
 
void _setDevice (VulkanDevice *device)
 
void _setPrimary (void)
 Indicates that this is the primary window.
 
virtual void _setVisible (bool visible)
 Internal method to notify the window it has been obscured or minimized.
 
void _swapBuffers (VkSemaphore queueFinishSemaphore)
 Actually performs present.
 
void acquireNextSwapchain (void)
 
PixelFormatGpu chooseSurfaceFormat (bool hwGamma)
 
void createSwapchain (void)
 
virtual void destroy (void)
 
void destroySwapchain (void)
 
bool getBorderless (void) const
 
void getCustomAttribute (IdString name, void *pData)
 
TextureGpugetDepthBuffer (void) const
 
uint32 getFrequencyDenominator (void) const
 
uint32 getFrequencyNumerator (void) const
 
uint32 getHeight (void) const
 
VkSemaphore getImageAcquiredSemaphore (void)
 Returns null if getImageAcquiredSemaphore has already been called during this frame.
 
virtual void getMetrics (uint32 &width, uint32 &height, int32 &left, int32 &top) const
 Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing systems.
 
size_t getNumSwapchains (void) const
 
PixelFormatGpu getPixelFormat (void) const
 
uint32 getRequestedHeightPt (void) const
 
uint32 getRequestedWidthPt (void) const
 
SampleDescription getSampleDescription (void) const
 
TextureGpugetStencilBuffer (void) const
 
VkImage getSwapchainImage (size_t idx) const
 
TextureGpugetTexture (void) const
 WARNING: Attempting to change the TextureGpu (e.g.
 
const StringgetTitle (void) const
 
virtual float getViewPointToPixelScale () const
 Many windowing systems that support HiDPI displays use special points to specify size of the windows and controls, so that windows and controls with hardcoded sizes does not become too small on HiDPI displays.
 
bool getVSync (void) const
 
uint32 getVSyncInterval (void) const
 
uint32 getWidth (void) const
 
virtual bool isClosed (void) const
 Indicates whether the window has been closed by the user.
 
bool isFocused (void) const
 
bool isFullscreen (void) const
 Returns true if we are currently in fullscreen mode.
 
virtual bool isHidden (void) const
 Indicates whether the window was set to hidden (not displayed)
 
bool isMultisample (void) const
 
bool isPrimary (void) const
 
virtual bool isVisible (void) const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
 
voidoperator new (size_t sz, void *ptr)
 placement operator new
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
 
void parseSharedParams (const NameValuePairList *miscParams)
 
virtual void reposition (int32 left, int32 top)
 
virtual void requestFullscreenSwitch (bool goFullscreen, bool borderless, uint32 monitorIdx, uint32 width, uint32 height, uint32 frequencyNumerator, uint32 frequencyDenominator)
 Requests to toggle between fullscreen and windowed mode.
 
virtual void requestResolution (uint32 width, uint32 height)
 Requests a change in resolution.
 
virtual void setBorderless (bool borderless)
 
virtual void setFocused (bool focused)
 
virtual void setFsaa (const String &fsaa)
 Set the FSAA mode to be used if hardware support it.
 
virtual void setHidden (bool hidden)
 Hide (or show) the window.
 
virtual void setTitle (const String &title)
 
virtual void setVSync (bool vSync, uint32 vSyncInterval)
 Turns VSync on/off.
 
virtual void swapBuffers (void)
 Tells our VulkanDevice that the next commitAndNextCommandBuffer call should present us Calling swapBuffers during the command buffer that is rendering to us is key for good performance; otherwise Ogre may split the commands that render to this window and the command that presents this window into two queue submissions.
 
bool wantsToGoFullscreen (void) const
 Returns true if we are in windowed mode right now, but want to go fullscreen.
 
bool wantsToGoWindowed (void) const
 Returns true if we are in fullscreen mode right now, but want to go windowed mode.
 
virtual void windowMovedOrResized (void)
 Notify that the window has been resized.
 

Static Public Member Functions

static const chargetRequiredExtensionName (void)
 

Public Attributes

bool mClosed
 
bool mLowestLatencyVSync
 
bool mRebuildingSwapchain
 
bool mSuboptimal
 
VkSurfaceKHR mSurfaceKHR
 
VkSwapchainKHR mSwapchain
 
FastArray< VkImagemSwapchainImages
 
VkSemaphore mSwapchainSemaphore
 Note: We need a semaphore per frame, not per swapchain.
 
SwapchainStatus mSwapchainStatus
 

Member Enumeration Documentation

◆ Backend

Enumerator
BackendX11 

◆ SwapchainStatus

Enumerator
SwapchainAcquired 

We already called VulkanWindowSwapChainBased::acquireNextSwapchain.

        Can only go into this state if we're coming from SwapchainReleased 
SwapchainUsedInRendering 

We already called VulkanWindowSwapChainBased::getImageAcquiredSemaphore.

Further calls to getImageAcquiredSemaphore will return null. Ogre is rendering or intends to into this swapchain.

Can only go into this state if we're coming from SwapchainAcquired

SwapchainPendingSwap 

We've come from SwapchainUsedInRendering and are waiting for VulkanDevice::commitAndNextCommandBuffer to present us.

SwapchainReleased 

We don't own a swapchain.

Ogre cannot render to this window.

        This status should not last long unless we're not initialized yet. 

Constructor & Destructor Documentation

◆ VulkanWin32Window()

Ogre::VulkanWin32Window::VulkanWin32Window ( const String title,
uint32  width,
uint32  height,
bool  fullscreenMode 
)

◆ ~VulkanWin32Window()

virtual Ogre::VulkanWin32Window::~VulkanWin32Window ( )
virtual

Member Function Documentation

◆ _initialize() [1/2]

void Ogre::VulkanWindow::_initialize ( TextureGpuManager textureGpuManager)
overridevirtualinherited

Implements Ogre::Window.

◆ _initialize() [2/2]

virtual void Ogre::VulkanWin32Window::_initialize ( TextureGpuManager textureGpuManager,
const NameValuePairList miscParams 
)
virtual

Implements Ogre::VulkanWindow.

◆ _setDevice()

void Ogre::VulkanWindow::_setDevice ( VulkanDevice device)
inherited

◆ _setPrimary()

void Ogre::Window::_setPrimary ( void  )
inherited

Indicates that this is the primary window.

Only to be called by Ogre::Root

◆ _setVisible()

virtual void Ogre::VulkanWin32Window::_setVisible ( bool  visible)
virtual

Internal method to notify the window it has been obscured or minimized.

Implements Ogre::Window.

◆ _swapBuffers()

void Ogre::VulkanWindowSwapChainBased::_swapBuffers ( VkSemaphore  queueFinishSemaphore)
inherited

Actually performs present.

Called by VulkanDevice::commitAndNextCommandBuffer

Parameters
queueFinishSemaphoreMakes our present request wait until the Queue is done executing before we can present

◆ acquireNextSwapchain()

void Ogre::VulkanWindowSwapChainBased::acquireNextSwapchain ( void  )
inherited

◆ chooseSurfaceFormat()

PixelFormatGpu Ogre::VulkanWindowSwapChainBased::chooseSurfaceFormat ( bool  hwGamma)
inherited

◆ createSwapchain()

void Ogre::VulkanWindowSwapChainBased::createSwapchain ( void  )
inherited

◆ destroy()

virtual void Ogre::VulkanWin32Window::destroy ( void  )
virtual

Reimplemented from Ogre::VulkanWindowSwapChainBased.

◆ destroySwapchain()

void Ogre::VulkanWindowSwapChainBased::destroySwapchain ( void  )
inherited

◆ getBorderless()

bool Ogre::Window::getBorderless ( void  ) const
inherited

◆ getCustomAttribute()

void Ogre::VulkanWin32Window::getCustomAttribute ( IdString  name,
void pData 
)
virtual

Reimplemented from Ogre::VulkanWindowSwapChainBased.

◆ getDepthBuffer()

TextureGpu * Ogre::Window::getDepthBuffer ( void  ) const
inherited

◆ getFrequencyDenominator()

uint32 Ogre::Window::getFrequencyDenominator ( void  ) const
inherited

◆ getFrequencyNumerator()

uint32 Ogre::Window::getFrequencyNumerator ( void  ) const
inherited

◆ getHeight()

uint32 Ogre::Window::getHeight ( void  ) const
inherited

◆ getImageAcquiredSemaphore()

VkSemaphore Ogre::VulkanWindowSwapChainBased::getImageAcquiredSemaphore ( void  )
inherited

Returns null if getImageAcquiredSemaphore has already been called during this frame.

◆ getMetrics()

virtual void Ogre::Window::getMetrics ( uint32 width,
uint32 height,
int32 left,
int32 top 
) const
virtualinherited

Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing systems.

Result is in pixels.

◆ getNumSwapchains()

size_t Ogre::VulkanWindowSwapChainBased::getNumSwapchains ( void  ) const
inlineinherited

◆ getPixelFormat()

PixelFormatGpu Ogre::Window::getPixelFormat ( void  ) const
inherited

◆ getRequestedHeightPt()

uint32 Ogre::Window::getRequestedHeightPt ( void  ) const
inherited

◆ getRequestedWidthPt()

uint32 Ogre::Window::getRequestedWidthPt ( void  ) const
inherited

◆ getRequiredExtensionName()

static const char * Ogre::VulkanWin32Window::getRequiredExtensionName ( void  )
static

◆ getSampleDescription()

SampleDescription Ogre::Window::getSampleDescription ( void  ) const
inherited

◆ getStencilBuffer()

TextureGpu * Ogre::Window::getStencilBuffer ( void  ) const
inherited

◆ getSwapchainImage()

VkImage Ogre::VulkanWindowSwapChainBased::getSwapchainImage ( size_t  idx) const
inlineinherited

◆ getTexture()

TextureGpu * Ogre::Window::getTexture ( void  ) const
inherited

WARNING: Attempting to change the TextureGpu (e.g.

setResolution, setPixelFormat) is undefined behavior

◆ getTitle()

const String & Ogre::Window::getTitle ( void  ) const
inherited

◆ getViewPointToPixelScale()

virtual float Ogre::Window::getViewPointToPixelScale ( ) const
inlinevirtualinherited

Many windowing systems that support HiDPI displays use special points to specify size of the windows and controls, so that windows and controls with hardcoded sizes does not become too small on HiDPI displays.

Such points have constant density ~ 100 points per inch (probably 96 on Windows and 72 on Mac), that is independent of pixel density of real display, and are used through the all windowing system.

Sometimes, such view points are choosen bigger for output devices that are viewed from larger distances, like 30" TV comparing to 30" monitor, therefore maintaining constant points angular density rather than constant linear density.

In any case, all such windowing system provides the way to convert such view points to pixels, be it DisplayProperties::LogicalDpi on WinRT or backingScaleFactor on MacOSX. We use pixels consistently through the Ogre, but window/view management functions takes view points for convenience, as does the rest of windowing system. Such parameters are named using xxxxPt pattern, and should not be mixed with pixels without being converted using getViewPointToPixelScale() function.

Sometimes such scale factor can change on-the-fly, for example if window is dragged to monitor with different DPI. In such situation, window size in view points is usually preserved by windowing system, and Ogre should adjust pixel size of RenderWindow.

Reimplemented in Ogre::MetalWindow, and Ogre::CocoaWindow.

◆ getVSync()

bool Ogre::Window::getVSync ( void  ) const
inherited

◆ getVSyncInterval()

uint32 Ogre::Window::getVSyncInterval ( void  ) const
inherited

◆ getWidth()

uint32 Ogre::Window::getWidth ( void  ) const
inherited

◆ isClosed()

virtual bool Ogre::VulkanWindowSwapChainBased::isClosed ( void  ) const
virtualinherited

Indicates whether the window has been closed by the user.

Implements Ogre::Window.

◆ isFocused()

bool Ogre::Window::isFocused ( void  ) const
inherited

◆ isFullscreen()

bool Ogre::Window::isFullscreen ( void  ) const
inherited

Returns true if we are currently in fullscreen mode.

◆ isHidden()

virtual bool Ogre::VulkanWin32Window::isHidden ( void  ) const
virtual

Indicates whether the window was set to hidden (not displayed)

Implements Ogre::Window.

◆ isMultisample()

bool Ogre::Window::isMultisample ( void  ) const
inherited

◆ isPrimary()

bool Ogre::Window::isPrimary ( void  ) const
inherited

◆ isVisible()

virtual bool Ogre::VulkanWin32Window::isVisible ( void  ) const
virtual

Implements Ogre::Window.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
void  
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

array operator new, with debug line info

◆ parseSharedParams()

void Ogre::VulkanWindowSwapChainBased::parseSharedParams ( const NameValuePairList miscParams)
inherited

◆ reposition()

virtual void Ogre::VulkanWin32Window::reposition ( int32  left,
int32  top 
)
virtual

Implements Ogre::Window.

◆ requestFullscreenSwitch()

virtual void Ogre::VulkanWin32Window::requestFullscreenSwitch ( bool  goFullscreen,
bool  borderless,
uint32  monitorIdx,
uint32  widthPt,
uint32  heightPt,
uint32  frequencyNumerator,
uint32  frequencyDenominator 
)
virtual

Requests to toggle between fullscreen and windowed mode.

Remarks
Use wantsToGoFullscreen & wantsToGoWindowed to know what you've requested. Same remarks as requestResolution apply: If we request to go fullscreen, wantsToGoFullscreen will return true. But if get word from OS saying we stay in windowed mode, wantsToGoFullscreen will start returning false.
Parameters
goFullscreenTrue to go fullscreen, false to go windowed mode.
borderlessWhether to be borderless. Only useful if goFullscreen == false;
monitorIdx
widthNew width. Leave 0 if you don't care.
heightNew height. Leave 0 if you don't care.
frequencyNumeratorNew frequency (fullscreen only). Leave 0 if you don't care.
frequencyDenominatorNew frequency (fullscreen only). Leave 0 if you don't care.

Reimplemented from Ogre::Window.

◆ requestResolution()

virtual void Ogre::VulkanWin32Window::requestResolution ( uint32  widthPt,
uint32  heightPt 
)
virtual

Requests a change in resolution.

Change is not immediate. Use getRequestedWidthPt & getRequestedHeightPt if you need to know what you've requested, but beware you may not get that resolution, and once we get word from the OS, getRequested{Width/Height}Pt will change again so that getWidth == getRequestedWidthPt * getViewPointToPixelScale.

Reimplemented from Ogre::Window.

◆ setBorderless()

virtual void Ogre::Window::setBorderless ( bool  borderless)
virtualinherited

◆ setFocused()

virtual void Ogre::VulkanWin32Window::setFocused ( bool  focused)
virtual

Reimplemented from Ogre::Window.

◆ setFsaa()

virtual void Ogre::Window::setFsaa ( const String fsaa)
inlinevirtualinherited

Set the FSAA mode to be used if hardware support it.

This option will be ignored if the hardware does not support it or setting can not be changed on the fly on per-target level.

Parameters
fsaaRequesed FSAA mode (
See also
Root::createRenderWindow)

Reimplemented in Ogre::D3D11WindowSwapChainBased.

◆ setHidden()

virtual void Ogre::VulkanWin32Window::setHidden ( bool  hidden)
virtual

Hide (or show) the window.

If called with hidden=true, this will make the window completely invisible to the user.

Remarks
Setting a window to hidden is useful to create a dummy primary RenderWindow hidden from the user so that you can create and recreate your actual RenderWindows without having to recreate all your resources.

Implements Ogre::Window.

◆ setTitle()

virtual void Ogre::Window::setTitle ( const String title)
virtualinherited

◆ setVSync()

virtual void Ogre::VulkanWindowSwapChainBased::setVSync ( bool  vSync,
uint32  vSyncInterval 
)
virtualinherited

Turns VSync on/off.

Parameters
vSync
vSyncIntervalWhen true, specifies how often the screen should be updated. e.g. at 60hz: vSyncInterval = 1 then update at 60hz vSyncInterval = 2 then update at 30hz vSyncInterval = 3 then update at 15hz vSyncInterval = 4 then update at 7.5hz

If the 31st bit is set, i.e. 0x80000000, then lowest latency mode, aka mailbox, will be used (which doesn't limit the framerate)

Reimplemented from Ogre::Window.

◆ swapBuffers()

virtual void Ogre::VulkanWindowSwapChainBased::swapBuffers ( void  )
virtualinherited

Tells our VulkanDevice that the next commitAndNextCommandBuffer call should present us Calling swapBuffers during the command buffer that is rendering to us is key for good performance; otherwise Ogre may split the commands that render to this window and the command that presents this window into two queue submissions.

Implements Ogre::Window.

◆ wantsToGoFullscreen()

bool Ogre::Window::wantsToGoFullscreen ( void  ) const
inherited

Returns true if we are in windowed mode right now, but want to go fullscreen.

◆ wantsToGoWindowed()

bool Ogre::Window::wantsToGoWindowed ( void  ) const
inherited

Returns true if we are in fullscreen mode right now, but want to go windowed mode.

◆ windowMovedOrResized()

virtual void Ogre::VulkanWin32Window::windowMovedOrResized ( void  )
virtual

Notify that the window has been resized.

Remarks
You don't need to call this unless you created the window externally.

Reimplemented from Ogre::Window.

Member Data Documentation

◆ mClosed

bool Ogre::VulkanWindowSwapChainBased::mClosed
inherited

◆ mLowestLatencyVSync

bool Ogre::VulkanWindowSwapChainBased::mLowestLatencyVSync
inherited

◆ mRebuildingSwapchain

bool Ogre::VulkanWindowSwapChainBased::mRebuildingSwapchain
inherited

◆ mSuboptimal

bool Ogre::VulkanWindowSwapChainBased::mSuboptimal
inherited

◆ mSurfaceKHR

VkSurfaceKHR Ogre::VulkanWindowSwapChainBased::mSurfaceKHR
inherited

◆ mSwapchain

VkSwapchainKHR Ogre::VulkanWindowSwapChainBased::mSwapchain
inherited

◆ mSwapchainImages

FastArray<VkImage> Ogre::VulkanWindowSwapChainBased::mSwapchainImages
inherited

◆ mSwapchainSemaphore

VkSemaphore Ogre::VulkanWindowSwapChainBased::mSwapchainSemaphore
inherited

Note: We need a semaphore per frame, not per swapchain.

Makes Queue execution wait until the acquired image is done presenting

◆ mSwapchainStatus

SwapchainStatus Ogre::VulkanWindowSwapChainBased::mSwapchainStatus
inherited

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