home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / FGMISC10.ZIP / MISC.DOC < prev    next >
Encoding:
Text File  |  1993-10-26  |  6.3 KB  |  155 lines

  1.  
  2.                               Miscellaneous Code
  3.  
  4.                           Copyright 1993 Diana Gruber
  5.  
  6. This is free source code, and as such, it is worth about what you paid for it.
  7. It is provided as-is, without any warranties, express or otherwise (whatever
  8. that means). You may use this code in your own programs with my blessing, and
  9. if you have any questions or need technical support, give me a call.
  10.  
  11. Files in the distribution:
  12. -------------------------
  13.  
  14. AREAS.EXE    -- example of how to use the mouse to detect "hot spots"
  15. AREAS.C      -- source code for areas program
  16.  
  17. SCROLLTX.EXE -- example of horizontal text scrolling
  18. SCROLLTX.C   -- source code for scrolling program
  19. SCROLLTX.H   -- function declarations
  20.  
  21. GUI.EXE      -- GUI menu program
  22. GUI.C        -- main source code file for menu program
  23. GUI.H        -- function declarations
  24.  
  25. MENU.C       -- menu functions
  26. MENU.H       -- function declarations
  27.  
  28. CHAR.C       -- bitmapped characters, put_string and get_string functions
  29. CHAR.H       -- function declarations
  30.  
  31. COMMON.C     -- code we use a lot -- initialization, termination, etc.
  32. COMMON.H     -- function declarations
  33.  
  34. DEFS.H       -- miscellaneous includes, declares, and defines
  35.  
  36. MISC.DOC     -- this file
  37.  
  38. WORK         -- the file I used with the Microsoft Make utility
  39.  
  40. FILE_ID.DIZ  -- bbs description for sysops
  41.  
  42. Compiling and linking:
  43. ---------------------
  44.  
  45. I compiled AREAS, GUI, and SCROLLTX using the Microsoft C medium model. You
  46. can use use the following compile commands:
  47.  
  48.    Borland C++     BCC -mm AREAS.C FGM.LIB
  49.                    BCC -mm GUI.C COMMON.C CHAR.C MENU.C FGM.LIB
  50.                    BCC -mm SCROLLTX.C COMMON.C CHAR.C FGM.LIB
  51.  
  52.    Microsoft C     CL /AM AREAS.C /link FGM.LIB /E
  53.                    CL /AM GUI.C COMMON.C CHAR.C MENU.C /link FGM.LIB /E
  54.                    CL /AM SCROLLTX.C COMMON.C CHAR.C /link FGM.LIB /E
  55.  
  56.    QuickC          QCL /AM AREAS.C /link FGM.LIB /E
  57.                    QCL /AM GUI.C COMMON.C CHAR.C MENU.C /link FGM.LIB /E
  58.                    QCL /AM SCROLLTX.C COMMON.C CHAR.C /link FGM.LIB /E
  59.  
  60.    Turbo C/C++     TCC -mm AREAS.C FGM.LIB
  61.                    TCC -mm GUI.C COMMON.C CHAR.C MENU.C FGM.LIB
  62.                    TCC -mm SCROLLTX.C COMMON.C CHAR.C FGM.LIB
  63.  
  64.    Zortech C++     ZTC -mm AREAS.C FGM.LIB
  65.                    ZTC -mm GUI.C COMMON.C CHAR.C MENU.C FGM.LIB
  66.                    ZTC -mm SCROLLTX.C COMMON.C CHAR.C FGM.LIB
  67.  
  68. All three programs require Fastgraph or Fastgraph/Light to link. If you are
  69. using Fastgraph/Light, replace the "FGM" with "FGLM".
  70.  
  71. Functionality:
  72. -------------
  73.  
  74. The GUI menu code is similar to that used in the FGDEMO program, but much
  75. simplified. This program doesn't do anything useful. It just displays the
  76. pull-down menus with nonsensical messages on them. You can plug in your own
  77. menu items and functions. This code is intended to be used as a template for
  78. more sophisticated programs.
  79.  
  80. The only menu items that work are on the first menu. If you select "load" you
  81. will get some fields and you can enter file names. I put this code in there
  82. because people are always asking me how to enter strings in a graphics mode.
  83. This is how you do it. You will probably want to modify this function for your
  84. own requirements. There is also a pop-up help screen that works with this
  85. function. Press F1 to see it. Again, this is a dummy help screen. Create your
  86. own if you want it to do something useful.
  87.  
  88. The "shell" function on this menu shells to DOS. Type "exit" to return to the
  89. menu program.
  90.  
  91. The "exit" function terminates the program, as does pressing ESC.
  92.  
  93. The SCROLLTX program scrolls a line of text horizontally in a window. It does
  94. this by drawing the text 8 times on the hidden page and using fg_transfer to
  95. transfer the text in sequence to the visual page. Each copy of the text is
  96. offset by one pixel. We need to do it this way because fg_transfer operates on
  97. byte boundaries. There are other solutions to the problem of how to scroll
  98. text horizontally, but this is probably the most efficient solution in terms
  99. of speed. One pixel horizontal scolling is not terribly fast. The easiest way
  100. to double the speed is to double the scroll increment. That is, scroll by two
  101. pixels instead of one. This would also mean you would need half as many copies
  102. of the text on the hidden page, or 4 copies instead of 8.
  103.  
  104. The AREAS program draws four rectangles on the screen and displays the mouse
  105. cursor. When you move the mouse around, it detects the color under the mouse
  106. and displays a message. The source code stores the mouse areas and function
  107. calls in structures, which, in my opinion, is the proper approach to this kind
  108. of problem.
  109.  
  110. To exit either AREAS or SCROLLTX, press ESC.
  111.  
  112. Video modes:
  113. -----------
  114.  
  115. The GUI menu program runs in mode X (320x240x256). The AREAS program runs in
  116. standard MCGA (320x200x256). The SCROLLTX program runs in EGA mode 13
  117. (320x200x16). These programs can be easily adapted to run in just about any
  118. video mode.
  119.  
  120. About Fastgraph:
  121. ---------------
  122.  
  123. Fastgraph is a programmer's graphics library most commonly used for writing
  124. games, but useful for other graphics applications as well. For more
  125. information about Fastgraph, contact:
  126.  
  127.    Ted Gruber Software
  128.    P.O. Box 13408
  129.    Las Vegas, NV 89112
  130.    (702) 735-1980 (voice)
  131.    (702) 735-4603 (fax)
  132.    (702) 796-7134 (bbs)
  133.  
  134. Other source code files:
  135. -----------------------
  136.  
  137. If you liked this source code, you may be interested in the following files
  138. available on our bbs:
  139.  
  140.   FGDEMO30.ZIP  -- Grand tour demo of Fastgraph's functions with source
  141.                    code, includes some animation functions
  142.   FGFADE10.ZIP  -- Palette fade for 256 color modes
  143.   FGFISH10.ZIP  -- A fish tank example, showing a smooth non-destructive
  144.                    animation technique
  145.   FGFX10.ZIP    -- Fastgraph Effects. Source code for fades and wipes,
  146.                    including spirals, curtains, etc.
  147.   FGHEDGE10.ZIP -- Hedge Row, and SVGA maze game with constricted
  148.                    mouse support and a recursive maze solution algorithm.
  149.   FGXMAS10.ZIP  -- An animated Christmas card with a falling snow effect
  150.  
  151. These are just a few of the files available on our bulletin board, and we will
  152. be adding more in the future. Most of these programs were written by me and
  153. there are also some excellent programs written by other Fastgraph users for
  154. you to download.
  155.