![]() |
SGCT master (487fac4)
Simple Graphics Cluster Toolkit
|
#include <sgct/window.h>
Public Types | |
| enum class | StereoMode : uint8_t { NoStereo = 0 , Active , AnaglyphRedCyan , AnaglyphAmberBlue , AnaglyphRedCyanWimmer , Checkerboard , CheckerboardInverted , VerticalInterlaced , VerticalInterlacedInverted , Dummy , SideBySide , SideBySideInverted , TopBottom , TopBottomInverted } |
| Different stereo modes used for rendering. More... | |
Public Member Functions | |
| Window (const config::Window &window) | |
| ~Window () | |
| void | openWindow (GLFWwindow *share, bool isLastWindow) |
| This function is used to open the window. | |
| void | closeWindow () |
| void | initialize () |
| Initialize window buffers such as textures, FBOs, VAOs, VBOs and PBOs. | |
| void | initializeContextSpecific () |
| void | updateResolutions () |
| void | update () |
| void | draw () |
| void | renderFBOTexture () |
| void | swapBuffers (bool takeScreenshot) |
| Swap previous data and current data. | |
| void | makeOpenGLContextCurrent () |
| bool | needsCompatibilityProfile () const |
| bool | shouldTakeScreenshot () const |
| bool | isOpenXREnabled () const |
| vec2 | scale () const |
| float | aspectRatio () const |
| ivec2 | windowSize () const |
| GLFWwindow * | windowHandle () const |
| void | addViewport (std::unique_ptr< Viewport > vpPtr) |
| const std::vector< std::unique_ptr< Viewport > > & | viewports () const |
| void | updateFrustums (float nearClip, float farClip) |
| void | renderScreenQuad () const |
| void | setFramebufferResolution (ivec2 resolution) |
| Sets the framebuffer resolution. | |
| ivec2 | framebufferResolution () const |
| Get the dimensions of the final FBO. | |
| bool | isWindowResized () const |
| bool | isFocused () const |
| int | id () const |
| void | setName (std::string name) |
| Name this window. | |
| const std::string & | name () const |
| void | setTags (std::vector< std::string > tags) |
| Tag this window. | |
| bool | hasTag (std::string_view tag) const |
| void | setVisible (bool state) |
| Set the visibility state of this window. | |
| bool | isVisible () const |
| void | setRenderWhileHidden (bool state) |
| Set if window should render while hidden. | |
| bool | isRenderingWhileHidden () const |
| void | setFullscreen (bool fullscreen) |
| Set if fullscreen mode should be used. | |
| void | setAutoiconify (bool shouldAutoiconify) |
| Sets whether a full screen window should automatically iconify when losing focus. | |
| void | setFloating (bool floating) |
| Set if the window should float (be on top / topmost). | |
| void | setTakeScreenshot (bool takeScreenshot) |
| Set if the window should participate in screenshot taking. | |
| void | setWindowDecoration (bool state) |
| Set if window borders should be visible. | |
| void | setWindowResizable (bool state) |
| Set if the window should be resizable. | |
| void | setFixResolution (bool state) |
| Force the framebuffer to a fixed size which may be different from the window size. | |
| bool | isFixResolution () const |
| void | setHorizFieldOfView (float hFovDeg) |
| float | horizFieldOfViewDegrees () const |
| Get FOV of viewport[0]. | |
| void | setCallDraw2DFunction (bool state) |
| Set if the specified Draw2D function pointer should be called for this window. | |
| void | setCallDraw3DFunction (bool state) |
| Set if the specified Draw3D function pointer should be called for this window. | |
| void | setStereoMode (StereoMode sm) |
| Set the stereo mode. | |
| StereoMode | stereoMode () const |
| bool | isStereo () const |
| unsigned int | frameBufferTextureEye (Eye eye) const |
Static Public Member Functions | |
| static void | makeSharedContextCurrent () |
| static void | initNvidiaSwapGroups () |
| Init Nvidia swap groups if supported by hardware. | |
| static void | resetSwapGroupFrameNumber () |
| Force a restore of the shared OpenGL context. | |
| static void | setBarrier (bool state) |
| static bool | isBarrierActive () |
| static bool | isUsingSwapGroups () |
| static unsigned int | swapGroupFrameNumber () |
|
strong |
| sgct::Window::Window | ( | const config::Window & | window | ) |
| sgct::Window::~Window | ( | ) |
| void sgct::Window::addViewport | ( | std::unique_ptr< Viewport > | vpPtr | ) |
| float sgct::Window::aspectRatio | ( | ) | const |
| void sgct::Window::closeWindow | ( | ) |
| void sgct::Window::draw | ( | ) |
| ivec2 sgct::Window::framebufferResolution | ( | ) | const |
Get the dimensions of the final FBO.
Regular viewport rendering renders directly to this FBO but a fisheye renders first a cubemap and then to the final FBO. Post effects are rendered using these dimensions.
| unsigned int sgct::Window::frameBufferTextureEye | ( | Eye | eye | ) | const |
| bool sgct::Window::hasTag | ( | std::string_view | tag | ) | const |
| float sgct::Window::horizFieldOfViewDegrees | ( | ) | const |
Get FOV of viewport[0].
| int sgct::Window::id | ( | ) | const |
| void sgct::Window::initialize | ( | ) |
Initialize window buffers such as textures, FBOs, VAOs, VBOs and PBOs.
| void sgct::Window::initializeContextSpecific | ( | ) |
|
static |
Init Nvidia swap groups if supported by hardware.
Supported hardware is NVidia Quadro graphics card + sync card or AMD/ATI FireGL graphics card + sync card.
|
static |
| bool sgct::Window::isFixResolution | ( | ) | const |
| bool sgct::Window::isFocused | ( | ) | const |
| bool sgct::Window::isOpenXREnabled | ( | ) | const |
| bool sgct::Window::isRenderingWhileHidden | ( | ) | const |
| bool sgct::Window::isStereo | ( | ) | const |
|
static |
| bool sgct::Window::isVisible | ( | ) | const |
| bool sgct::Window::isWindowResized | ( | ) | const |
| void sgct::Window::makeOpenGLContextCurrent | ( | ) |
|
static |
| const std::string & sgct::Window::name | ( | ) | const |
| bool sgct::Window::needsCompatibilityProfile | ( | ) | const |
| void sgct::Window::openWindow | ( | GLFWwindow * | share, |
| bool | isLastWindow ) |
This function is used to open the window.
| share | The context that is shared between windows. May be nullptr |
| isLastWindow | Whether this is the last window. This is required to know as we only want to set the vsync setting once per node |
| void sgct::Window::renderFBOTexture | ( | ) |
| void sgct::Window::renderScreenQuad | ( | ) | const |
|
static |
Force a restore of the shared OpenGL context.
| vec2 sgct::Window::scale | ( | ) | const |
| void sgct::Window::setAutoiconify | ( | bool | shouldAutoiconify | ) |
Sets whether a full screen window should automatically iconify when losing focus.
|
static |
| void sgct::Window::setCallDraw2DFunction | ( | bool | state | ) |
Set if the specified Draw2D function pointer should be called for this window.
| void sgct::Window::setCallDraw3DFunction | ( | bool | state | ) |
Set if the specified Draw3D function pointer should be called for this window.
| void sgct::Window::setFixResolution | ( | bool | state | ) |
Force the framebuffer to a fixed size which may be different from the window size.
| void sgct::Window::setFloating | ( | bool | floating | ) |
Set if the window should float (be on top / topmost).
| void sgct::Window::setFramebufferResolution | ( | ivec2 | resolution | ) |
Sets the framebuffer resolution.
These parameters will only be used if a fixed resolution is used that is different from the window resolution.
| resolution | The width and height of the frame buffer in pixels |
| void sgct::Window::setFullscreen | ( | bool | fullscreen | ) |
Set if fullscreen mode should be used.
| void sgct::Window::setHorizFieldOfView | ( | float | hFovDeg | ) |
| void sgct::Window::setName | ( | std::string | name | ) |
Name this window.
| void sgct::Window::setRenderWhileHidden | ( | bool | state | ) |
Set if window should render while hidden.
Normally a window pauses the rendering if it's hidden.
| void sgct::Window::setStereoMode | ( | StereoMode | sm | ) |
Set the stereo mode.
Set this mode in your init callback or during runtime in the post-sync-pre-draw callback. GLSL shaders will be recompliled if needed.
| void sgct::Window::setTags | ( | std::vector< std::string > | tags | ) |
Tag this window.
Tags are seperated by comma.
| void sgct::Window::setTakeScreenshot | ( | bool | takeScreenshot | ) |
Set if the window should participate in screenshot taking.
| void sgct::Window::setVisible | ( | bool | state | ) |
Set the visibility state of this window.
If a window is hidden the rendering for that window will be paused unless it's forced to render while hidden by using setRenderWhileHidden.
| void sgct::Window::setWindowDecoration | ( | bool | state | ) |
Set if window borders should be visible.
| void sgct::Window::setWindowResizable | ( | bool | state | ) |
Set if the window should be resizable.
| bool sgct::Window::shouldTakeScreenshot | ( | ) | const |
| StereoMode sgct::Window::stereoMode | ( | ) | const |
| void sgct::Window::swapBuffers | ( | bool | takeScreenshot | ) |
Swap previous data and current data.
This is done at the end of the render loop.
|
static |
| void sgct::Window::update | ( | ) |
| void sgct::Window::updateFrustums | ( | float | nearClip, |
| float | farClip ) |
| void sgct::Window::updateResolutions | ( | ) |
| const std::vector< std::unique_ptr< Viewport > > & sgct::Window::viewports | ( | ) | const |
| GLFWwindow * sgct::Window::windowHandle | ( | ) | const |
| ivec2 sgct::Window::windowSize | ( | ) | const |