home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GraphicsCode / examples / IFF_Example.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-05  |  1.0 KB  |  59 lines

  1. // A Little example program to load in and display an iff file.
  2. // this requires the iff.library supplied to be installed in
  3. // your libs: drawer.
  4. // Don't know what happens if it isn't.
  5.  
  6.     #include <proto/graphics.h>     // Need this for the graphics_base.h file
  7.  
  8. // My include files
  9. // Change according to their location
  10.  
  11.     #include <custom/graphics_base.h>
  12.     #include <custom/graphics.h>
  13.  
  14.     #include <hardware/cia.h>       // Don't really need this
  15.  
  16. // The C Palette data
  17.  
  18.     #include "palette.c"
  19.  
  20. __far extern struct CIA ciaa, ciab;
  21.  
  22. VOID main()
  23. {
  24.  
  25. // A Screen store structure
  26.  
  27.     struct Screen_Store *screen = NULL;
  28.  
  29. // init the graphics functions
  30.  
  31.     Graphics_Init();
  32.  
  33. // Open the screen
  34.  
  35.     screen=Open_Screen(320,256,8,NULL,&myData);
  36.  
  37. // Load the IFF
  38.  
  39.     Load_IFF(screen,"levellingthelaw");
  40.  
  41. // Wait for a mouse press
  42.  
  43.     while ((ciaa.ciapra & (1 << CIAB_GAMEPORT0))!=0)
  44.         ;
  45.  
  46. // fade out
  47.  
  48.     Fade_To_Black(screen,&myData);
  49.  
  50. // Close the screen
  51.  
  52.     Close_Screen(screen);
  53.  
  54. // Close the graphics
  55.  
  56.     Graphics_Close();
  57.  
  58. }
  59.