diff options
Diffstat (limited to 'Editor/GUI/GUIWindow.cpp')
-rw-r--r-- | Editor/GUI/GUIWindow.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/Editor/GUI/GUIWindow.cpp b/Editor/GUI/GUIWindow.cpp index fddc68d..eb44647 100644 --- a/Editor/GUI/GUIWindow.cpp +++ b/Editor/GUI/GUIWindow.cpp @@ -293,21 +293,6 @@ bool GUIWindow::SetRenderContext() int pf = 0; DescribePixelFormat(m_DC, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd); - if (!(m_RC = wglCreateContext(m_DC))) // Are We Able To Get A Rendering Context? - { - MessageBox(NULL, "Can't Create A GL Rendering Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION); - 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; } @@ -345,8 +330,7 @@ void GUIWindow::SetPosition(Internal::Rect position) void GUIWindow::SetAsRenderContext() { Assert(m_DC != NULL); - Assert(m_RC != NULL); - Assert(wglMakeCurrent(m_DC, m_RC)); + Assert(wglMakeCurrent(m_DC, g_GLRC)); RECT rect; GetWindowRect(m_Handle, &rect); glViewport(0, 0, rect.right - rect.left, rect.bottom - rect.top); |