nCine::Backends::Qt5GfxDevice class

Graphics device that wraps a Qt5 Qt5Widget.

Drives an IGfxDevice whose surface and OpenGL context are owned by the hosting QOpenGLWidget, so most window operations are delegated to Qt5.

Base classes

class nCine::IGfxDevice
Represents the interface to the graphics device where everything is rendered.

Constructors, destructors, conversion operators

Qt5GfxDevice(const WindowMode& windowMode, const GLContextInfo& glContextInfo, const DisplayMode& displayMode, Qt5Widget& widget)

Public functions

void setSwapInterval(int interval) override
Sets the number of vertical blanks to occur before a buffer swap.
void setResolution(bool fullscreen, int width = 0, int height = 0) override
Sets the screen resolution with two integers.
void update() override
Updates the screen by swapping the back and front buffers.
void setWindowPosition(int x, int y) override
Sets the position of the application window with two integers.
void setWindowTitle(const char* windowTitle) override
void setWindowIcon(const char* windowIconFilename) override
auto windowPositionX() const -> int override
auto windowPositionY() const -> int override
auto windowPosition() const -> const Vector2i override
Returns the window position as a Vector2i object.
void flashWindow() const override
Highlights the application window to notify the user.
auto currentVideoMode() const -> const VideoMode& override
auto setVideoMode(unsigned int modeIndex) -> bool override
Sets the video mode used in full screen by the monitor that hosts the window.
void updateVideoModes() override
void resetTextureBinding()
Clears the engine's cached texture binding so Qt5's GL state is not assumed.
void bindDefaultDrawFramebufferObject()
Binds the widget's default draw framebuffer object.

Protected functions

void setResolutionInternal(int width, int height) override

Function documentation

void nCine::Backends::Qt5GfxDevice::setSwapInterval(int interval) override

Sets the number of vertical blanks to occur before a buffer swap.

An interval of -1 will enable adaptive v-sync if available.

bool nCine::Backends::Qt5GfxDevice::setVideoMode(unsigned int modeIndex) override

Sets the video mode used in full screen by the monitor that hosts the window.