Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>flash graphics</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Flash Graphics

   Flash Graphics is a set of graphics routines for the IBM PC (and
   compatibles) to interface to the Zortech C and C++ compilers. They are
   optimized for speed and size with most of the code being written in
   assembly language. Support is provided for the following display types:
   Hercules, EGA (color and the monochrome modes), CGA, VGA, the IBM 8514A

   and the Toshiba 3100. Specific support is provided for the high
   resolution modes of some display adaptors.

   The initialization routine recognizes most graphics boards and
   automatically configures for the graphics board available. A manual over-
   ride is possible through either an environment variable or at compile
   time. There are two libraries available, which will work correctly with
   all supported memory models. One is a debug library that does range
   checking on most variables passed to the functions. If an error is
   detected then fg_assert is called with an error message. This is to
   provide some help in finding difficult to locate program bugs. There is a
   small penalty paid in both size and speed with this library and so a
   non-debug version is available for use with fully debugged code.

The Files fg.h and readme.fg

   The header file fg.h must be included in any modules using these
   functions and variables. Some of the function calls are macros and will
   result in unresolved externals if the header file is not used.


   Previous versions of Flash Graphics used different header files for each
   operating system, causing considerable confusion. This has now been
   changed so that there is only one header file for all operating systems.
   It is recommended that all previously compiled Flash Graphics programs
   should be recompiled with the current fg.h header file.

   Zortech is committed to the continuing improvement of the Flash Graphics
   package. Of necessity this means that at times the software supplied is
   more up to date than the documentation. Therefore, treat any information
   in the file readme.fg contained in the readme directory as authoritative.
   However, there are a number of functions defined in the header file, fg.h
   that are not documented. If a function is not documented either in the
   manual or in the file readme.fg, then do not use it! Such functions are
   liable to change, or could cause unexpected results.

Definition of Basic Coordinate System

   FG uses a right-handed coordinate system with its origin at the bottom
   left of the drawing area. The origin is taken as x = 0, y = 0, where x
   and y are pixel coordinates.


Variable Types Defined


   fg_coord_t       Type for an individual coordinate variable.

   fg_box_t         Type for coordinate box. There are four coordinate
                    variables in the box, FG_X1, FG_Y1, FG_X2, FG_Y2. Boxes
                    must be normalized before being passed to the graphics
                    functions. A normalized box is one whose FG_X1
                    coordinate is less than or equal to the FG_X2 coordinate
                    and FG_Y1 coordinate is less than or equal to the FG_Y2
                    coordinate. In other words, the first point of a box is
                    always the lower left corner and the second is always
                    the upper right corner.

   fg_pbox_t        Pointer to a box.

   fg_const_pbox_t  Pointer to a box that will never be changed.


   fg_line_t        The type for a line. Lines use the same constants for
                    indexes that boxes do, but have no need to be normalized
                    before being passed to the functions.

   fg_color_t       The type for a color.

   fg_pline_t       Pointer to a line.

   fg_const_pline_t Pointer to a line that will never be changed.

   fg_handle_t      A "handle" for a saved area of the screen. See fg_save and
                    fg_restore .


Constants Defined by FG

   Constants are indicated by upper case names. These are defined in the
   header file fg.h. They should always be referred to by the name and never
   the value that the macro in the header file expands to.


   They are subject to change in future versions of the graphics package.

Graphics Display Adaptors

   Important-Not all the display types are supported under OS/2. See later
   for details.

   Values returned from fg_init (see description of fg_init for more
   information). The global fg_display is set to the same value. fg_init
   will attempt to determine which graphics device is connected. This can be
   overridden at run time by using the environment variable FG_DISPLAY and
   setting it to one of the values below. E.g FG_DISPLAY=HERCFULL

   NULL             All graphics are routed to bit bucket

   CGAHIRES         IBM CGA in 640 x 200 x 2 color mode

   CGAMEDRES        IBM CGA in 320x200 x 4 color mode

   EGACOLOR         IBM EGA with regular color display in 640 x 200 x 16 color

                    mode

   EGAECD           IBM EGA with enhanced color display in 640 x 350 x 16
                    color mode

   EGALOWRES        IBM EGA with enhanced color display in 320 x 200 x 16
                    color mode

   EGAMONO          IBM EGA with IBM monochrome monitor in 640 x 350 x 4 color
                    mode

   EVGAHIRES        Everex EVGA board in 800 x 600 x 16 color mode.

   HERCFULL         Hercules monochrome in 2 display pages x 2 color mode

   HERCHALF         Hercules monochrome in 1 display page x 2 colors

   HERC             Hercules monochrome, fg_init to determine whether 1 or 2
                    pages


   ORCHIDPROHIRES   Orchid ProDesigner VGA in 800 x 600 x 16 color mode

   PARADISEHIRES    Paradise VGA in 800 x 600 x 16 color mode

   TOSHIBA          Toshiba 3100 in 640 x 400 x 2 color mode

   TRIDENTHIRES     Trident VGA in 800 x 600 x 16 color mode
                    VEGAVGAHIRES    Video 7 Vega VGA board in 800 x 600 x 16
                    color mode

   VESA6A           VESA mode 0x6A, 800 x 600 x 16 color mode

   VESA2            VESA mode 0x102, 800 x 600 x 16 color mode

   VGA11            IBM VGA in 640 x 480 x 2 color mode (0x11)

   VGA12            IBM VGA in 640 x 480 x 16 color mode (0x12)

   VGA13            IBM VGA in mode 320 x 200 x 256 color mode (0x13)


   8514A            IBM 8514A display adaptor.


