cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
IContext.hpp
Go to the documentation of this file.
1///
2/// @file IContext.hpp
3/// @brief This file contains the IContext interface
4/// @namespace cae
5///
6
7#pragma once
8
10
11#include <glad/gl.h>
12
13namespace cae
14{
15 ///
16 /// @interface IContext
17 /// @brief Interface for OpenGL context
18 /// @namespace cae
19 ///
21 {
22 public:
23 virtual ~IContext() = default;
24
25 ///
26 /// @param window The native window handle
27 /// @brief Initialize the OpenGL context with the given window
28 ///
29 virtual void initialize(const NativeWindowHandle &window) = 0;
30
31 ///
32 /// @brief Swap the front and back buffers
33 ///
34 virtual void swapBuffers() = 0;
35
36 ///
37 /// @param enabled Whether VSync should be enabled
38 /// @brief Enable or disable VSync
39 ///
40 virtual void setVSyncEnabled(bool enabled) = 0;
41
42 ///
43 /// @return Whether VSync is enabled
44 /// @brief Check if VSync is enabled
45 ///
46 [[nodiscard]] virtual bool isVSyncEnabled() const = 0;
47
48 GladGLContext gl{nullptr};
49
50 }; // interface IContext
51
52} // namespace cae
This file contains the Window interface.
Interface for OpenGL context.
Definition IContext.hpp:21
GladGLContext gl
Definition IContext.hpp:48
virtual void swapBuffers()=0
Swap the front and back buffers.
virtual bool isVSyncEnabled() const =0
Check if VSync is enabled.
virtual void initialize(const NativeWindowHandle &window)=0
Initialize the OpenGL context with the given window.
virtual void setVSyncEnabled(bool enabled)=0
Enable or disable VSync.
virtual ~IContext()=default
Struct for native window handle.
Definition IWindow.hpp:34