
/* In its JUMPDISK appearance, this file is crunched. It is the source */
/* for a program that is presented in running form. To decrunch this */
/* file, see the Articles Menu item on DECRUNCHING. */
/* Before compiling, DELETE these first four lines of file. */

/* DrawImage.c  */

#include <exec/types.h>
#include <exec/memory.h>
#include <intuition/intuition.h>

struct IntuitionBase *IntuitionBase;
struct Window *FirstWdw;

struct NewWindow wdw={160,50,320,150,0,1,NULL,
   WINDOWDEPTH|WINDOWSIZING|WINDOWDRAG|WINDOWCLOSE|SMART_REFRESH,
   NULL,NULL,(UBYTE *)"System programming test",NULL,NULL,100,50,640,200,WBENCHSCREEN
   };

USHORT Commodore[] =
   {
   /* first BitPlane */
   0x07F8, 0x0000,
   0x07F0, 0x0000,
   0x1E1E, 0x0000,
   0x1E1E, 0x0000,
   0x7800, 0xFE00,
   0x7800, 0xF800,
   0x7800, 0x0000,
   0x7800, 0x0000,
   0x7800, 0xF800,
   0x7800, 0xFE00,
   0x1E1E, 0x0000,
   0x1E1E, 0x0000,
   0x07F8, 0x0000,
   0x07F8, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000,
   /* second BitPlane */
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0xFE00,
   0x0000, 0xF800,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0xF800,
   0x0000, 0xFE00,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000,
   0x0000, 0x0000
   };

struct Image Logo={20,10,32,16,2,&Commodore[0],3,0,NULL};

main()
{
  Open_All();
  DrawImage(FirstWdw->RPort, &Logo, 10L, 10L);
  Delay(180L);
  Close_All();
}

Open_All()
{
  void *OpenLibrary();
  struct Window *OpenWindow();
  if (!(IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library", 0L)))
  {
  Close_All();
  exit(FALSE);
  }
  if (!(FirstWdw=(struct Window *)OpenWindow(&wdw)))
  {
  Close_All();
  exit(FALSE);
  }
}

Close_All()
{
  if (FirstWdw)     CloseWindow(FirstWdw);
  if (IntuitionBase)   CloseLibrary(IntuitionBase);
}
