home *** CD-ROM | disk | FTP | other *** search
/ World of Graphics / WOGRAPH.BIN / 479.NAMES.C < prev    next >
C/C++ Source or Header  |  1993-03-07  |  3KB  |  104 lines

  1. /****************************************************************************
  2. *
  3. *                        MegaGraph Graphics Library
  4. *
  5. *                   Copyright (C) 1993 Kendall Bennett.
  6. *                            All rights reserved.
  7. *
  8. * Filename:        $RCSfile: names.c $
  9. * Version:        $Revision: 1.1 $
  10. *
  11. * Language:        ANSI C
  12. * Environment:    IBM PC (MS DOS)
  13. *
  14. * Description:    Module for determining the names of specific video
  15. *                drivers and modes.
  16. *
  17. * $Id: names.c 1.1 1993/03/03 10:47:24 kjb Exp $
  18. *
  19. * Revision History:
  20. * -----------------
  21. *
  22. * $Log: names.c $
  23. * Revision 1.1  1993/03/03  10:47:24  kjb
  24. * Initial revision
  25. *
  26. ****************************************************************************/
  27.  
  28. #include "drivers.h"
  29.  
  30. /*------------------------- Implementation --------------------------------*/
  31.  
  32. #include "modes.inc"            /* Symbolic video mode and driver names    */
  33.  
  34. PUBLIC char *MGL_modeName(int mode)
  35. /****************************************************************************
  36. *
  37. * Function:        MGL_modeName
  38. * Parameters:    mode    - Mode number to retrieve name for
  39. * Returns:        Pointer to the string for the mode
  40. *
  41. * Description:    Obtains a string describing the video mode 'mode' supported
  42. *                by the currently active video configuration.
  43. *
  44. ****************************************************************************/
  45. {
  46.     if (0 <= mode && mode <= grMAXMODE)
  47.         return modeNames[mode];
  48.     else
  49.         return "Invalid graphics mode";
  50. }
  51.  
  52. PUBLIC char *MGL_driverName(int driver)
  53. /****************************************************************************
  54. *
  55. * Function:        MGL_driverName
  56. * Parameters:    driver    - Driver number to retrieve name for
  57. * Returns:        Pointer to the string describing the driver
  58. *
  59. * Description:    Obtains a string describing the device driver given it's
  60. *                number.
  61. *
  62. ****************************************************************************/
  63. {
  64.     if (grDETECT <= driver && driver < grUSER)
  65.         return driverNames[driver];
  66.     else
  67.         return "User graphics driver";
  68. }
  69.  
  70. PUBLIC char *MGL_dacName(int dac)
  71. /****************************************************************************
  72. *
  73. * Function:        MGL_dacName
  74. * Parameters:    dac        - Video DAC id
  75. * Returns:        Pointer to the string describing the DAC
  76. *
  77. ****************************************************************************/
  78. {
  79.     if (0 <= dac && dac <= 3)
  80.         return dacNames[dac];
  81.     else
  82.         return "Unknown DAC";
  83. }
  84.  
  85. PUBLIC char *MGL_chipsetName(int driver,int chipset)
  86. /****************************************************************************
  87. *
  88. * Function:        MGL_chipsetName
  89. * Parameters:    driver    - Driver id
  90. *                chipset    - Chipset id
  91. * Returns:        Pointer to the string describing the chipset
  92. *
  93. ****************************************************************************/
  94. {
  95.     if ((__FIRST_SVGA+1) <= driver && driver <= __LAST_SVGA) {
  96.         if (chipsetNames[driver - __FIRST_SVGA - 1] == NULL)
  97.             return NULL;
  98.         else
  99.             return chipsetNames[driver - __FIRST_SVGA - 1][chipset];
  100.         }
  101.     else
  102.         return "Invalid driver!";
  103. }
  104.