summaryrefslogtreecommitdiff
path: root/source/tests/win32/01-window/03_sub_menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/tests/win32/01-window/03_sub_menu.cpp')
-rw-r--r--source/tests/win32/01-window/03_sub_menu.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/source/tests/win32/01-window/03_sub_menu.cpp b/source/tests/win32/01-window/03_sub_menu.cpp
index d34f4ed..86bcc76 100644
--- a/source/tests/win32/01-window/03_sub_menu.cpp
+++ b/source/tests/win32/01-window/03_sub_menu.cpp
@@ -168,16 +168,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
case WM_SIZE:
{
- if (gfx.Inited())
+ if (g_Device.Inited())
{
RECT rect;
GetClientRect(hwnd, &rect);
viewport.Set(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
- gfx.SetViewport(viewport);
+ g_Device.SetViewport(viewport);
}
}
case WM_PAINT:
- if (!gfx.Inited())
+ if (!g_Device.Inited())
break;
glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
@@ -202,28 +202,28 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
{
int imgLoc = shader->GetUniformLocation("img");
- int code = gfx.GetError();
- gfx.SetActiveShader(shader);
+ int code = g_Device.GetError();
+ g_Device.SetActiveShader(shader);
shader->SetUniformTexture(imgLoc, *img);
- gfx.SetMatrixMode(MATRIX_MODE_PROJECTION);
- gfx.LoadIdentity();
- gfx.Ortho(0, viewport.w, viewport.h, 0, -1, 1);
- gfx.SetMatrixMode(MATRIX_MODE_MODEL);
- gfx.LoadIdentity();
- gfx.Translate(100, 100);
- shader->SetUniformMatrix44(locs.m, gfx.GetMatrix(MATRIX_MODE_MODEL));
- shader->SetUniformMatrix44(locs.v, gfx.GetMatrix(MATRIX_MODE_VIEW));
- shader->SetUniformMatrix44(locs.p, gfx.GetMatrix(MATRIX_MODE_PROJECTION));
+ 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));
shader->SetAttribute(locs.pos, vb, 0, 4);
shader->SetAttribute(locs.tex, vb, 2, 4);
- gfx.SetDrawColor(1, 1, 0, 1);
- shader->SetUniformColor(locs.color, gfx.GetDrawColor());
+ g_Device.SetDrawColor(1, 1, 0, 1);
+ shader->SetUniformColor(locs.color, g_Device.GetDrawColor());
//glLineWidth(1);
- gfx.DrawArrays(GL_LINE_STRIP, 0, 5);
- //gfx.DrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ g_Device.DrawArrays(GL_LINE_STRIP, 0, 5);
+ //g_Device.DrawArrays(GL_TRIANGLE_STRIP, 0, 4);
shader->DisableAttribute(locs.pos);
shader->DisableAttribute(locs.tex);
- gfx.SetActiveShader(NULL);
+ g_Device.SetActiveShader(NULL);
}
glFlush();
BeginPaint(hwnd, &ps); EndPaint(hwnd, &ps);
@@ -259,7 +259,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 (!gfx.Init(viewport))
+ if (!g_Device.Init(viewport))
return 0;
imgdata->Decode(db);