Demos (master): wglinfo: pass the options object to print_screen_info()

Brian Paul brianp at kemper.freedesktop.org
Mon May 25 15:03:49 UTC 2015


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri May 15 15:50:58 2015 -0600

wglinfo: pass the options object to print_screen_info()

To reduce the number of parameters.

Acked-by: Matt Turner <mattst88 at gmail.com>

---

 src/wgl/wglinfo.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/wgl/wglinfo.c b/src/wgl/wglinfo.c
index 42bf3a7..8693450 100644
--- a/src/wgl/wglinfo.c
+++ b/src/wgl/wglinfo.c
@@ -79,8 +79,7 @@ WndProc(HWND hWnd,
 
 
 static void
-print_screen_info(HDC _hdc, GLboolean limits, GLboolean singleLine,
-                  GLboolean coreProfile, InfoMode mode)
+print_screen_info(HDC _hdc, const struct options *opts, GLboolean coreProfile)
 {
    WNDCLASS wc;
    HWND win;
@@ -253,9 +252,9 @@ print_screen_info(HDC _hdc, GLboolean limits, GLboolean singleLine,
        */
 
       if (!coreProfile) {
-         if (wglExtensions && mode != Brief) {
+         if (wglExtensions && opts->mode != Brief) {
             printf("WGL extensions:\n");
-            print_extension_list(wglExtensions, singleLine);
+            print_extension_list(wglExtensions, opts->singleLine);
          }
          printf("OpenGL vendor string: %s\n", glVendor);
          printf("OpenGL renderer string: %s\n", glRenderer);
@@ -286,12 +285,12 @@ print_screen_info(HDC _hdc, GLboolean limits, GLboolean singleLine,
       }
 #endif
 
-      if (mode != Brief) {
+      if (opts->mode != Brief) {
          printf("%s extensions:\n", oglString);
-         print_extension_list(glExtensions, singleLine);
+         print_extension_list(glExtensions, opts->singleLine);
       }
 
-      if (limits) {
+      if (opts->limits) {
          print_limits(glExtensions, oglString, version, &extfuncs);
       }
    }
@@ -646,9 +645,9 @@ main(int argc, char *argv[])
       printf("%d\n", b);
    }
    else {
-      print_screen_info(hdc, opts.limits, opts.singleLine, GL_FALSE, opts.mode);
+      print_screen_info(hdc, &opts, GL_FALSE);
       printf("\n");
-      print_screen_info(hdc, opts.limits, opts.singleLine, GL_TRUE, opts.mode);
+      print_screen_info(hdc, &opts, GL_TRUE);
       printf("\n");
       if (opts.mode != Brief) {
          print_visual_info(hdc, opts.mode);




More information about the mesa-commit mailing list