summaryrefslogtreecommitdiff
path: root/Editor/GUI/ContainnerWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Editor/GUI/ContainnerWindow.cpp')
-rw-r--r--Editor/GUI/ContainnerWindow.cpp11
1 files changed, 11 insertions, 0 deletions
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)