Demos (master): wgl: Minor cleanups to wglfont.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Jan 28 14:28:46 UTC 2016


Module: Demos
Branch: master
Commit: fca1062e8bdeaff6bedcd43fba718a0f78aa3c77
URL:    http://cgit.freedesktop.org/mesa/demos/commit/?id=fca1062e8bdeaff6bedcd43fba718a0f78aa3c77

Author: Jose Fonseca <jfonseca at vmware.com>
Date:   Thu Jan 28 14:21:08 2016 +0000

wgl: Minor cleanups to wglfont.

Ensure things get destroyed, and use the full 256 range.

Trivial.

---

 src/wgl/wglfont.c | 15 +++++++++++++--
 1 file 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;
 }




More information about the mesa-commit mailing list