cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
EGLContext.hpp
Go to the documentation of this file.
1///
2/// @file EGLContext.hpp
3/// @brief This file contains the EGLContext_ class declaration
4/// @namespace cae
5///
6
7#pragma once
8
9#ifdef __linux__
10
12
13#include <EGL/egl.h>
14
15namespace cae
16{
17
18 ///
19 /// @class EGLContext_
20 /// @brief Implementation of IContext for Linux using EGL
21 /// @namespace cae
22 ///
23 class EGLContext_ final : public IContext
24 {
25 public:
26 explicit EGLContext_() = default;
27 ~EGLContext_() override;
28
29 void initialize(const NativeWindowHandle &window) override;
30
31 void swapBuffers() override;
32
33 void setVSyncEnabled(bool enabled) override;
34 [[nodiscard]] bool isVSyncEnabled() const override
35 {
36 // EGL does not provide a direct way to query VSync status
37 return false;
38 }
39
40 private:
41 EGLDisplay m_display = EGL_NO_DISPLAY;
42 EGLSurface m_surface = EGL_NO_SURFACE;
43 EGLContext m_context = EGL_NO_CONTEXT;
44
45 }; // class EGLContext_
46
47} // namespace cae
48
49#endif
This file contains the IContext interface.