OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::CocoaWindow Class Reference

#include <OgreOSXCocoaWindow.h>

+ Inheritance diagram for Ogre::CocoaWindow:

Public Member Functions

 CocoaWindow (const String &title, uint32 widthPt, uint32 heightPt, bool fullscreenMode)
 
virtual ~CocoaWindow ()
 
void _initialize (TextureGpuManager *textureManager) override
 
void _setVisible (bool visible) override
 Internal method to notify the window it has been obscured or minimized. More...
 
void create (const String &name, unsigned int widthPt, unsigned int heightPt, bool fullScreen, const NameValuePairList *miscParams)
 
void destroy () override
 
void getCustomAttribute (IdString name, void *pData)
 
float getViewPointToPixelScale () const override
 Turns VSync on/off. More...
 
bool isActive () const
 
bool isClosed () const override
 Indicates whether the window has been closed by the user. More...
 
bool isDeactivatedOnFocusChange () const
 
bool isHidden () const override
 Indicates whether the window was set to hidden (not displayed) More...
 
bool isVisible () const override
 
void reposition (int leftPt, int topPt) override
 
void setActive (bool value)
 
void setDeactivateOnFocusChange (bool deactivate)
 
void setHidden (bool hidden) override
 Hide (or show) the window. More...
 
void setVisible (bool visible)
 
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 ()
 
void _setPrimary ()
 Indicates that this is the primary window. More...
 
virtual bool canDownloadData () const
 Returns true if you can download to CPU (i.e. 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 StringgetTitle () 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...
 
virtual bool isManualSwapRelease () const
 Returns the value set by setManualSwapRelease when supported. More...
 
bool isMultisample () const
 
bool isPrimary () const
 
virtual void performManualRelease ()
 See Window::setManualSwapRelease. More...
 
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. More...
 
virtual void requestResolution (uint32 widthPt, uint32 heightPt)
 Requests a change in resolution. 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 setManualSwapRelease (bool bManualRelease)
 Metal doesn't want us to hold on to a drawable after presenting. More...
 
virtual void setTitle (const String &title)
 
virtual void setVSync (bool vSync, uint32 vSyncInterval)
 Turns VSync on/off. More...
 
virtual void setWantsToDownload (bool bWantsToDownload)
 On Metal you must call this function and set it to true in order to take pictures. 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...
 

Constructor & Destructor Documentation

◆ CocoaWindow()

Ogre::CocoaWindow::CocoaWindow ( const String title,
uint32  widthPt,
uint32  heightPt,
bool  fullscreenMode 
)

◆ ~CocoaWindow()

virtual Ogre::CocoaWindow::~CocoaWindow ( )
virtual

Member Function Documentation

◆ _initialize()

void Ogre::CocoaWindow::_initialize ( TextureGpuManager textureManager)
overridevirtual

Implements Ogre::Window.

◆ _setVisible()

void Ogre::CocoaWindow::_setVisible ( bool  visible)
overridevirtual

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

Implements Ogre::Window.

◆ create()

void Ogre::CocoaWindow::create ( const String name,
unsigned int  widthPt,
unsigned int  heightPt,
bool  fullScreen,
const NameValuePairList miscParams 
)

◆ destroy()

void Ogre::CocoaWindow::destroy ( )
overridevirtual

Implements Ogre::Window.

◆ getCustomAttribute()

void Ogre::CocoaWindow::getCustomAttribute ( IdString  name,
void *  pData 
)
virtual

Remarks
Get custom attribute; the following attributes are valid: GLCONTEXT WINDOW VIEW NSOPENGLCONTEXT NSOPENGLPIXELFORMAT

Reimplemented from Ogre::Window.

◆ getViewPointToPixelScale()

float Ogre::CocoaWindow::getViewPointToPixelScale ( ) const
overridevirtual

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)

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.

◆ isActive()

bool Ogre::CocoaWindow::isActive ( ) const

◆ isClosed()

bool Ogre::CocoaWindow::isClosed ( ) const
overridevirtual

Indicates whether the window has been closed by the user.

Implements Ogre::Window.

◆ isDeactivatedOnFocusChange()

bool Ogre::CocoaWindow::isDeactivatedOnFocusChange ( ) const

◆ isHidden()

bool Ogre::CocoaWindow::isHidden ( ) const
inlineoverridevirtual

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

Implements Ogre::Window.

◆ isVisible()

bool Ogre::CocoaWindow::isVisible ( ) const
overridevirtual

Implements Ogre::Window.

◆ reposition()

void Ogre::CocoaWindow::reposition ( int  leftPt,
int  topPt 
)
override

◆ setActive()

void Ogre::CocoaWindow::setActive ( bool  value)

◆ setDeactivateOnFocusChange()

void Ogre::CocoaWindow::setDeactivateOnFocusChange ( bool  deactivate)

◆ setHidden()

void Ogre::CocoaWindow::setHidden ( bool  hidden)
overridevirtual

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.

◆ setVisible()

void Ogre::CocoaWindow::setVisible ( bool  visible)

◆ swapBuffers()

void Ogre::CocoaWindow::swapBuffers ( )
overridevirtual

Implements Ogre::Window.

◆ windowMovedOrResized()

void Ogre::CocoaWindow::windowMovedOrResized ( )
overridevirtual

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.


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