Fastgraph for Windows version 5.0 Published by Ted Gruber Software Distributed by the Coriolis Group (contact information below) Frequently Asked Questions about Fastgraph for Windows Last updated April 1998 What is Fastgraph for Windows? ------------------------------ Fastgraph for Windows is a set of linkable libraries (DLL's for Visual Basic) that provide low-level graphics capabilities in Windows similar to the graphics capabilities of Fastgraph for DOS. How does it work? ----------------- Until now, Windows graphics programming has generally involved using the Windows Graphics Device Interface (GDI) functions from the Windows API. The GDI functions support other output devices besides the video display, but the price of this generality is speed. This translates to the sluggish performance often associated with Windows graphics applications. Fastgraph for Windows solves this problem by providing a suite of fast assembly language graphics functions that operate on off-screen drawing surfaces called virtual buffers. The buffers are built much like video memory is built in the DOS version of Fastgraph. Functions are used to draw, paint, blit, apply sprites, double buffer, and otherwise build a screen of graphics in RAM. The GDI only comes into play when blitting the virtual buffer contents to the client window. Besides the traditional Windows GDI blitting, Fastgraph for Windows also provides transparent support for Microsoft's WinG and DirectDraw graphics extensions for even faster performance. What platforms does it work with? --------------------------------- Fastgraph for Windows works with Windows 3.1, Windows 95, Windows 98, or Windows NT (3.5 or later). The Win32 libraries use native 32-bit code. What about WinG and DirectDraw? ------------------------------- Fastgraph for Windows supports Microsoft's WinG and DirectDraw graphics extensions, but does not require them. Where can I get WinG and DirectDraw? ------------------------------------ WinG is a freeware product available from several places, including our internet ftp site. DirectDraw is available from Microsoft as part of the Windows 95 Game SDK on the MSDN Level II CD set, or from the Microsoft web page. What advantages does Fastgraph for Windows offer over DirectDraw? ----------------------------------------------------------------- Fastgraph for Windows offers advantages over DirectDraw in terms of functionality and ease of use. First, while DirectDraw is a powerful blitting engine and video memory manager, it is not sufficient for writing Windows graphics applications by itself. Once you have constructed an image or an animation frame, DirectDraw is great for copying or "blitting" it to the screen, but how do you build that image in the first place? That's where Fastgraph for Windows comes in, providing the graphics and animation tools needed to do just that. Fastgraph for Windows treats DirectDraw drawing surfaces just like its own virtual buffers, so you use the same code whether or not you're using DirectDraw. Second, if you've looked at the DirectDraw API, chances are you'll agree it's not the easiest API you've ever seen. Fastgraph for Windows shields you from the details of using the DirectDraw API by accessing DirectDraw at the assembly language level in Fastgraph's own functions. This lets you use Fastgraph's own intuitive, simpler API and still have access to DirectDraw's features. Finally, Fastgraph for Windows lets you use DirectDraw with more compilers and programming languages. DirectDraw works great with Visual C++, but try using it with the Borland, Watcom, or Symantec compilers. Maybe you prefer to use C instead of the C++ programming style DirectDraw imposes. Not a problem with Fastgraph for Windows. Want to use DirectDraw with Visual Basic, Delphi, C++Builder, or the Fortran PowerStation? Again, no problem. What compilers does it work with? --------------------------------- Fastgraph for Windows currently supports Borland C++, Borland C++Builder, Turbo C++ for Windows, Symantec C++, Visual C++, Watcom C/C++, Borland Pascal, Turbo Pascal for Windows, Delphi, Visual Basic, and the Microsoft Fortran PowerStation. How does Fastgraph for Windows compare to Fastgraph for DOS? ------------------------------------------------------------ Much of the functionality of Fastgraph for Windows is exactly the same as that of Fastgraph for DOS. Drawing a bitmapped sprite to a virtual buffer is the same whether using DOS or Windows, for example. The speed of the low-level functionality is comparable, but there is a degradation of speed involved in the event-driven Windows environment. This can't be helped; it's a feature of Windows. However, it is possible to write animated games that are quite playable on modern hardware (for example, a 486 or better). Can I port my DOS Fastgraph applications to Windows? ---------------------------------------------------- Sure! That's the whole point, after all. There are a few tricks involved. For some games, such as those that depend heavily on video-to-video blits, we have found porting works best as a two-step process. First port the game to DOS virtual buffers, and then port to Windows. Depending on how your game works, you may need to change calls such as fg_transfer() and fg_vbpaste() to fg_vbscale(). And of course you will need to add WinMain() and WinProc() functions. But these changes are straightforward enough, and in general porting from DOS to Windows is not difficult. How do Windows palettes work? ----------------------------- This is a very complicated subject. Windows reserves certain colors (usually the first and last ten colors) for its system colors. This is often one of the trickiest parts of developing Windows programs, but Fastgraph for Windows provides easy solutions to common palette problems. It integrates with the Windows palette manager to create and realize logical palettes. It offers automatic color reduction of BMP and PCX files if requested, and can apply the same color reduction methods to any rectangular area of a virtual buffer. In addition, the Fastgraph for Windows on-the-fly palette modification functions make it easy to perform palette animation and palette fades. Can I use the Windows fonts? ---------------------------- Yes. Fastgraph for Windows string display functions work with both Windows stock fonts and logical fonts created from external font files such as TrueType fonts. Strings are normally written directly to the program's client window, but if you're creating a Win32 program (or a Win16 program linked with Fastgraph's WinG libraries), you can also write strings to a virtual buffer. Can I print a virtual buffer? ----------------------------- Yes. Fastgraph for Windows allows you to print any rectangular region of a virtual buffer and provides several ways to define the size of the resulting printed image. What functions are in Fastgraph for Windows? -------------------------------------------- The following functions are available in Fastgraph 5.0 for Windows: fg_arc() draw circular arc in screen space fg_arcw() draw circular arc in world space fg_bmphead() read BMP file header fg_bmppal() read BMP palette fg_bmpsize() return BMP image dimensions fg_box() draw unfilled rectangle in screen space fg_boxdepth() define depth of rectangles drawn with box display routines fg_boxw() draw unfilled rectangle in world space fg_boxx() draw unfilled XOR rectangle in screen space fg_boxxw() draw unfilled XOR rectangle in world space fg_circle() draw unfilled circle in screen space fg_circlef() draw filled circle in screen space fg_circlefw() draw filled circle in world space fg_circlew() draw unfilled circle in world space fg_clip2vb() copy region from clipboard to virtual buffer fg_clipdcb() display direct color bitmap with clipping fg_clipmap() display monochrome bitmap with clipping fg_clipmask() display masking map with clipping fg_clpimage() display 256-color bitmap with transparency and clipping fg_clprect() display filled rectangle in screen space with clipping fg_clprectx() display filled XOR rectangle in screen space with clipping fg_clprectw() display filled rectangle in world space with clipping fg_colors() return display driver's color depth fg_copypage() copy one virtual buffer to another fg_dash() draw dashed line in screen space fg_dashrel() draw relative dashed line in screen space fg_dashrw() draw relative dashed line in world space fg_dashw() draw dashed line in world space fg_ddflip() flip DirectDraw surface fg_ddflipnw() flip DirectDraw surface without waiting for display hardware fg_ddfreedc() release DirectDraw device context fg_ddgetdc() create DirectDraw device context fg_ddgetobj() return pointer to requested DirectDraw object fg_ddlock() lock DirectDraw surface fg_ddsetup() set up DirectDraw full-screen video mode fg_ddstatus() return DirectDraw status fg_ddunlock() unlock DirectDraw surface fg_defcolor() assign color value to virtual color index fg_defpal() create logical palette with default colors fg_dispfile() display standard or packed pixel run file fg_display() display standard pixel run map fg_displayp() display packed pixel run map fg_draw() draw solid line in screen space fg_drawdcb() display direct color bitmap without clipping fg_drawmap() display monochrome bitmap fg_drawmask() display masking map fg_drawrel() draw relative solid line in screen space fg_drawrelx() draw relative XOR line in screen space fg_drawrw() draw relative solid line in world space fg_drawrxw() draw relative XOR line in world space fg_draww() draw solid line in world space fg_drawx() draw XOR line in screen space fg_drawxw() draw XOR line in world space fg_drect() draw dithered rectangle in screen space fg_drectw() draw dithered rectangle in world space fg_drwimage() display 256-color bitmap with transparency fg_ellipse() draw unfilled ellipse in screen space fg_ellipsef() draw filled ellipse in screen space fg_ellipsew() draw unfilled ellipse in world space fg_ellipsfw() draw filled ellipse in world space fg_erase() fill active virtual buffer with black pixels fg_fillpage() fill active virtual buffer with pixels of current color fg_findrgb() find closest matching color in logical palette fg_fixdiv() divide two fixed point quantities fg_fixed() convert floating point value to its fixed point equivalent fg_fixmul() multiply two fixed point quantities fg_fixtrig() return the fixed point cosine and sine of a given angle fg_flicdone() close flic file fg_flichead() read flic file header fg_flicopen() open flic file fg_flicplay() play one or more frames in flic file fg_flicsize() return flic file image dimensions fg_flicskip() skip one or more frames in flic file fg_flipdcb() display reversed direct color bitmap with clipping fg_flipmask() display reversed masking map fg_float() convert fixed point value to its floating point equivalent fg_flood() fill arbitrary closed region from seed pixel with clipping fg_floodw() world space version of fg_flood() fg_flpimage() display reversed clipped 256-color bitmap with transparency fg_fontdc() define text device context fg_fontload() load a Windows stock font fg_getblock() retrieve rectangular block from virtual buffer fg_getclip() return clipping limits fg_getclock() return number of clock ticks since midnight fg_getcolor() return current color index fg_getdacs() retrieve series of RGB values from logical palette fg_getdc() return handle to WinG device context fg_getdcb() retrieve direct color bitmap fg_getdepth() return color depth of active virtual buffer fg_gethpage() return background virtual buffer handle fg_getimage() retrieve 256-color bitmap fg_getindex() return color value assigned to virtual color index fg_getline() return address of specified scan line in active virtual buffer fg_getlines() return number of text rows in active virtual buffer fg_getmap() retrieve monochrome bitmap fg_getmaxx() return maximum screen space x coordinate fg_getmaxy() return maximum screen space y coordinate fg_getpage() return foreground virtual buffer handle fg_getpixel() return color of specified pixel fg_getrgb() retrieve RGB values for one color from logical palette fg_getview() return viewport extremes fg_getworld() return world space limits fg_getxbox() return horizontal box depth fg_getxjust() return horizontal text justification setting fg_getxpos() return horizontal graphics cursor position fg_getybox() return vertical box depth fg_getyjust() return vertical text justification setting fg_getypos() return vertical graphics cursor position fg_gouraud() draw Gouraud-shaded convex polygon fg_imagebuf() define size and address of internal image buffer fg_imagesiz() return 256-color bitmap memory requirements fg_initw() initialize world space coordinate system fg_inside() determine if point is inside convex polygon fg_invdcb() invert direct color bitmap orientation fg_invert() invert bitmap orientation fg_jpegbuf() specify buffer size and address for displaying JPEG files fg_jpeghead() read JPEG file header fg_jpegmem() return number of bytes required for the fg_jpegbuf() buffer fg_jpegsize() return JPEG image dimensions fg_justify() define text justification settings fg_kbtest() determine if specific key is pressed or released fg_loadpcx() display PCX file fg_locate() define text cursor position fg_logfont() activate logical font fg_logpal() create logical palette with custom colors fg_makebmp() create BMP file fg_makepcx() create PCX file fg_makeppr() create packed pixel run file fg_makespr() create standard pixel run file fg_mapdacs() translate RGB coordinates from DOS to Windows fg_maprgb() convert RGB color components to encoded color value fg_measure() benchmark system speed fg_memavail() determine amount of free global memory fg_modeset() change display resolution fg_modetest() check if display resolution is supported fg_mousecur() activate user-defined mouse cursor fg_mouseini() initialize mouse environment fg_mouselim() define mouse cursor limits fg_mousemov() move mouse cursor to specified position fg_mousepos() return mouse cursor position fg_mouseptr() create user-defined mouse cursor fg_mousesiz() define mouse cursor size fg_mousevis() define mouse cursor visibility fg_move() establish graphics cursor position in screen space fg_move3d() build 3D transformation matrix for absolute or relative move fg_moverel() establish relative graphics cursor position in screen space fg_moverw() establish relative graphics cursor position in world space fg_movew() establish graphics cursor position in world space fg_pack() convert 256-color bitmap to 16-color bitmap fg_pagesize() return virtual buffer memory requirements fg_paint() fill arbitrary closed region from seed pixel fg_paintw() world space version of fg_paint() fg_pcxhead() read PCX file header fg_pcxpal() read PCX palette fg_pcxrange() return PCX image extents fg_pcxsize() return PCX image dimensions fg_point() display pixel in screen space fg_pointw() display pixel in world space fg_pointx() display XOR pixel in screen space fg_pointxw() display XOR pixel in world space fg_polyedge() define polygon edge control fg_polyfill() draw filled convex polygon fg_polygon() draw unfilled polygon in screen space fg_polygonw() draw unfilled polygon in world space fg_polyline() draw unfilled polygon from single vertex array fg_polyoff() define polygon vertex offsets fg_print() display string in screen space fg_printer() issue printer request fg_project() project 3D (x,y,z) points to 2D (x,y) screen space points fg_putblock() display rectangular block retrieved with fg_getblock() fg_putdcb() display direct color bitmap without transparency fg_putimage() display 256-color bitmap without transparency fg_putpixel() display pixel in screen space without clipping fg_realize() activate logical palette fg_rect() draw filled rectangle in screen space fg_rectw() draw filled rectangle in world space fg_rectx() draw filled XOR rectangle in screen space fg_reduce() apply color reduction and remapping fg_restore() copy region from background virtual buffer fg_restorew() world space version of fg_restore() fg_revdcb() display reversed direct color bitmap without clipping fg_revimage() display reversed 256-color bitmap with transparency fg_revmask() display reversed masking map fg_rotate() perform arbitrary bitmap rotation fg_rotate3d() build 3D transformation matrix for absolute or relative rotation fg_rotdcb() rotate a direct color bitmap fg_rotsize() determine the dimensions of a rotated bitmap fg_save() copy region to background virtual buffer fg_savew() world space version of fg_save() fg_scale() scale a 256-color bitmap fg_scaledcb() scale a direct color bitmap fg_scroll() perform vertical scrolling fg_setalpha() define alpha channel value for virtual palette updates fg_setangle() define orientation of software characters fg_setclip() define clipping region in screen space fg_setclipw() define clipping region in world space fg_setcolor() establish current color index fg_setdacs() modify consecutive colors in logical palette fg_setdc() establish device context for blitting fg_sethpage() define background virtual buffer fg_setpage() define foreground virtual buffer fg_setratio() define aspect ratio for software characters fg_setrgb() modify one color in logical palette fg_setsize() define height of software characters in screen space fg_setsizew() define height of software characters in world space fg_setview() define viewport extremes fg_setworld() define world space limits fg_shear() shear a 256-color bitmap fg_sheardcb() shear a direct color bitmap fg_showbmp() display BMP file fg_showflic() play an FLI or FLC file fg_showjpeg() display JPEG file fg_showpcx() display PCX file fg_showppr() display packed pixel run file fg_showspr() display standard pixel run file fg_stall() delay program execution fg_swchar() display software characters fg_swlength() return length of software character string fg_swtext() display software characters (one font only) fg_tcdefine() define color transparency attributes fg_tcmask() define transparency attributes of first 16 colors fg_tcxfer() copy region between virtual buffers, with transparency fg_texmap() draw texture-mapped convex polygon fg_text() display string in character space fg_texture() define texture bitmap for fg_texmap() fg_transfer() copy region between virtual buffers fg_unmaprgb() extract RGB color components from an encoded color value fg_unpack() convert 16-color bitmap to 256-color bitmap fg_vb2clip() copy region from virtual buffer to clipboard fg_vbaddr() return virtual buffer address fg_vballoc() create virtual buffer fg_vbclose() close virtual buffer fg_vbcolors() assign logical palette colors to virtual buffer fg_vbcopy() copy region between virtual buffers fg_vbdefine() create virtual buffer from previously allocated memory fg_vbdepth() define virtual buffer color depth in bits per pixel fg_vbfin() terminate virtual buffer processing fg_vbfree() release virtual buffer memory fg_vbhandle() return handle of active virtual buffer fg_vbinit() initialize virtual buffer environment fg_vbopen() open virtual buffer fg_vbpaste() copy region from virtual buffer to window fg_vbprint() print region from virtual buffer, with scaling fg_vbscale() copy region from virtual buffer to window, with scaling fg_vbsize() return amount of memory needed for a virtual buffer fg_vbtccopy() copy region between virtual buffers, with transparency fg_vbundef() release virtual buffer handle fg_version() return Fastgraph for Windows version number fg_view3d() define the 3D viewport and projection ratio fg_waitfor() delay program execution fg_where() return text cursor position fg_xalpha() translate screen space x coordinate to character space fg_xclient() translate screen space x coordinate to client units fg_xconvert() translate character space column to screen space fg_xscreen() translate world space x coordinate to screen space fg_xvb() translate client area x coordinate to screen space fg_xview() translate viewport x coordinate to screen space fg_xworld() translate screen space x coordinate to world space fg_yalpha() translate screen space y coordinate to character space fg_yclient() translate screen space y coordinate to client units fg_yconvert() translate character space row to screen space fg_yscreen() translate world space y coordinate to screen space fg_yvb() translate client area y coordinate to screen space fg_yview() translate viewport y coordinate to screen space fg_yworld() translate screen space y coordinate to world space What is Fastgraph/Fonts for Windows? ------------------------------------ Fastgraph/Fonts for Windows is an add-on product that makes it easy to add bitmapped font support to Fastgraph for Windows applications. It includes 40 font files in several point sizes, font scaling and conversion utilities, and an interactive font editor. Requires Fastgraph for Windows. The following functions are available in Fastgraph/Fonts 5.0 for Windows: fgf_define() make externally loaded font data available to FG/Fonts fgf_drop() return extension amount for descender characters fgf_getxjust() return horizontal justification setting fgf_getyjust() return vertical justification setting fgf_handle() return current font handle fgf_height() determine height in pixels for a given string fgf_justify() define horizontal and vertical justification settings fgf_kerning() define kerning in pixels fgf_load() load font data from a font file; make it current font fgf_print() display string from the current font, without clipping fgf_printc() display string from the current font, with clipping fgf_select() make the selected font the current font fgf_space() define width of space character fgf_undefine() release font handle fgf_under() define underline position fgf_unload() release font handle and font memory fgf_version() return Fastgraph/Fonts for Windows version number fgf_width() determine width in pixels for a given string What is Fastgraph/Image for Windows? ------------------------------------ Fastgraph/Image for Windows is an add-on product that provides functions and utilities for managing resource files containing images and other files. While the product was designed to manage and display BMP, PCX, JPEG, FLI/FLC, and pixel run files stored in resource files, Fastgraph/Image can be used with any type of file, including bitmaps, text files, and Fastgraph/Fonts font files. Besides making your product distribution cleaner, Fastgraph/Image resource files save disk space normally lost to disk sectoring. Requires Fastgraph for Windows. The following functions are available in Fastgraph/Image 5.0 for Windows: fgi_bmphead() read header of BMP file stored in FGI library fgi_bmppal() retrieve palette of BMP file stored in FGI library fgi_close() close an FGI library fgi_display() display BMP, PCX, flic, or pixel run file from FGI library fgi_filesize() return size in bytes of file stored in FGI library fgi_flichead() read header of FLI/FLC file stored in FGI library fgi_flicopen() open FLI/FLC file stored in FGI library fgi_flicskip() advances one or more frames in file opened with fgi_flicopen() fgi_jpeghead() read header of a JPEG file stored in FGI library fgi_loadpcx() identical to fgi_showpcx(), provided for DOS compatibility fgi_open() open an FGI library fgi_pcxhead() read header of PCX file stored in FGI library fgi_pcxpal() retrieve palette of PCX file stored in FGI library fgi_read() read file stored in FGI library fgi_readnext() read "next" file stored in FGI library fgi_seek() position FGI file pointer at beginning of requested file fgi_showbmp() display BMP image stored in FGI library fgi_showflic() play FLI/FLC file stored in FGI library fgi_showjpeg() display JPEG file stored in FGI library fgi_showpcx() display PCX image stored in FGI library fgi_showppr() display PPR image stored in FGI library fgi_showspr() display SPR image stored in FGI library fgi_version() return Fastgraph/Image for Windows version number How much does Fastgraph for Windows cost? ----------------------------------------- Fastgraph for Windows costs $299. That includes a royalty-free license to use it in your programs. It includes libraries for all supported platforms and compilers, but it does not include the source code. Fastgraph/Fonts for Windows and Fastgraph/Fonts for Windows are priced at $69 each. Our Graphics Power Pack for Windows bundles Fastgraph, Fastgraph/Fonts, and Fastgraph/Image for $399, a savings of $38 over the individual product prices. Are upgrades available? ----------------------- Until April 30, 1998, Fastgraph 1.x for Windows customers can upgrade to version 5.0 for just $99. After April 30, the upgrade price will be $129. What about Fastgraph DOS customers? ----------------------------------- Special discounts are available on Fastgraph for Windows for Fastgraph for DOS customers. Fastgraph 4.x/5.0 for DOS customers can purchase Fastgraph 5.0 for Windows for $199, and Fastgraph 2.x/3.x for DOS customers can purchase it for $249. What happened to Fastgraph for Windows versions 2, 3, and 4? ------------------------------------------------------------ We skipped from Fastgraph for Windows 1.02 to 5.0. This was done to avoid the potential confusion of having DOS and Windows versions of Fastgraph with comparable functionality but different version numbers. Is source code available? ------------------------- Sure! Call Ted or Diana at (702) 735-1980 if you want to talk about source code. What about manuals? ------------------- The detailed 600+ page Fastgraph for Windows manual makes learning and using Fastgraph fast and easy. What is the Coriolis Group? --------------------------- The Coriolis Group, based in Scottsdale, Arizona, publishes books, magazines, and software, including the popular Visual Developer magazine (formerly PC Techniques). Coriolis is a publishing partner for Fastgraph and Fastgraph for Windows, handling order fulfillment, packaging, and shipping, while Ted Gruber Software is responsible for product development and technical support. What is your technical support policy? -------------------------------------- We have always offered free technical support on Fastgraph products. Technical support is available by voice, fax, and email. Please note that while we are glad to provide Fastgraph for Windows technical support, we do not have the resources to provide general Windows programming help. What is the contact information for Fastgraph? ---------------------------------------------- Ted Gruber Software, Inc. PO Box 13408 Las Vegas, NV 89112 (800) 410-0192 orders only (602) 483-0192 orders outside the US (702) 735-1980 voice (702) 735-4603 fax email: fastgraph@aol.com web: http://www.fastgraph.com ftp: ftp.fastgraph.com/fg/windows