Just™ Game Engine
graphics_context.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2022 Konstanty Misiak
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#pragma once
8#include "core/base.hpp"
9
10namespace jng {
11
12 class Window;
13
15 {
16 public:
17 explicit GraphicsContext(Window& window);
18 ~GraphicsContext() = default;
19
20 void setVSync(bool enabled);
21 bool isVSync() const { return m_isVSync; }
22 void swapBuffers() const;
23 private:
24 struct Hint { int id; int value; };
25 static std::array<Hint, 4> getContextCreationHints();
26
27 Window& m_window;
28 bool m_isVSync;
29
30 friend class Window;
31 };
32
33} // namespace jng
Definition: graphics_context.hpp:15
GraphicsContext(Window &window)
Definition: graphics_context_ogl.cpp:71
~GraphicsContext()=default
void swapBuffers() const
Definition: graphics_context_ogl.cpp:112
friend class Window
Definition: graphics_context.hpp:30
void setVSync(bool enabled)
Definition: graphics_context_ogl.cpp:106
bool isVSync() const
Definition: graphics_context.hpp:21
Definition: window.hpp:20
Definition: base.hpp:11