Fixing error to create the window in a safely way
This commit is contained in:
parent
ac620fb3b7
commit
aea1ee6822
2 changed files with 12 additions and 3 deletions
|
@ -12,9 +12,18 @@ namespace data {
|
|||
}
|
||||
|
||||
namespace gui {
|
||||
using modulesType = std::unordered_map<std::string, data::BasicData *>;
|
||||
class Window;
|
||||
|
||||
[[nodiscard]] static std::optional<Window> create_window(
|
||||
const GLFWerrorfun errorCallback,
|
||||
GLFWframebuffersizefun framebufferCallback,
|
||||
const bool debugOpengl,
|
||||
GLFWwindow *shared,
|
||||
std::initializer_list<modulesType::value_type> initializer) noexcept;
|
||||
|
||||
class Window final {
|
||||
public:
|
||||
using modulesType = std::unordered_map<std::string, data::BasicData *>;
|
||||
using windowPtr = GLFWwindow *;
|
||||
|
||||
private:
|
||||
|
@ -56,7 +65,7 @@ namespace gui {
|
|||
GLFWframebuffersizefun framebufferCallback,
|
||||
const bool debugOpengl,
|
||||
GLFWwindow *shared,
|
||||
std::initializer_list<Window::modulesType::value_type> initializer) noexcept;
|
||||
std::initializer_list<modulesType::value_type> initializer) noexcept;
|
||||
|
||||
~Window() noexcept;
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ namespace gui {
|
|||
const GLFWframebuffersizefun framebufferCallback,
|
||||
const bool debugOpengl,
|
||||
GLFWwindow *shared,
|
||||
const std::initializer_list<Window::modulesType::value_type> initializer
|
||||
const std::initializer_list<modulesType::value_type> initializer
|
||||
) noexcept {
|
||||
if (!init) {
|
||||
glfwSetErrorCallback(errorCallback);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue