From 26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 30 Oct 2021 22:59:42 +0800 Subject: *TextGenerator --- Editor/GUI/GUIWindow.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'Editor/GUI/GUIWindow.cpp') 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); -- cgit v1.1-26-g67d0