Box and Line Indexes FG_X1, FG_Y1, FG_X2, FG_Y2

   Used as indexes into boxes and lines, as in fg.displaybox. [FG_X1] refers
   to the x coordinate of the left side of the display.

   The relationship of the FG_X? and FG_Y? indexes to the coordinates of a
   box or line within Flash Graphics is based on an origin at bottom left of
   the display context. These constants should be used to put data into the
   fg_box and line arrays rather than the absolute values to avoid problems
   with display adapters that may use a different coordinate system.

Masks

   Mask constants are passed to nearly all functions to indicate the bits on
   which to perform the desired operations. The mask only has utility on
   boards that support more than two colors. For boards like the EGA which
   supports 16 simultaneous colors in the high resolution mode there are 4

   bits in the mask that may be utilized by the programmer in some fashion.
   Whatever the board, the significant mask bits are always packed into the
   low order bits.

   In most cases the application will want to write to all the bit planes.
   Using a value of ~0 will ensure this. Controlling which bit planes the
   functions operate on is useful for:

   1. If you have 2 planes (2bits/pixel), you can draw a different image on
   each plane. By then changing the color map, the planes can be
   independently turned on or off, creating an animation effect.

   2. The cursor could be written to its own plane, thus making it
   independent of the other graphics.

Writing Modes

   One of the following is passed to nearly all functions to indicate the
   type of operation to perform on the screen.


   FG_MODE_XOR     Mode value for XORing colors on to the screen.

   FG_MODE_SET     Mode value for setting colors on to the screen.

       Types of Lines

   One of the following values is passed to the line drawing functions to
   indicate the type of line to draw.

   FG_LINE_SOLID
   FG_LINE_LONG_DASH
   FG_LINE_MEDIUM_DOTTED
   FG_LINE_DASH_DOTTED
   FG_LINE_MEDIUM_DASHED
   FG_LINE_DASH_W_2_DOTS
   FG_LINE_SHORT_DASH
   FG_LINE_DENSE_DOTTED
   FG_LINE_SPARSE_DOTTED
   FG_LINE_USER_DEFINED


   The last of these line types, FG_LINE_USER_DEFINED, is undefined by Flash
   Graphics and can be defined by the application program with
   fg_setlinepattern.

   The value FG_LINE_MAX is the maximum number of line types defined at one
   time.

Available Colors

   This is the value that must be passed to functions as arguments for the
   color of lines, dots, boxes, etc. Due to the variety of graphics boards
   supported no one board supplies all the following colors. Some supply
   only two, Flash Graphics is defined such that there will always be at
   least two of the same colors available on all boards supported.

   These values are the defaults. If you change the palette (color map), the
   names will no longer match the colors that they provide. If a color is
   not available, it will expand to -1. These values are not valid before
   fg_init is called.


   FG_BLACK              Available on all systems
   FG_BLUE
   FG_GREEN
   FG_CYAN
   FG_BLUE_GREEN         Blue-green - same as cyan.
   FG_RED
   FG_MAGENTA
   FG_PURPLE             Purple - same as magenta
   FG_YELLOW
   FG_WHITE              Available on all systems
   FG_GRAY
   FG_LIGHT_BLUE
   FG_LIGHT_GREEN
   FG_LIGHT_CYAN
   FG_LIGHT_BLUE_GREEN   Light blue-green = light cyan
   FG_LIGHT_RED
   FG_LIGHT_MAGENTA
   FG_BROWN
   FG_LIGHT_WHITE
   FG_HIGHLIGHT          Normally an intense white. This is always

                         available but may be the same as FG_WHITE
   FG_BLINK              Blinking white

Public Structure

   A predefined structure contains information useful to the application
   program. The structure is fg, the various members are defined below.
   Values of these members are garbage until fg_init is called. They are
   garbage after fg_term() is called. The values (except fg.activepage and
   fg.displaypage) never change between fg_init and fg_term- none of them
   must ever be modified by the application.





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson