From 45328cbadd8a946c19a77301f218efbf650e2f28 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 18 Oct 2021 19:56:41 +0800 Subject: *misc --- Editor/GUI/ContainnerWindow.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Editor/GUI/ContainnerWindow.cpp') diff --git a/Editor/GUI/ContainnerWindow.cpp b/Editor/GUI/ContainnerWindow.cpp index 3778485..d6a67c9 100644 --- a/Editor/GUI/ContainnerWindow.cpp +++ b/Editor/GUI/ContainnerWindow.cpp @@ -5,6 +5,7 @@ #include "Editor/Utils/HelperFuncs.h" #include "MenuManager.h" #include "Runtime/Utilities/Assert.h" +#include "Editor/Graphics/Graphics.h" using namespace std; @@ -260,6 +261,15 @@ bool ContainnerWindow::SetRenderContext() return FALSE; // Return FALSE } + if (m_RC && !g_IsGLInitialized) + { + log_info("Initialize OpenGL"); + wglMakeCurrent(m_DC, m_RC); + if (!gladLoadGL()) { + log_error("初始化GL错误"); + } + g_IsGLInitialized = true; + } } // 初始化,创建窗口 @@ -388,6 +398,7 @@ void ContainnerWindow::Init(Rectf pixelRect, int showMode, const Vector2f& minSi //ShowInTaskbarIfNoMainWindow(m_Window); SetRenderContext(); + } void ContainnerWindow::SetTitle(const char* title) -- cgit v1.1-26-g67d0