home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / FGDEMO40.ZIP / SOURCE.COM / VIDEO.C < prev   
Text File  |  1995-02-12  |  10KB  |  327 lines

  1. /**********************************************************************\
  2. *                                                                      *
  3. *  video.c -- things on the video menu                                 *
  4. *                                                                      *
  5. \**********************************************************************/
  6.  
  7. #include "defs.h"
  8.  
  9. /**********************************************************************\
  10. *                                                                      *
  11. *  about_modes -- information about video modes                        *
  12. *                                                                      *
  13. \**********************************************************************/
  14.  
  15. int about_modes()
  16. {
  17.    static char *string[] = {
  18.    "Video Modes",
  19.    "Fastgraph supports 28 video modes, including 16-",
  20.    "and 256-color SVGA modes up to 1024x768. The",
  21.    "SVGA modes are implemented through an integrated",
  22.    "kernel, which provides the option of using fast",
  23.    "chipset-specific code or the VESA BIOS. Fastgraph's",
  24.    "SVGA kernel automatically detects over two dozen",
  25.    "distinct chipsets so you can concentrate on your",
  26.    "application and let Fastgraph handle the complexities",
  27.    "of supporting different SVGA chipsets.",
  28.    "",
  29.    "Fastgraph also offers four 256-color \"Mode X\"",
  30.    "resolutions, which are especially popular for game",
  31.    "development.",
  32.    "",
  33.    "FGDEMO is running in a 640x350x16 graphics mode."
  34.    };
  35.  
  36.    /* clear the screen and display the info window */
  37.  
  38.    fg_mousevis(OFF);
  39.    fg_restore(0,xlimit,menu_bottom,ylimit);
  40.    info_window(110,530,60,string,16);
  41.  
  42.    /* wait for keystroke or mouse button */
  43.  
  44.    fg_mousevis(ON);
  45.    wait_for_keystroke();
  46.  
  47.    /* clear the screen and return to the menu */
  48.  
  49.    fg_mousevis(OFF);
  50.    fg_restore(0,xlimit,menu_bottom,ylimit);
  51.  
  52.    fg_mousevis(ON);
  53.    redraw = TRUE;
  54.  
  55.    return(OK);
  56. }
  57.  
  58. /**********************************************************************\
  59. *                                                                      *
  60. *  auto_detect -- what modes are available on your machine?            *
  61. *                                                                      *
  62. \**********************************************************************/
  63.  
  64. int auto_detect()
  65. {
  66.    static char *description[] =
  67.    {
  68.       "an EGA/VGA",
  69.       "a VESA-compatible SVGA",
  70.       "an Ahead A",
  71.       "an Ahead B",
  72.       "an ATI 18800",
  73.       "an ATI 18800-1",
  74.       "an ATI 28800/38800/68800/88800",
  75.       "a Chips & Technologies 82c451/455/456",
  76.       "a Chips & Technologies 82c452",
  77.       "a Chips & Technologies 82c453",
  78.       "a Genoa 6000 series",
  79.       "an Oak OTI-067",
  80.       "a Paradise PVGA1a",
  81.       "a Paradise WD90C00/WD90C10",
  82.       "a Paradise WD90C11/30/31/33",
  83.       "a Trident 8800",
  84.       "a Trident 8900/9000",
  85.       "a Tseng ET3000",
  86.       "a Tseng ET4000",
  87.       "a Video7",
  88.       "a Cirrus Logic 5400 series",
  89.       "an S3",
  90.       "an NCR 77C22/77C32",
  91.       "an Oak OTI-077",
  92.       "an Oak OTI-087",
  93.       " ",
  94.       "a Cirrus Logic 6400 series",
  95.       "an Avance Logic 2000 series"
  96.    };
  97.  
  98.    static char *chipset_info[] =
  99.    {
  100.       "Autodetect",
  101.       "Fastgraph finds a Chips & Technologies 82c451/455/456",
  102.       "chipset with 1024 kilobytes video memory."
  103.    };
  104.  
  105.    register int i;
  106.  
  107.    i = fg_svgainit(0);
  108.    sprintf(chipset_info[1],"Fastgraph finds %s",description[i]);
  109.    sprintf(chipset_info[2],"chipset with %d kilobytes video memory.",fg_memory());
  110.  
  111.    fg_mousevis(OFF);
  112.    fg_restore(0,xlimit,menu_bottom,ylimit);
  113.    info_window(112,528,60,chipset_info,3);
  114.  
  115.    /* wait for keystroke or mouse button */
  116.  
  117.    fg_mousevis(ON);
  118.    wait_for_keystroke();
  119.  
  120.    /* clear the screen and return to the menu */
  121.  
  122.    fg_mousevis(OFF);
  123.    fg_restore(0,xlimit,menu_bottom,ylimit);
  124.  
  125.    fg_mousevis(ON);
  126.    redraw = TRUE;
  127.  
  128.    return(OK);
  129. }
  130.  
  131. /**********************************************************************\
  132. *                                                                      *
  133. *  coordinates -- information about coordinate systems                 *
  134. *                                                                      *
  135. \**********************************************************************/
  136.  
  137. int coordinates()
  138. {
  139.    static char *string[] = {
  140.    "Coordinate Systems",
  141.    "Fastgraph supports four coordinate systems: screen",
  142.    "space, viewports, world space, and character space.",
  143.    "",
  144.    "Screen space uses the pixel resolution of the current",
  145.    "video mode. Viewports let you assign an integer-based",
  146.    "coordinate system to a rectangular subset of the screen.",
  147.    "World space is a programmer-defined floating point",
  148.    "coordinate system, while character space is defined in",
  149.    "text-size rows and columns. You can use these different",
  150.    "systems interchangably in your Fastgraph programs."
  151.    };
  152.  
  153.    /* clear the screen and display the info window */
  154.  
  155.    fg_mousevis(OFF);
  156.    fg_restore(0,xlimit,menu_bottom,ylimit);
  157.    info_window(90,550,60,string,11);
  158.  
  159.    /* wait for keystroke or mouse button */
  160.  
  161.    fg_mousevis(ON);
  162.    wait_for_keystroke();
  163.  
  164.    /* clear the screen and return to the menu */
  165.  
  166.    fg_mousevis(OFF);
  167.    fg_restore(0,xlimit,menu_bottom,ylimit);
  168.  
  169.    fg_mousevis(ON);
  170.    redraw = TRUE;
  171.  
  172.    return(OK);
  173. }
  174.  
  175. /**********************************************************************\
  176. *                                                                      *
  177. *  logical_pages -- information about logical pages                    *
  178. *                                                                      *
  179. \**********************************************************************/
  180.  
  181. int logical_pages()
  182. {
  183.    static char *string[] = {
  184.    "Logical Pages",
  185.    "Logical pages let you swap out the contents of a",
  186.    "physical or virtual page to conventional memory,",
  187.    "expanded memory (EMS), or extended memory (XMS)",
  188.    "and then swap it back in when you need it. Logical",
  189.    "pages are available in all video modes."
  190.    };
  191.  
  192.    /* clear the screen and display the info window */
  193.  
  194.    fg_mousevis(OFF);
  195.    fg_restore(0,xlimit,menu_bottom,ylimit);
  196.    info_window(100,540,60,string,6);
  197.  
  198.    /* wait for keystroke or mouse button */
  199.  
  200.    fg_mousevis(ON);
  201.    wait_for_keystroke();
  202.  
  203.    /* clear the screen and return to the menu */
  204.  
  205.    fg_mousevis(OFF);
  206.    fg_restore(0,xlimit,menu_bottom,ylimit);
  207.  
  208.    fg_mousevis(ON);
  209.    redraw = TRUE;
  210.  
  211.    return(OK);
  212. }
  213.  
  214. /**********************************************************************\
  215. *                                                                      *
  216. *  physical_pages -- information about physical pages                  *
  217. *                                                                      *
  218. \**********************************************************************/
  219.  
  220. int physical_pages()
  221. {
  222.    static char *string[] = {
  223.    "Physical Pages",
  224.    "Physical pages are useful for fast image display",
  225.    "and animation. The number of physical pages",
  226.    "available is dependent on the video mode and the",
  227.    "amount of memory on your video card."
  228.    };
  229.  
  230.    /* clear the screen and display the info window */
  231.  
  232.    fg_mousevis(OFF);
  233.    fg_restore(0,xlimit,menu_bottom,ylimit);
  234.    info_window(120,520,60,string,5);
  235.  
  236.    /* wait for keystroke or mouse button */
  237.  
  238.    fg_mousevis(ON);
  239.    wait_for_keystroke();
  240.  
  241.    /* clear the screen and return to the menu */
  242.  
  243.    fg_mousevis(OFF);
  244.    fg_restore(0,xlimit,menu_bottom,ylimit);
  245.  
  246.    fg_mousevis(ON);
  247.    redraw = TRUE;
  248.  
  249.    return(OK);
  250. }
  251.  
  252. /**********************************************************************\
  253. *                                                                      *
  254. *  virtual_buffers -- information about virtual buffers                *
  255. *                                                                      *
  256. \**********************************************************************/
  257.  
  258. int virtual_buffers()
  259. {
  260.    static char *string[] = {
  261.    "Virtual Buffers",
  262.    "Virtual buffers are blocks of conventional memory",
  263.    "that you can treat as video memory. They are much",
  264.    "more general than virtual pages, as they are supported",
  265.    "in all graphics video modes and can be smaller or",
  266.    "larger than the actual page size."
  267.    };
  268.  
  269.    /* clear the screen and display the info window */
  270.  
  271.    fg_mousevis(OFF);
  272.    fg_restore(0,xlimit,menu_bottom,ylimit);
  273.    info_window(100,540,60,string,6);
  274.  
  275.    /* wait for keystroke or mouse button */
  276.  
  277.    fg_mousevis(ON);
  278.    wait_for_keystroke();
  279.  
  280.    /* clear the screen and return to the menu */
  281.  
  282.    fg_mousevis(OFF);
  283.    fg_restore(0,xlimit,menu_bottom,ylimit);
  284.  
  285.    fg_mousevis(ON);
  286.    redraw = TRUE;
  287.  
  288.    return(OK);
  289. }
  290.  
  291. /**********************************************************************\
  292. *                                                                      *
  293. *  virtual_pages -- information about virtual pages                    *
  294. *                                                                      *
  295. \**********************************************************************/
  296.  
  297. int virtual_pages()
  298. {
  299.    static char *string[] = {
  300.    "Virtual Pages",
  301.    "If you don't have enough memory on your video card",
  302.    "for physical pages, Fastgraph will let you use RAM to",
  303.    "create virtual pages in some video modes."
  304.    };
  305.  
  306.    /* clear the screen and display the info window */
  307.  
  308.    fg_mousevis(OFF);
  309.    fg_restore(0,xlimit,menu_bottom,ylimit);
  310.    info_window(100,540,60,string,4);
  311.  
  312.    /* wait for keystroke or mouse button */
  313.  
  314.    fg_mousevis(ON);
  315.    wait_for_keystroke();
  316.  
  317.    /* clear the screen and return to the menu */
  318.  
  319.    fg_mousevis(OFF);
  320.    fg_restore(0,xlimit,menu_bottom,ylimit);
  321.  
  322.    fg_mousevis(ON);
  323.    redraw = TRUE;
  324.  
  325.    return(OK);
  326. }
  327.