diff options
author | chai <chaifix@163.com> | 2019-08-16 08:54:08 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-16 08:54:08 +0800 |
commit | a077eb38b01292611f4f6031b75e3e2c1c20f06e (patch) | |
tree | 8f760483d7b0290952bbdb5bcd8f3943102aeb3a /Source/tests/win32/01-window | |
parent | 6a065c913e9308cc72e1ad0723b6167048f439b6 (diff) |
Diffstat (limited to 'Source/tests/win32/01-window')
-rw-r--r-- | Source/tests/win32/01-window/03_sub_menu.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Source/tests/win32/01-window/03_sub_menu.cpp b/Source/tests/win32/01-window/03_sub_menu.cpp index fed841d..9c4ee85 100644 --- a/Source/tests/win32/01-window/03_sub_menu.cpp +++ b/Source/tests/win32/01-window/03_sub_menu.cpp @@ -28,7 +28,7 @@ void AddMenus(HWND); HWND wnd; HWND wnd2; -AEMath::Recti viewport; +Recti viewport; string vert = R"( @@ -172,16 +172,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, case WM_SIZE: { - if (g_Device.Inited()) + if (g_GfxDevice.Inited()) { RECT rect; GetClientRect(hwnd, &rect); viewport.Set(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); - g_Device.SetViewport(viewport); + g_GfxDevice.SetViewport(viewport); } } case WM_PAINT: - if (!g_Device.Inited()) + if (!g_GfxDevice.Inited()) break; glEnable(GL_BLEND); glEnable(GL_DEPTH_TEST); @@ -206,28 +206,28 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, { int imgLoc = shader->GetUniformLocation("img"); - int code = g_Device.GetError(); - g_Device.SetActiveShader(shader); + int code = g_GfxDevice.GetError(); + g_GfxDevice.SetActiveShader(shader); shader->SetUniformTexture(imgLoc, *img); - g_Device.SetMatrixMode(MATRIX_MODE_PROJECTION); - g_Device.LoadIdentity(); - g_Device.Ortho(0, viewport.w, viewport.h, 0, -1, 1); - g_Device.SetMatrixMode(MATRIX_MODE_MODEL); - g_Device.LoadIdentity(); - g_Device.Translate(100, 100); - shader->SetUniformMatrix44(locs.m, g_Device.GetMatrix(MATRIX_MODE_MODEL)); - shader->SetUniformMatrix44(locs.v, g_Device.GetMatrix(MATRIX_MODE_VIEW)); - shader->SetUniformMatrix44(locs.p, g_Device.GetMatrix(MATRIX_MODE_PROJECTION)); + g_GfxDevice.SetMatrixMode(MATRIX_MODE_PROJECTION); + g_GfxDevice.LoadIdentity(); + g_GfxDevice.Ortho(0, viewport.w, viewport.h, 0, -1, 1); + g_GfxDevice.SetMatrixMode(MATRIX_MODE_MODEL); + g_GfxDevice.LoadIdentity(); + g_GfxDevice.Translate(100, 100); + shader->SetUniformMatrix44(locs.m, g_GfxDevice.GetMatrix(MATRIX_MODE_MODEL)); + shader->SetUniformMatrix44(locs.v, g_GfxDevice.GetMatrix(MATRIX_MODE_VIEW)); + shader->SetUniformMatrix44(locs.p, g_GfxDevice.GetMatrix(MATRIX_MODE_PROJECTION)); shader->SetAttribute(locs.pos, vb, 0, 4); shader->SetAttribute(locs.tex, vb, 2, 4); - g_Device.SetDrawColor(1, 1, 0, 1); - shader->SetUniformColor(locs.color, g_Device.GetDrawColor()); + g_GfxDevice.SetDrawColor(1, 1, 0, 1); + shader->SetUniformColor(locs.color, g_GfxDevice.GetDrawColor()); //glLineWidth(1); - g_Device.DrawArrays(GL_LINE_STRIP, 0, 5); - //g_Device.DrawArrays(GL_TRIANGLE_STRIP, 0, 4); + g_GfxDevice.DrawArrays(GL_LINE_STRIP, 0, 5); + //g_GfxDevice.DrawArrays(GL_TRIANGLE_STRIP, 0, 4); shader->DisableAttribute(locs.pos); shader->DisableAttribute(locs.tex); - g_Device.SetActiveShader(NULL); + g_GfxDevice.SetActiveShader(NULL); } glFlush(); BeginPaint(hwnd, &ps); EndPaint(hwnd, &ps); @@ -263,7 +263,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, RECT rect; GetWindowRect(hwnd, &rect); viewport.Set(0, 0, rect.right - rect.left, rect.bottom - rect.top); - if (!g_Device.Init(viewport)) + if (!g_GfxDevice.Init(viewport)) return 0; imgdata->Decode(db); |