OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
#include <OgreMetalWindow.h>
Public Member Functions | |
MetalWindow (const String &title, uint32 width, uint32 height, bool fullscreenMode, const NameValuePairList *miscParams, MetalDevice *ownerDevice) | |
~MetalWindow () override | |
void | _initialize (TextureGpuManager *textureGpuManager, const NameValuePairList *miscParams) override |
void | _setVisible (bool visible) override |
Internal method to notify the window it has been obscured or minimized. More... | |
bool | canDownloadData () const override |
Returns true if you can download to CPU (i.e. More... | |
virtual void | create (bool fullScreen, const NameValuePairList *miscParams) |
void | destroy () override |
void | getCustomAttribute (IdString name, void *pData) override |
float | getViewPointToPixelScale () const override |
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. More... | |
bool | isClosed () const override |
Indicates whether the window has been closed by the user. More... | |
bool | isHidden () const override |
Indicates whether the window was set to hidden (not displayed) More... | |
bool | isManualSwapRelease () const override |
Returns the value set by setManualSwapRelease when supported. More... | |
bool | isVisible () const override |
bool | nextDrawable () |
void | performManualRelease () override |
See Window::setManualSwapRelease. More... | |
void | reposition (int32 left, int32 top) override |
void | requestResolution (uint32 width, uint32 height) override |
Requests a change in resolution. More... | |
void | setHidden (bool hidden) override |
Hide (or show) the window. More... | |
void | setManualSwapRelease (bool bManualRelease) override |
Metal doesn't want us to hold on to a drawable after presenting. More... | |
void | setWantsToDownload (bool bWantsToDownload) override |
On Metal you must call this function and set it to true in order to take pictures. More... | |
void | swapBuffers () override |
void | windowMovedOrResized () override |
Notify that the window has been resized. More... | |
Public Member Functions inherited from Ogre::Window | |
Window (const String &title, uint32 widthPt, uint32 heightPt, bool fullscreenMode) | |
virtual | ~Window () |
virtual void | _initialize (TextureGpuManager *textureGpuManager, const NameValuePairList *ogre_nullable miscParams)=0 |
void | _setPrimary () |
Indicates that this is the primary window. More... | |
bool | getBorderless () const |
TextureGpu *ogre_nullable | 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. More... | |
PixelFormatGpu | getPixelFormat () const |
uint32 | getRequestedHeightPt () const |
uint32 | getRequestedWidthPt () const |
SampleDescription | getSampleDescription () const |
TextureGpu *ogre_nullable | getStencilBuffer () const |
TextureGpu *ogre_nullable | getTexture () const |
WARNING: Attempting to change the TextureGpu (e.g. More... | |
const String & | getTitle () const |
bool | getVSync () const |
uint32 | getVSyncInterval () const |
uint32 | getWidth () const |
bool | isFocused () const |
bool | isFullscreen () const |
Returns true if we are currently in fullscreen mode. More... | |
bool | isMultisample () const |
bool | isPrimary () const |
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. More... | |
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. More... | |
virtual void | setTitle (const String &title) |
virtual void | setVSync (bool vSync, uint32 vSyncInterval) |
Turns VSync on/off. More... | |
bool | wantsToGoFullscreen () const |
Returns true if we are in windowed mode right now, but want to go fullscreen. More... | |
bool | wantsToGoWindowed () const |
Returns true if we are in fullscreen mode right now, but want to go windowed mode. More... | |
Ogre::MetalWindow::MetalWindow | ( | const String & | title, |
uint32 | width, | ||
uint32 | height, | ||
bool | fullscreenMode, | ||
const NameValuePairList * | miscParams, | ||
MetalDevice * | ownerDevice | ||
) |
|
override |
|
override |
|
overridevirtual |
Internal method to notify the window it has been obscured or minimized.
Implements Ogre::Window.
|
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.
|
virtual |
|
overridevirtual |
Implements Ogre::Window.
|
overridevirtual |
Reimplemented from Ogre::Window.
|
overridevirtual |
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 from Ogre::Window.
|
overridevirtual |
Indicates whether the window has been closed by the user.
Implements Ogre::Window.
|
overridevirtual |
Indicates whether the window was set to hidden (not displayed)
Implements Ogre::Window.
|
overridevirtual |
Returns the value set by setManualSwapRelease when supported.
Reimplemented from Ogre::Window.
|
overridevirtual |
Implements Ogre::Window.
bool Ogre::MetalWindow::nextDrawable | ( | ) |
|
overridevirtual |
See Window::setManualSwapRelease.
Reimplemented from Ogre::Window.
Implements Ogre::Window.
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.
|
overridevirtual |
Hide (or show) the window.
If called with hidden=true, this will make the window completely invisible to the user.
Implements Ogre::Window.
|
overridevirtual |
Metal doesn't want us to hold on to a drawable after presenting.
If you want to take a screenshot capture of the window this is a problem because we no longer have a pointer of the backbuffer to download from.
You can either take your screenshot before swapBuffers() gets called, or, if you intend to take a screenshot, do the following:
Technically you can do setManualSwapRelease( true ) and leave it like that, but then you MUST call performManualRelease and that's bug prone.
Alternatively you can avoid setManualSwapRelease by taking pictures before calling Window::swapBuffers.
To do that use FrameListener::frameRenderingQueued listener, but* you still have to call setWantsToDownload( true ) and check canDownloadData returns true.
Reimplemented from Ogre::Window.
|
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.
|
overridevirtual |
Implements Ogre::Window.
|
overridevirtual |
Notify that the window has been resized.
Reimplemented from Ogre::Window.