OGRE-Next: Ogre::VulkanWindowSwapChainBased Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
Ogre::VulkanWindowSwapChainBased Class Reference

`#include <OgreVulkanWindow.h>`

Inheritance diagram for Ogre::VulkanWindowSwapChainBased:
[legend]

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

## Public Member Functions
| VulkanWindowSwapChainBased (const String &title, uint32 width, uint32 height, bool fullscreenMode)
| ~VulkanWindowSwapChainBased () override
void | _swapBuffers (VkSemaphore queueFinishSemaphore)
| Actually performs present.
void | acquireNextSwapchain ()
bool | canDownloadData () const override
| Returns true if you can download to CPU (i.e.
PixelFormatGpu | chooseSurfaceFormat (bool hwGamma)
void | createSwapchain ()
void | destroy () override
void | destroySwapchain ()
void | getCustomAttribute (IdString name, void *pData) override
VkSemaphore | getImageAcquiredSemaphore ()
| Returns null if getImageAcquiredSemaphore has already been called during this frame.
size_t | getNumSwapchains () const
VkImage | getSwapchainImage (size_t idx) const
bool | isClosed () const override
| Indicates whether the window has been closed by the user.
void | parseSharedParams (const NameValuePairList *miscParams)
void | setVSync (bool vSync, uint32 vSyncInterval) override
| Turns VSync on/off.
void | setWantsToDownload (bool bWantsToDownload) override
| On Metal you must call this function and set it to true in order to take pictures.
void | swapBuffers () override
| 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.
Public Member Functions inherited from Ogre::VulkanWindow
| VulkanWindow (const String &title, uint32 width, uint32 height, bool fullscreenMode)
void | _initialize (TextureGpuManager *textureGpuManager) override
virtual void | _initialize (TextureGpuManager *textureGpuManager, const NameValuePairList *miscParams)=0
void | _setDevice (VulkanDevice *device)
Public Member Functions inherited from Ogre::Window
| Window (const String &title, uint32 widthPt, uint32 heightPt, bool fullscreenMode)
virtual | ~Window ()
void | _setPrimary ()
| Indicates that this is the primary window.
virtual void | _setVisible (bool visible)=0
| Internal method to notify the window it has been obscured or minimized.
bool | getBorderless () const
TextureGpu * | getDepthBuffer () const
uint32 | getFrequencyDenominator () const
uint32 | getFrequencyNumerator () const
uint32 | getHeight () const
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.
PixelFormatGpu | getPixelFormat () const
uint32 | getRequestedHeightPt () const
uint32 | getRequestedWidthPt () const
SampleDescription | getSampleDescription () const
TextureGpu * | getStencilBuffer () const
TextureGpu * | getTexture () const
| WARNING: Attempting to change the TextureGpu (e.g.
const String & | getTitle () 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 () const
uint32 | getVSyncInterval () const
uint32 | getWidth () const
bool | isFocused () const
bool | isFullscreen () const
| Returns true if we are currently in fullscreen mode.
virtual bool | isHidden () const =0
| Indicates whether the window was set to hidden (not displayed)
virtual bool | isManualSwapRelease () const
| Returns the value set by setManualSwapRelease when supported.
bool | isMultisample () const
bool | isPrimary () const
virtual bool | isVisible () const =0
virtual void | performManualRelease ()
| See Window::setManualSwapRelease.
virtual void | reposition (int32 leftPt, int32 topPt)=0
virtual void | requestFullscreenSwitch (bool goFullscreen, bool borderless, uint32 monitorIdx, uint32 widthPt, uint32 heightPt, uint32 frequencyNumerator, uint32 frequencyDenominator)
| Requests to toggle between fullscreen and windowed mode.
virtual void | requestResolution (uint32 widthPt, uint32 heightPt)
| 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)=0
| Hide (or show) the window.
virtual void | setManualSwapRelease (bool bManualRelease)
| Metal doesn't want us to hold on to a drawable after presenting.
virtual void | setTitle (const String &title)
bool | wantsToGoFullscreen () const
| Returns true if we are in windowed mode right now, but want to go fullscreen.
bool | wantsToGoWindowed () const
| Returns true if we are in fullscreen mode right now, but want to go windowed mode.
virtual void | windowMovedOrResized ()
| Notify that the window has been resized.

## Public Attributes
bool | mCanDownloadData
bool | mClosed
bool | mEnablePreTransform
bool | mLowestLatencyVSync
bool | mRebuildingSwapchain
bool | mSuboptimal
VkSurfaceKHR | mSurfaceKHR
VkSwapchainKHR | mSwapchain
FastArray< VkImage > | mSwapchainImages
VkSemaphore | mSwapchainSemaphore
| Note: We need a semaphore per frame, not per swapchain.
SwapchainStatus | mSwapchainStatus

## Member Enumeration Documentation

## ◆ Backend

enum Ogre::VulkanWindowSwapChainBased::Backend

Enumerator
BackendX11 |

## ◆ SwapchainStatus

enum Ogre::VulkanWindowSwapChainBased::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

## ◆ VulkanWindowSwapChainBased()

Ogre::VulkanWindowSwapChainBased::VulkanWindowSwapChainBased | ( | const String & | title,
|  | uint32 | width,
|  | uint32 | height,
|  | bool | fullscreenMode )

## ◆ ~VulkanWindowSwapChainBased()

Ogre::VulkanWindowSwapChainBased::~VulkanWindowSwapChainBased | ( |  | ) |
| override

## Member Function Documentation

## ◆ _swapBuffers()

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

Actually performs present.

Called by VulkanDevice::commitAndNextCommandBuffer

Parameters

  queueFinishSemaphore | Makes our present request wait until the Queue is done executing before we can present

## ◆ acquireNextSwapchain()

void Ogre::VulkanWindowSwapChainBased::acquireNextSwapchain | ( |  | ) |

## ◆ canDownloadData()

bool Ogre::VulkanWindowSwapChainBased::canDownloadData | ( |  | ) | const
| overridevirtual

Returns true if you can download to CPU (i.e.

transfer it via AsyncTextureTicket) If it returns false, attempting to do so could result in a crash

See Window::setWantsToDownload See Window::setManualSwapRelease

Reimplemented from Ogre::Window.

## ◆ chooseSurfaceFormat()

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

## ◆ createSwapchain()

void Ogre::VulkanWindowSwapChainBased::createSwapchain | ( |  | ) |

## ◆ destroy()

void Ogre::VulkanWindowSwapChainBased::destroy | ( |  | ) |
| overridevirtual

Implements Ogre::Window.

Reimplemented in Ogre::VulkanXcbWindow.

## ◆ destroySwapchain()

void Ogre::VulkanWindowSwapChainBased::destroySwapchain | ( |  | ) |

## ◆ getCustomAttribute()

void Ogre::VulkanWindowSwapChainBased::getCustomAttribute | ( | IdString | name,
|  | void * | pData )
| overridevirtual

Reimplemented from Ogre::Window.

Reimplemented in Ogre::VulkanXcbWindow.

## ◆ getImageAcquiredSemaphore()

VkSemaphore Ogre::VulkanWindowSwapChainBased::getImageAcquiredSemaphore | ( |  | ) |

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

## ◆ getNumSwapchains()

size_t Ogre::VulkanWindowSwapChainBased::getNumSwapchains | ( |  | ) | const
| inline

References mSwapchainImages.

## ◆ getSwapchainImage()

VkImage Ogre::VulkanWindowSwapChainBased::getSwapchainImage | ( | size_t | idx | ) | const
| inline

References mSwapchainImages.

## ◆ isClosed()

bool Ogre::VulkanWindowSwapChainBased::isClosed | ( |  | ) | const
| overridevirtual

Indicates whether the window has been closed by the user.

Implements Ogre::Window.

## ◆ parseSharedParams()

void Ogre::VulkanWindowSwapChainBased::parseSharedParams | ( | const NameValuePairList * | miscParams | ) |

## ◆ setVSync()

void Ogre::VulkanWindowSwapChainBased::setVSync | ( | bool | vSync,
|  | uint32 | vSyncInterval )
| overridevirtual

Turns VSync on/off.

Parameters

  vSync |
  vSyncInterval | When 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.

## ◆ setWantsToDownload()

void Ogre::VulkanWindowSwapChainBased::setWantsToDownload | ( | bool | bWantsToDownload | ) |
| overridevirtual

On Metal you must call this function and set it to true in order to take pictures.

If you no longer need that functionality, set it to false to improve performance

Reimplemented from Ogre::Window.

## ◆ swapBuffers()

void Ogre::VulkanWindowSwapChainBased::swapBuffers | ( |  | ) |
| overridevirtual

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.

## Member Data Documentation

## ◆ mCanDownloadData

bool Ogre::VulkanWindowSwapChainBased::mCanDownloadData

## ◆ mClosed

bool Ogre::VulkanWindowSwapChainBased::mClosed

## ◆ mEnablePreTransform

bool Ogre::VulkanWindowSwapChainBased::mEnablePreTransform

## ◆ mLowestLatencyVSync

bool Ogre::VulkanWindowSwapChainBased::mLowestLatencyVSync

## ◆ mRebuildingSwapchain

bool Ogre::VulkanWindowSwapChainBased::mRebuildingSwapchain

## ◆ mSuboptimal

bool Ogre::VulkanWindowSwapChainBased::mSuboptimal

## ◆ mSurfaceKHR

VkSurfaceKHR Ogre::VulkanWindowSwapChainBased::mSurfaceKHR

## ◆ mSwapchain

VkSwapchainKHR Ogre::VulkanWindowSwapChainBased::mSwapchain

## ◆ mSwapchainImages

FastArray<VkImage> Ogre::VulkanWindowSwapChainBased::mSwapchainImages

Referenced by getNumSwapchains(), and getSwapchainImage().

## ◆ mSwapchainSemaphore

VkSemaphore Ogre::VulkanWindowSwapChainBased::mSwapchainSemaphore

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

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

- OgreVulkanWindow.h