vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
window_surface.h
1#pragma once
2
3#include <string>
4
5struct GLFWwindow;
6
7namespace Vkm::Engine {
8
17class WindowSurface {
18 public:
19 WindowSurface() = default;
20 virtual ~WindowSurface() = default;
21
22 WindowSurface(const WindowSurface& other) = delete;
23 WindowSurface& operator=(const WindowSurface& other) = delete;
24
25 WindowSurface(WindowSurface && other) = delete;
26 WindowSurface& operator=(WindowSurface && other) = delete;
27
28 public:
32 virtual void hint() const = 0;
33
39 virtual std::string describe() const = 0;
40
47 virtual void attach(GLFWwindow* window) = 0;
48
54 virtual void present(GLFWwindow* window) = 0;
55
62 virtual void setVSync(GLFWwindow* window, bool enabled) = 0;
63};
64
65} // namespace Vkm::Engine
virtual void setVSync(GLFWwindow *window, bool enabled)=0
Wait for the display's refresh before presenting, or not.
virtual void present(GLFWwindow *window)=0
Show the frame drawn into window.
virtual void hint() const =0
Ask GLFW for this surface, after glfwInit and before the window is created.
virtual void attach(GLFWwindow *window)=0
Take the window it was hinted for and load the API on it, with vsync off.
virtual std::string describe() const =0
What hint() asks for, for a log line when the window cannot be made.