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