2
0
Эх сурвалжийг харах

Improve glfwinfo extension listing

Camilla Berglund 9 жил өмнө
parent
commit
c2efe87cff
1 өөрчлөгдсөн 11 нэмэгдсэн , 7 устгасан
  1. 11 7
      tests/glfwinfo.c

+ 11 - 7
tests/glfwinfo.c

@@ -159,23 +159,27 @@ static void list_extensions(int api, int major, int minor)
         glGetIntegerv(GL_NUM_EXTENSIONS, &count);
 
         for (i = 0;  i < count;  i++)
-            puts((const char*) glGetStringi(GL_EXTENSIONS, i));
+            printf(" %s\n", (const char*) glGetStringi(GL_EXTENSIONS, i));
     }
     else
     {
         extensions = glGetString(GL_EXTENSIONS);
         while (*extensions != '\0')
         {
-            if (*extensions == ' ')
-                putchar('\n');
-            else
+            putchar(' ');
+
+            while (*extensions != '\0' && *extensions != ' ')
+            {
                 putchar(*extensions);
+                extensions++;
+            }
+
+            while (*extensions == ' ')
+                extensions++;
 
-            extensions++;
+            putchar('\n');
         }
     }
-
-    putchar('\n');
 }
 
 static int valid_version(void)