![]() |
OGRE 2.3.1
Object-Oriented Graphics Rendering Engine
|
#include <OgreVulkanWindow.h>
Public Types | |
enum | Backend { BackendX11 = 1u << 0u } |
enum | SwapchainStatus { SwapchainAcquired , SwapchainUsedInRendering , SwapchainPendingSwap , SwapchainReleased } |
Public Attributes | |
bool | mClosed |
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 |
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. |
Ogre::VulkanWindowSwapChainBased::VulkanWindowSwapChainBased | ( | const String & | title, |
uint32 | width, | ||
uint32 | height, | ||
bool | fullscreenMode | ||
) |
|
virtual |
|
overridevirtualinherited |
Implements Ogre::Window.
|
pure virtualinherited |
Implemented in Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, Ogre::VulkanXcbWindow, and Ogre::VulkanWindowNull.
|
inherited |
Indicates that this is the primary window.
Only to be called by Ogre::Root
Internal method to notify the window it has been obscured or minimized.
Implemented in Ogre::D3D11Window, Ogre::EGLWindow, Ogre::EglPBufferWindow, Ogre::GLXWindow, Ogre::Win32Window, Ogre::MetalWindow, Ogre::NULLWindow, Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, Ogre::VulkanXcbWindow, Ogre::CocoaWindow, and Ogre::VulkanWindowNull.
void Ogre::VulkanWindowSwapChainBased::_swapBuffers | ( | VkSemaphore | queueFinishSemaphore | ) |
Actually performs present.
Called by VulkanDevice::commitAndNextCommandBuffer
queueFinishSemaphore | Makes our present request wait until the Queue is done executing before we can present |
PixelFormatGpu Ogre::VulkanWindowSwapChainBased::chooseSurfaceFormat | ( | bool | hwGamma | ) |
Implements Ogre::Window.
Reimplemented in Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, and Ogre::VulkanXcbWindow.
|
virtual |
Reimplemented from Ogre::Window.
Reimplemented in Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, and Ogre::VulkanXcbWindow.
|
inherited |
VkSemaphore Ogre::VulkanWindowSwapChainBased::getImageAcquiredSemaphore | ( | void | ) |
Returns null if getImageAcquiredSemaphore has already been called during this frame.
|
virtualinherited |
Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing systems.
Result is in pixels.
References mSwapchainImages, and Ogre::FastArray< T >::size().
|
inherited |
|
inherited |
|
inherited |
References mSwapchainImages.
|
inherited |
WARNING: Attempting to change the TextureGpu (e.g.
setResolution, setPixelFormat) is undefined behavior
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.
Indicates whether the window has been closed by the user.
Implements Ogre::Window.
Returns true if we are currently in fullscreen mode.
Indicates whether the window was set to hidden (not displayed)
Implemented in Ogre::D3D11Window, Ogre::VulkanWindowNull, Ogre::EGLWindow, Ogre::EglPBufferWindow, Ogre::GLXWindow, Ogre::Win32Window, Ogre::MetalWindow, Ogre::NULLWindow, Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, Ogre::VulkanXcbWindow, and Ogre::CocoaWindow.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
void Ogre::VulkanWindowSwapChainBased::parseSharedParams | ( | const NameValuePairList * | miscParams | ) |
|
virtualinherited |
Requests to toggle between fullscreen and windowed mode.
goFullscreen | True to go fullscreen, false to go windowed mode. |
borderless | Whether to be borderless. Only useful if goFullscreen == false; |
monitorIdx | |
width | New width. Leave 0 if you don't care. |
height | New height. Leave 0 if you don't care. |
frequencyNumerator | New frequency (fullscreen only). Leave 0 if you don't care. |
frequencyDenominator | New frequency (fullscreen only). Leave 0 if you don't care. |
Reimplemented in Ogre::EGLWindow, Ogre::EglPBufferWindow, Ogre::GLXWindow, Ogre::Win32Window, Ogre::NULLWindow, Ogre::VulkanWin32Window, and Ogre::VulkanXcbWindow.
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 in Ogre::EGLWindow, Ogre::EglPBufferWindow, Ogre::GLXWindow, Ogre::Win32Window, Ogre::MetalWindow, Ogre::NULLWindow, Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, and Ogre::VulkanXcbWindow.
Reimplemented in Ogre::Win32Window, and Ogre::VulkanWin32Window.
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.
fsaa | Requesed FSAA mode ( |
Reimplemented in Ogre::D3D11WindowSwapChainBased.
Hide (or show) the window.
If called with hidden=true, this will make the window completely invisible to the user.
Implemented in Ogre::D3D11Window, Ogre::EGLWindow, Ogre::EglPBufferWindow, Ogre::GLXWindow, Ogre::Win32Window, Ogre::MetalWindow, Ogre::NULLWindow, Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, Ogre::VulkanXcbWindow, Ogre::CocoaWindow, and Ogre::VulkanWindowNull.
|
virtual |
Turns VSync on/off.
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.
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.
Returns true if we are in windowed mode right now, but want to go fullscreen.
Returns true if we are in fullscreen mode right now, but want to go windowed mode.
Notify that the window has been resized.
Reimplemented in Ogre::EGLWindow, Ogre::GLXWindow, Ogre::Win32Window, Ogre::MetalWindow, Ogre::VulkanAndroidWindow, Ogre::VulkanWin32Window, Ogre::VulkanXcbWindow, and Ogre::CocoaWindow.
bool Ogre::VulkanWindowSwapChainBased::mClosed |
bool Ogre::VulkanWindowSwapChainBased::mLowestLatencyVSync |
bool Ogre::VulkanWindowSwapChainBased::mRebuildingSwapchain |
bool Ogre::VulkanWindowSwapChainBased::mSuboptimal |
VkSurfaceKHR Ogre::VulkanWindowSwapChainBased::mSurfaceKHR |
VkSwapchainKHR Ogre::VulkanWindowSwapChainBased::mSwapchain |
Referenced by getNumSwapchains(), and getSwapchainImage().
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
SwapchainStatus Ogre::VulkanWindowSwapChainBased::mSwapchainStatus |