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.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/source/tests/win32/01-window/03_sub_menu.cpp b/source/tests/win32/01-window/03_sub_menu.cpp
index bd3f7b6..58386ac 100644
--- a/source/tests/win32/01-window/03_sub_menu.cpp
+++ b/source/tests/win32/01-window/03_sub_menu.cpp
@@ -50,6 +50,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLin
}
HDC hdc;
HGLRC glc;
+HGLRC glc2;
static PAINTSTRUCT ps;
HBRUSH hBrush;
HBRUSH hOldBrush;
@@ -58,6 +59,7 @@ HPEN hOldPen;
PIXELFORMATDESCRIPTOR pfd;
int pf;
File* file;
+File* file2;
DataBuffer db(102400);
AEIO::Filesystem* fs;
ImageData* imgdata = new ImageData();
@@ -89,7 +91,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
// ͼƬ
fs = AEIO::Filesystem::Get();
fs->Mount(".", "root");
- file = new File("root/img.png");
+ file = new File("root/img.jpg");
file->Open(File::FILE_MODE_READ);
file->ReadAll(&db);
@@ -102,7 +104,16 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
imgdata->Decode(db);
img = new Image();
- img->Refresh(imgdata);
+ img->Renew(imgdata);
+
+ wglMakeCurrent(hdc, glc);
+
+ file2 = new File("root/img.png");
+ file2->Open(File::FILE_MODE_READ);
+ file2->ReadAll(&db);
+ imgdata->Decode(db);
+ img->Renew(imgdata, {50, 100});
+ delete imgdata;
break;
@@ -142,21 +153,19 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg,
glBindTexture(GL_TEXTURE_2D, tex); //
glEnable(GL_TEXTURE_2D); //2Dӳ
-
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); //Sͼ
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); //Tͼ
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); //Ŵ˷ʽ
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); //С˷ʽ
-
glBegin(GL_QUADS);
- glTexCoord2f(0.0f, 0.0f);
- glVertex3f(-1.0f, -1.0f, 0.0f);
- glTexCoord2f(1.0f, 0.0f);
- glVertex3f(0.5f, -0.5f, 0.0f);
- glTexCoord2f(1.0f, 1.0f);
- glVertex3f(1.0f, 1.0f, 0.0f);
glTexCoord2f(0.0f, 1.0f);
+ glVertex3f(-0.5f, -0.5f, 0.0f);
+ glTexCoord2f(1.0f, 1.0f);
+ glVertex3f(0.5f, -0.5f, 0.0f);
+ glTexCoord2f(1.0f, 0.0f);
+ glVertex3f(0.5f, 0.5f, 0.0f);
+ glTexCoord2f(0.0f, 0.0f);
glVertex3f(-0.5f, 0.5f, 0.0f);
glEnd();