Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Print list of fbconfigs and test each to see if a pbuffer can be created
  3. * for that config.
  4. *
  5. * Brian Paul
  6. * April 1997
  7. * Updated on 5 October 2002.
  8. */
  9. #include <X11/Xlib.h>
  10. #include <stdio.h>
  11. #include <string.h>
  12. #include "pbutil.h"
  13. static void
  14. PrintConfigs(Display *dpy, int screen, Bool horizFormat)
  15. {
  16. FBCONFIG *fbConfigs;
  17. int nConfigs;
  18. int i;
  19. fbConfigs = GetAllFBConfigs(dpy, screen, &nConfigs);
  20. if (!nConfigs || !fbConfigs) {
  21. printf("Error: glxGetFBConfigs failed\n");
  22. return;
  23. }
  24. printf("Number of fbconfigs: %d\n", nConfigs);
  25. if (horizFormat) {
  26. printf(" ID VisualType Depth Lvl RGB CI DB Stereo R G B A");
  27. printf(" Z S AR AG AB AA MSbufs MSnum Pbuffer Float\n");
  28. }
  29. /* Print config info */
  30. for (i = 0; i < nConfigs; i++) {
  31. PrintFBConfigInfo(dpy, screen, fbConfigs[i], horizFormat);
  32. }
  33. /* free the list */
  34. XFree(fbConfigs);
  35. }
  36. static void
  37. PrintUsage(void)
  38. {
  39. printf("Options:\n");
  40. printf(" -display <display-name> specify X display name\n");
  41. printf(" -t print in tabular format\n");
  42. printf(" -v print in verbose format\n");
  43. printf(" -help print this information\n");
  44. }
  45. int
  46. main(int argc, char *argv[])
  47. {
  48. Display *dpy;
  49. int scrn;
  50. char *dpyName = NULL;
  51. Bool horizFormat = True;
  52. int i;
  53. for (i=1; i<argc; i++) {
  54. if (strcmp(argv[i],"-display")==0) {
  55. if (i+1<argc) {
  56. dpyName = argv[i+1];
  57. i++;
  58. }
  59. }
  60. else if (strcmp(argv[i],"-t")==0) {
  61. /* tabular format */
  62. horizFormat = True;
  63. }
  64. else if (strcmp(argv[i],"-v")==0) {
  65. /* verbose format */
  66. horizFormat = False;
  67. }
  68. else if (strcmp(argv[i],"-help")==0) {
  69. PrintUsage();
  70. return 0;
  71. }
  72. else {
  73. printf("Unknown option: %s\n", argv[i]);
  74. }
  75. }
  76. dpy = XOpenDisplay(dpyName);
  77. if (!dpy) {
  78. printf("Error: couldn't open display %s\n", XDisplayName(dpyName));
  79. return 1;
  80. }
  81. scrn = DefaultScreen(dpy);
  82. PrintConfigs(dpy, scrn, horizFormat);
  83. XCloseDisplay(dpy);
  84. return 0;
  85. }