home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d190 / ilbm2image.lha / ILBM2Image / parrotstest.c < prev    next >
C/C++ Source or Header  |  1989-03-11  |  2KB  |  128 lines

  1. /* test program for ILBM2func by Denis Green*/
  2. #include <exec/types.h>
  3. #include <intuition/intuition.h>
  4. #include "libraries/diskfont.h"
  5. #include "graphics/gfxmacros.h"
  6. extern long  IntuitionBase;
  7. extern long  GfxBase;
  8. struct ViewPort *vp;
  9. struct ColorMap *cm;
  10. #define INTUITION_REV  33
  11. #define GRAPHICS_REV 33
  12. struct TextAttr MyFont =
  13. {
  14. "topaz.font",
  15.  9,
  16.  0,
  17.  FPF_ROMFONT,
  18. };
  19.  
  20. struct NewScreen NewScreen =
  21.  {
  22.  0,
  23.  0,
  24.  320,
  25.  200,
  26.  5,  /* depth = 6 for HAM */
  27.  0,1,
  28.  NULL, /* ViewModes */
  29.  CUSTOMSCREEN,
  30.  &MyFont,
  31.  "Test  Screen",
  32.  NULL,
  33.  NULL,
  34.  };
  35.  
  36. struct NewWindow NewWindow =
  37. {     
  38. 0,
  39. 0,
  40. 320,
  41. 200,
  42. 0,
  43. 1,
  44. CLOSEWINDOW,
  45.  WINDOWCLOSE | SMART_REFRESH | ACTIVATE | WINDOWDRAG | WINDOWDEPTH | WINDOWSIZING | NOCAREREFRESH,
  46. NULL,
  47. NULL,
  48. "A test",
  49. NULL,  /* pointer to screen set later or errors result */
  50. NULL,
  51. 60,
  52. 80,
  53. 640,
  54. 200,
  55. CUSTOMSCREEN,
  56. };
  57. /*   Image parrots  
  58.      Width:    320
  59.      Height:   256
  60.      Depth:    5  */
  61. USHORT map[] = {
  62.    0x0000,
  63.    0x0eca,
  64.    0x0d00,
  65.    0x0a00,
  66.    0x0fa6,
  67.    0x0fe0,
  68.    0x08f0,
  69.    0x0080,
  70.    0x00b6,
  71.    0x00dd,
  72.    0x00af,
  73.    0x007c,
  74.    0x000f,
  75.    0x070f,
  76.    0x0c0e,
  77.    0x0c08,
  78.    0x0620,
  79.    0x0e52,
  80.    0x0960,
  81.    0x0fca,
  82.    0x0333,
  83.    0x0444,
  84.    0x0555,
  85.    0x0666,
  86.    0x0777,
  87.    0x0888,
  88.    0x0999,
  89.    0x0aaa,
  90.    0x0ccc,
  91.    0x0ddd,
  92.    0x0eee,
  93.    0x0fff
  94. };
  95.  
  96.  
  97.  
  98.  
  99.  
  100. struct Window *Window;
  101. void main()
  102. {
  103. struct Screen *Screen;
  104. IntuitionBase = 
  105.   OpenLibrary("intuition.library",INTUITION_REV);
  106. if (IntuitionBase == NULL) exit(FALSE);
  107. GfxBase = OpenLibrary("graphics.library",GRAPHICS_REV);
  108. if (GfxBase == NULL) exit(FALSE);
  109. if ((Screen = (struct Screen *)OpenScreen(&NewScreen)) == NULL)
  110.     exit(FALSE);
  111. NewWindow.Screen = Screen; /* setting pointers now */
  112. if((Window = (struct Window *)OpenWindow(&NewWindow)) == NULL) exit(FALSE);
  113. vp = (struct ViewPort *)ViewPortAddress(Window);
  114. cm =(struct ColorMap *)GetColorMap(32);
  115. LoadRGB4(vp,map,32);
  116. parrotsimagefunc();
  117. Wait(1 << Window->UserPort->mp_SigBit);
  118.  
  119. CloseWindow(Window);
  120. CloseScreen(Screen);
  121. FreeColorMap(cm);
  122. CloseLibrary(GfxBase);
  123. CloseLibrary(IntuitionBase);
  124. exit(TRUE);
  125. }
  126.  
  127.  
  128.