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

PBuffer implementation of EGL When supported, PBuffer is a surface-less implementation of OpenGL. More...

#include <OgreEglPBufferWindow.h>

+ Inheritance diagram for Ogre::EglPBufferWindow:

Public Member Functions

 EglPBufferWindow (const String &title, uint32 width, uint32 height, bool fullscreenMode, const NameValuePairList *miscParams, Ogre::EglPBufferSupport *glsupport)
 
virtual ~EglPBufferWindow ()
 
virtual void _initialize (TextureGpuManager *textureManager)
 
virtual void _setVisible (bool visible)
 Internal method to notify the window it has been obscured or minimized. More...
 
virtual void destroy ()
 
virtual void getCustomAttribute (IdString name, void *pData)
 
virtual bool isClosed () const
 Indicates whether the window has been closed by the user. More...
 
bool isHidden () const
 Indicates whether the window was set to hidden (not displayed) More...
 
bool isVisible () const
 
virtual void reposition (int32 left, int32 top)
 
void requestFullscreenSwitch (bool goFullscreen, bool borderless, uint32 monitorIdx, uint32 width, uint32 height, uint32 frequencyNumerator, uint32 frequencyDenominator)
 Requests to toggle between fullscreen and windowed mode. More...
 
void requestResolution (uint32 width, uint32 height)
 Requests a change in resolution. More...
 
bool requiresTextureFlipping () const
 
void setHidden (bool hidden)
 Hide (or show) the window. More...
 
virtual void setVSync (bool vSync, uint32 vSyncInterval)
 Turns VSync on/off. More...
 
void swapBuffers ()
 
- 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...
 
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
 
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. More...
 
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 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 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...
 
virtual void windowMovedOrResized ()
 Notify that the window has been resized. More...
 

Detailed Description

PBuffer implementation of EGL When supported, PBuffer is a surface-less implementation of OpenGL.

This means the window is a dummy hidden window that can run without X11 or Wayland servers as long as DRM is supported.

This is ideal for running a headless server in a terminal, an SSH session or the cloud

While support has been geared mostly towards Linux, it may run on Windows. However I do not know whether drivers support it.

Pass parameter "Device" to RenderSystem::setConfigOption. Mesa drivers typically expose "EGL_EXT_device_drm" (an actual GPU) and "EGL_MESA_device_software" (SW emulation)

Remarks
Due to drivers not caring too much about PBuffer support (e.g. sRGB is an afterthought, depth buffers may not be 32-bits) we create a 1x1 PBuffer to get OpenGL up, but we don't expose it to the user.

Instead we create a regular FBO for rendering with the requested settings (resolution, sRGB, depth buffer). This means implementation details such as requiresTextureFlipping must behave the same way as regular FBOs, and is inconsistent with the other GL Window backends

Constructor & Destructor Documentation

◆ EglPBufferWindow()

Ogre::EglPBufferWindow::EglPBufferWindow ( const String title,
uint32  width,
uint32  height,
bool  fullscreenMode,
const NameValuePairList miscParams,
Ogre::EglPBufferSupport glsupport 
)

◆ ~EglPBufferWindow()

virtual Ogre::EglPBufferWindow::~EglPBufferWindow ( )
virtual

Member Function Documentation

◆ _initialize()

virtual void Ogre::EglPBufferWindow::_initialize ( TextureGpuManager textureManager)
virtual

◆ _setVisible()

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

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

Implements Ogre::Window.

◆ destroy()

virtual void Ogre::EglPBufferWindow::destroy ( )
virtual

Implements Ogre::Window.

◆ getCustomAttribute()

virtual void Ogre::EglPBufferWindow::getCustomAttribute ( IdString  name,
void *  pData 
)
virtual
Remarks
Get custom attribute; the following attributes are valid: GLCONTEXT The Ogre GL3PlusContext used for rendering.

Reimplemented from Ogre::Window.

◆ isClosed()

virtual bool Ogre::EglPBufferWindow::isClosed ( ) const
virtual

Indicates whether the window has been closed by the user.

Implements Ogre::Window.

◆ isHidden()

bool Ogre::EglPBufferWindow::isHidden ( ) const
inlinevirtual

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

Implements Ogre::Window.

◆ isVisible()

bool Ogre::EglPBufferWindow::isVisible ( ) const
virtual

Implements Ogre::Window.

◆ reposition()

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

Implements Ogre::Window.

◆ requestFullscreenSwitch()

void Ogre::EglPBufferWindow::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
widthPtNew width. Leave 0 if you don't care.
heightPtNew 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()

void Ogre::EglPBufferWindow::requestResolution ( uint32  width,
uint32  height 
)
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.

◆ requiresTextureFlipping()

bool Ogre::EglPBufferWindow::requiresTextureFlipping ( ) const
inline

◆ setHidden()

void Ogre::EglPBufferWindow::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.

◆ setVSync()

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

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()

void Ogre::EglPBufferWindow::swapBuffers ( )
virtual

Implements Ogre::Window.


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