nCine::Backends::GlfwGfxDevice class

The GLFW based graphics device.

Base classes

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

Constructors, destructors, conversion operators

GlfwGfxDevice(const WindowMode& windowMode, const GLContextInfo& glContextInfo, const DisplayMode& displayMode)
~GlfwGfxDevice() override

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 screen resolution with two integers.
void update() override
Updates the screen swapping back and front buffers.
void setWindowPosition(int x, int y) override
Sets the position of the application window with two integers.
void setWindowSize(int width, int height) override
Sets the window size with two integers.
void setWindowTitle(StringView windowTitle) override
Sets the application window title.
void setWindowIcon(StringView iconFilename) override
Sets the application window icon.
auto windowPosition() const -> const Vector2i override
Returns window position as a Vector2i object.
void flashWindow() const override
Highlights the application window to notify the user.
auto primaryMonitorIndex() const -> unsigned int override
Returns the array index of the primary monitor.
auto windowMonitorIndex() const -> unsigned int override
Returns the array index of the monitor associated with the window.
auto currentVideoMode(unsigned int monitorIndex) const -> const VideoMode& override
Returns the current video mode for the specified monitor.
auto setVideoMode(unsigned int modeIndex) -> bool override
Sets the video mode that will be used in full screen by the monitor that hosts the window.

Protected functions

void setResolutionInternal(int width, int height) override
void updateMonitors() override
Updates the array of connected monitors.

Function documentation

void nCine::Backends::GlfwGfxDevice::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

void nCine::Backends::GlfwGfxDevice::setWindowSize(int width, int height) override

Sets the window size with two integers.

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

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