Adding glew as OpenGL initialization in a different scope
This commit is contained in:
parent
b8c9268911
commit
66e43ba333
5 changed files with 60 additions and 19 deletions
16
include/opengl_context.hpp
Normal file
16
include/opengl_context.hpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// Created by postaron on 05/01/2026.
|
||||
//
|
||||
|
||||
#ifndef WINDOWGLFWGLLIB_OPENGL_CONTEXT_HPP
|
||||
#define WINDOWGLFWGLLIB_OPENGL_CONTEXT_HPP
|
||||
|
||||
namespace gui {
|
||||
class Window;
|
||||
}
|
||||
|
||||
namespace opengl {
|
||||
[[nodiscard]] bool init_glew(const gui::Window &win) noexcept;
|
||||
}
|
||||
|
||||
#endif //WINDOWGLFWGLLIB_OPENGL_CONTEXT_HPP
|
||||
|
|
@ -16,6 +16,8 @@ namespace gui {
|
|||
public:
|
||||
using modulesType = std::unordered_map<std::string, data::BasicData *>;
|
||||
using windowPtr = GLFWwindow *;
|
||||
static constexpr int default_width{ 1280 };
|
||||
static constexpr int default_height{ 720 };
|
||||
|
||||
private:
|
||||
static void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods);
|
||||
|
|
@ -32,8 +34,6 @@ namespace gui {
|
|||
|
||||
modulesType modules;
|
||||
|
||||
bool valid{ false };
|
||||
|
||||
explicit Window(const bool debugOpengl,
|
||||
const GLFWframebuffersizefun framebufferCallback,
|
||||
GLFWwindow *shared,
|
||||
|
|
@ -76,7 +76,7 @@ namespace gui {
|
|||
|
||||
void color_10_bits() noexcept;
|
||||
|
||||
bool check_color_depth(int color_depth) noexcept;
|
||||
[[nodiscard]] bool check_color_depth(int color_depth) noexcept;
|
||||
|
||||
void opengl_debug() noexcept;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue