summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-01-28 14:21:08 +0000
committerJose Fonseca <jfonseca@vmware.com>2016-01-28 14:21:08 +0000
commitfca1062e8bdeaff6bedcd43fba718a0f78aa3c77 (patch)
treec099a1751ad2424993b7e2ce1c5ede1a80b86222
parent2e693775c38caca6d9a31620523448973563ce04 (diff)
downloadmesa-demos-fca1062e8bdeaff6bedcd43fba718a0f78aa3c77.zip
mesa-demos-fca1062e8bdeaff6bedcd43fba718a0f78aa3c77.tar.xz
wgl: Minor cleanups to wglfont.
Ensure things get destroyed, and use the full 256 range. Trivial.
-rw-r--r--src/wgl/wglfont.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/wgl/wglfont.c b/src/wgl/wglfont.c
index 2e448ec..d61195f 100644
--- a/src/wgl/wglfont.c
+++ b/src/wgl/wglfont.c
@@ -68,7 +68,7 @@ main(int argc, char *argv[])
pfd.dwFlags = PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = 24;
- pfd.cDepthBits = 24;
+ pfd.cDepthBits = 0;
pfd.iLayerType = PFD_MAIN_PLANE;
iPixelFormat = ChoosePixelFormat(hdc, &pfd);
@@ -87,9 +87,12 @@ main(int argc, char *argv[])
wglMakeCurrent(hdc, hglrc);
+ glClearColor(0.0, 0.0, 0.0, 1.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
SelectObject(hdc, GetStockObject(SYSTEM_FONT));
- wglUseFontBitmaps(hdc, 0, 255, 1000);
+ wglUseFontBitmaps(hdc, 0, 256, 1000);
glListBase(1000);
@@ -99,5 +102,13 @@ main(int argc, char *argv[])
Sleep(1000);
+ wglMakeCurrent(NULL, NULL);
+
+ wglDeleteContext(hglrc);
+
+ ReleaseDC(hwnd, hdc);
+
+ DestroyWindow(hwnd);
+
return 0;
}