Dodo 0.1
Template for CPP projects
Loading...
Searching...
No Matches
GLFWContext.hpp
Go to the documentation of this file.
1//
2// Created by nicol on 21/02/2026.
3//
4
5#ifndef DODO_GLFWCONTEXT_HPP
6#define DODO_GLFWCONTEXT_HPP
7
8#include <string>
9#include <expected>
10#include <format>
11#include <utility>
12
13#include "GLFW/glfw3.h"
14
15namespace dodo::core {
16
17class DodoContext;
18
20 private:
21 static inline bool _initialized = false;
22 bool _ownsContext = false;
23 public:
25
26 GLFWContext(const GLFWContext &other) = delete;
27
28 GLFWContext &operator=(const GLFWContext &other) = delete;
29
30 GLFWContext(GLFWContext &&other) noexcept;
31
32 GLFWContext &operator=(GLFWContext &&other) noexcept;
33
34 private:
35 GLFWContext() = default;
36
37 static auto createContext() -> std::expected<GLFWContext, std::string>;
38
39 friend class DodoContext;
40};
41
42}
43#endif // DODO_GLFWCONTEXT_HPP
Definition DodoContext.hpp:15
Definition GLFWContext.hpp:19
bool _ownsContext
Definition GLFWContext.hpp:22
GLFWContext & operator=(const GLFWContext &other)=delete
~GLFWContext()
Definition GLFWContext.cpp:29
static bool _initialized
Definition GLFWContext.hpp:21
GLFWContext(const GLFWContext &other)=delete
static auto createContext() -> std::expected< GLFWContext, std::string >
Definition GLFWContext.cpp:11
The header of the GLFW 3 API.
Definition App.cpp:7