vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::WindowSurface Class Referenceabstract

What a graphics backend asks of the window it draws into: the window's one tie to an API. More...

#include <window_surface.h>

Public Member Functions

virtual void hint () const =0
 Ask GLFW for this surface, after glfwInit and before the window is created.
virtual std::string describe () const =0
 What hint() asks for, for a log line when the window cannot be made.
virtual void attach (GLFWwindow *window)=0
 Take the window it was hinted for and load the API on it, with vsync off.
virtual void present (GLFWwindow *window)=0
 Show the frame drawn into window.
virtual void setVSync (GLFWwindow *window, bool enabled)=0
 Wait for the display's refresh before presenting, or not.

Detailed Description

What a graphics backend asks of the window it draws into: the window's one tie to an API.

The window needs to know its surface before it exists - a context of some version, or none - and hands the window over once it does; presenting a frame and the swap interval are the API's too. A backend implements this beside its RenderBackend, and a host hands it to WindowManager::createWindow, so nothing in the engine names an API.

Member Function Documentation

◆ describe()

virtual std::string Vkm::Engine::WindowSurface::describe ( ) const
pure virtual

What hint() asks for, for a log line when the window cannot be made.

Returns
The API and version the hints ask for.

◆ attach()

virtual void Vkm::Engine::WindowSurface::attach ( GLFWwindow * window)
pure virtual

Take the window it was hinted for and load the API on it, with vsync off.

Parameters
windowThe new window.
Exceptions
std::runtime_errorwhen the API cannot be loaded on it.

◆ present()

virtual void Vkm::Engine::WindowSurface::present ( GLFWwindow * window)
pure virtual

Show the frame drawn into window.

Parameters
windowThe window attach() took.

◆ setVSync()

virtual void Vkm::Engine::WindowSurface::setVSync ( GLFWwindow * window,
bool enabled )
pure virtual

Wait for the display's refresh before presenting, or not.

Parameters
windowThe window attach() took.
enabledWhether to wait.

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