summaryrefslogtreecommitdiff
path: root/Editor/GUI/GUIWindow.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-10-30 22:59:42 +0800
committerchai <chaifix@163.com>2021-10-30 22:59:42 +0800
commit26f05c6e3dcac9995345fb5a2b031be7e3ea79e9 (patch)
treefc32c3e9d235817df0be331a6100b7f8263facab /Editor/GUI/GUIWindow.cpp
parentc3e259f4d29e9bdcb73617ad8e4d71f117b4d289 (diff)
*TextGenerator
Diffstat (limited to 'Editor/GUI/GUIWindow.cpp')
-rw-r--r--Editor/GUI/GUIWindow.cpp18
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);