diff options
Diffstat (limited to 'Editor/GUI/GUIWindow.cpp')
-rw-r--r-- | Editor/GUI/GUIWindow.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index 3df0370..34d7705 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -1,6 +1,7 @@ #include "EditorWindows.h" #include "WinUtils.h" #include "Runtime/Graphics/OpenGL.h" +#include "Editor/Graphics/Graphics.h" static bool RedirectMouseWheel(HWND window, WPARAM wParam, LPARAM lParam) { @@ -223,10 +224,12 @@ void GUIWindow::Init(std::string name) ShowWindow(m_Handle, SW_SHOW); - if (!SetRenderContext()) + bool bRC = SetRenderContext(); + if (!bRC) log_error("Failed to setup rendering context"); log_info("Created GUIWindow " /*+ (long)this*/); + } bool GUIWindow::SetRenderContext() @@ -288,6 +291,15 @@ bool GUIWindow::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; + } return true; } |