home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / cmanual-3.0.lha / CManual / Intuition / Graphics / Example8.c < prev    next >
C/C++ Source or Header  |  1993-10-12  |  21KB  |  449 lines

  1. /***********************************************************/
  2. /*                                                         */
  3. /* Amiga C Encyclopedia (ACE) V3.0      Amiga C Club (ACC) */
  4. /* -------------------------------      ------------------ */
  5. /*                                                         */
  6. /* Book:    ACM Intuition               Amiga C Club       */
  7. /* Chapter: Graphics                    Tulevagen 22       */
  8. /* File:    Example8.c                  181 41  LIDINGO    */
  9. /* Author:  Anders Bjerin               SWEDEN             */
  10. /* Date:    92-05-01                                       */
  11. /* Version: 1.10                                           */
  12. /*                                                         */
  13. /*   Copyright 1992, Anders Bjerin - Amiga C Club (ACC)    */
  14. /*                                                         */
  15. /* Registered members may use this program freely in their */
  16. /*     own commercial/noncommercial programs/articles.     */
  17. /*                                                         */
  18. /***********************************************************/
  19.  
  20. /* This program will open a normal window which is connected to a      */
  21. /* 16-colour Custom screen. In the window we will draw the Amiga Logo. */
  22.  
  23.  
  24.  
  25. /* If your program is using Intuition you should include intuition.h: */
  26. #include <intuition/intuition.h>
  27.  
  28.  
  29.  
  30. struct IntuitionBase *IntuitionBase;
  31. struct GfxBase *GfxBase;
  32.  
  33.  
  34.  
  35. /* Declare a pointer to a Screen structure: */ 
  36. struct Screen *my_screen;
  37.  
  38. /* Declare and initialize your NewScreen structure: */
  39. struct NewScreen my_new_screen=
  40. {
  41.   0,            /* LeftEdge  Should always be 0. */
  42.   0,            /* TopEdge   Top of the display.*/
  43.   320,          /* Width     We are using a low-resolution screen. */
  44.   200,          /* Height    Non-Interlaced NTSC (American) display. */
  45.   4,            /* Depth     16 colours. */
  46.   0,            /* DetailPen Text should be printed with colour reg. 0 */
  47.   1,            /* BlockPen  Blocks should be printed with colour reg. 1 */
  48.   NULL,         /* ViewModes Low-resolution. (Non-Interlaced) */
  49.   CUSTOMSCREEN, /* Type      Your own customized screen. */
  50.   NULL,         /* Font      Default font. */
  51.   "N I C E",    /* Title     The screen's title. */
  52.   NULL,         /* Gadget    Must for the moment be NULL. */
  53.   NULL          /* BitMap    No special CustomBitMap. */
  54. };
  55.  
  56.  
  57.  
  58. /* Declare a pointer to a Window structure: */ 
  59. struct Window *my_window;
  60.  
  61. /* Declare and initialize your NewWindow structure: */
  62. struct NewWindow my_new_window=
  63. {
  64.   20,            /* LeftEdge    x position of the window. */
  65.   20,            /* TopEdge     y position of the window. */
  66.   147,           /* Width       147 pixels wide. */
  67.   63,            /* Height      63 lines high. */
  68.   0,             /* DetailPen   Text should be drawn with colour reg. 0 */
  69.   1,             /* BlockPen    Blocks should be drawn with col. reg. 1 */
  70.   NULL,          /* IDCMPFlags  No IDCMP flags. */
  71.   SMART_REFRESH| /* Flags       Intuition should refresh the window. */
  72.   WINDOWDRAG|    /*             Drag gadget. */
  73.   WINDOWDEPTH|   /*             Depth arrange Gadgets. */
  74.   ACTIVATE,      /*             The window should be Active when opened. */
  75.   NULL,          /* FirstGadget No Custom Gadgets. */
  76.   NULL,          /* CheckMark   Use Intuition's default CheckMark (v). */
  77.   "AMIGA!",      /* Title       Title of the window. */
  78.   NULL,          /* Screen      We will later connect it to the screen. */
  79.   NULL,          /* BitMap      No Custom BitMap. */
  80.   0,             /* MinWidth    We do not need to care about these */
  81.   0,             /* MinHeight   since we have not supplied the window */
  82.   0,             /* MaxWidth    with a Sizing Gadget. */
  83.   0,             /* MaxHeight */
  84.   CUSTOMSCREEN   /* Type        Connected to a Custom screen. */
  85. };
  86.  
  87.  
  88.  
  89.  
  90. /* Here is the data for the Amiga Logo: */
  91. /* REMEMBER! Image data MUST be placed in chip-memory! */
  92. SHORT chip amiga_logo_data[]=
  93. {
  94.   /* BitPlane ZERO */
  95.   0xFFFF,0xFFFF,0xFFF8,0x080F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  96.   0xFFFF,0xFFFF,0xFFF0,0x101F,0xFFFF,0xFF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
  112.   0xFFFF,0xFFFF,0xDF5F,0x7FFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  113.   0xFFFF,0xFFFF,0xBEBE,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  114.   0xFFFF,0xFFFF,0xBEBE,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  115.   0xFFFF,0xFFFF,0x7D7D,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  116.   0xFFFF,0xFFFE,0x0203,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  117.   0xFFFF,0xFFFE,0x0203,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  118.   0xFFFF,0xFFFC,0x0407,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  119.   0xFFFF,0xFFF8,0x080F,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
  120.   0xFFFF,0xFFF8,0x080F,0x8FF8,0x00FF,0x0060,0x03FE,0x00FF,0xFC7F,
  121.   0xFFFF,0xFFF0,0x101F,0x07FC,0x007E,0x0030,0x01F8,0x007F,0xF83F,
  122.   0xFFFF,0xFFE0,0x203F,0x07FE,0x007E,0x0078,0x03E0,0x003F,0xF83F,
  123.   0xFFFF,0xFFEF,0xAFBE,0x07FE,0x00FC,0x01F0,0x0F80,0xFE3F,0xF03F,
  124.   0xFFFF,0xFFDF,0x5F7C,0x07FC,0x00F8,0x01F0,0x0F03,0xFE3F,0xE03F,
  125.   0x0101,0xFFBE,0xBEF8,0x07FC,0x00F8,0x01F0,0x0E07,0xFF7F,0xC03F,
  126.   0xBEBE,0xFFBE,0xBEF8,0x07FC,0x00F0,0x01F0,0x0C0F,0xFFFF,0xC03F,
  127.   0xBEBE,0xFF7D,0x7DF0,0x07FC,0x00F0,0x03E0,0x181F,0xFFFF,0x803F,
  128.   0xDF5F,0x7EFA,0xFBE0,0x07F8,0x00E0,0x03E0,0x101F,0xFFFF,0x003F,
  129.   0xEFAF,0xBEFA,0xFBE0,0x07F8,0x80C2,0x03E0,0x003F,0xFFFF,0x003F,
  130.   0xEFAF,0xBDF5,0xF7C0,0x07F8,0x80C0,0x03E0,0x003F,0xFFFE,0x003F,
  131.   0xF7D7,0xDBEB,0xEF80,0x07F8,0x8084,0x07C0,0x203F,0xFFFC,0x003F,
  132.   0xFBEB,0xEBEB,0xEF04,0x07F0,0x800C,0x07C0,0x007E,0x00F8,0x203F,
  133.   0xFBEB,0xE010,0x1F0C,0x07F1,0x8008,0x07C0,0x007F,0x0078,0x603F,
  134.   0xFC04,0x0010,0x1E00,0x07F1,0x8018,0x07C0,0x007F,0x80F0,0x003F,
  135.   0xFE02,0x0020,0x3C00,0x07F1,0x8038,0x0F80,0x607F,0x81E0,0x003F,
  136.   0xFF01,0x0040,0x7C00,0x07E1,0x8070,0x0F80,0x607F,0x81E0,0x003F,
  137.   0xFF01,0x1F5F,0x783C,0x07E3,0x8070,0x0F80,0x707F,0x81C1,0xE03F,
  138.   0xFF80,0xBEBE,0xF07C,0x07E3,0x80F0,0x0F80,0x703F,0x8183,0xE03F,
  139.   0xFFDF,0x7D7D,0xE0FC,0x07E3,0x81F0,0x1F00,0xF83F,0x8107,0xE03F,
  140.   0xFFDF,0x7D7D,0xE1FC,0x07C3,0x81E0,0x1F00,0xFC1F,0x810F,0xE03F,
  141.   0xFFEE,0x0203,0xC1FC,0x07C7,0x83E0,0x1F00,0xFE1F,0x000F,0xE03F,
  142.   0xFFF0,0x0407,0x01F0,0x0303,0x8780,0x0C00,0x7F00,0x000F,0x801F,
  143.   0xFFF0,0x0406,0x00E0,0x0001,0xC700,0x0000,0x3F80,0x0007,0x000F,
  144.   0xFFF8,0x080F,0x0070,0x0000,0xEF80,0x0000,0x1FE0,0x3803,0x8007,
  145.  
  146.   /* BitPlane ONE */
  147.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  148.   0x0000,0x0000,0x0007,0xC7C0,0x0000,0x0000,0x0000,0x0000,0x0000,
  149.   0x0000,0x0000,0x0007,0xC7C0,0x0000,0x0000,0x0000,0x0000,0x0000,
  150.   0x0000,0x0000,0x000F,0x8F80,0x0000,0x0000,0x0000,0x0000,0x0000,
  151.   0x0000,0x0000,0x001F,0x1F00,0x0000,0x0000,0x0000,0x0000,0x0000,
  152.   0x0000,0x0000,0x001F,0x1F00,0x0000,0x0000,0x0000,0x0000,0x0000,
  153.   0x0000,0x0000,0x003E,0x3E00,0x0000,0x0000,0x0000,0x0000,0x0000,
  154.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  155.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  156.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  157.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  158.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  159.   0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  160.   0x0