FLI and FLC Low-Level FunctionsFastgraph's low-level flic functions provide the ability to play flic files one frame at a time. This is desirable when your program must perform other tasks between frames, or for playing two or more flic files at the same time. To use the low-level flic functions, call fg_flicopen() for each flic file. The first fg_flicopen() parameter is the flic file name. The second parameter is a 16-byte array that will receive a context descriptor for the flic file. You must create a context descriptor with fg_flicopen() for each flic file you'll access with the low-level flic file functions. The context descriptor is then passed to other functions when accessing the flic file. If successful, fg_flicopen() fills the context descriptor, positions the flic file at the first frame, and returns zero. The possible error return values are -1 (file not found) and -2 (file is not an FLI or FLC file). The fg_flicplay() function plays one or more frames from a flic file and leaves the file positioned at the beginning of the next frame. Its three parameters are the same as for fg_showflic() except the first parameter is a context descriptor instead of a flic file name. The fg_flicskip() function advances over flic file frames. Its first parameter is the flic file's context descriptor, and its second parameter is the number of frames to skip (if the frame count is negative, the file position is reset to the first frame). Both functions return the number of frames played (or skipped), which may be less than the number of frames requested if the end-of-file is reached. The last low-level flic function, fg_flicdone(), closes a flic file previously opened with fg_flicopen(). Its only parameter is the flic file's context descriptor. The following code shows how to play the flic file GLASS.FLI one frame at a time using the low-level flic functions. We first open the flic file with fg_flicopen(), which returns a 16-byte context descriptor for the file. If the file was opened successfully, we play each frame by calling fg_flicplay() in a loop. This itself does not actually display the frames but plays them in the active virtual buffer, so after each frame we call fg_vbscale() to display it in the client area. Eventually we'll reach the end-of-file, indicated by an fg_flicplay() return value of zero. When this occurs, we call fg_flicdone().
C/C++:
Delphi:
Visual Basic:
|
 
copyright 2001 Ted Gruber Software, Inc.