home *** CD-ROM | disk | FTP | other *** search
/ 3D GFX / 3D GFX.iso / amiutils / a_d / colorpatch / source / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-31  |  1.0 KB  |  44 lines

  1. /* Test */
  2.  
  3. #include <proto/exec.h>
  4. #include <proto/dos.h>
  5. #include <proto/intuition.h>
  6. #include <proto/graphics.h>
  7. #include <intuition/screens.h>
  8. #include <graphics/view.h>
  9.  
  10. struct IntuitionBase *IntuitionBase;
  11. struct GfxBase    *GfxBase;
  12. struct DosLibrary *DOSBase;
  13. struct Library *Test;
  14.  
  15. UWORD colors[]={0xf62,0x777};
  16.  
  17. #define offsetof(s,m) (ULONG)&(((s*)0)->m)
  18.  
  19. LONG __saveds main(void)
  20. {
  21.     if (DOSBase=(struct DosLibrary *)OpenLibrary("dos.library",37L))
  22.     {
  23.         if (GfxBase=(struct GfxBase*)OpenLibrary("graphics.library",37L))
  24.         {
  25.             if (IntuitionBase=(struct IntuitionBase*)OpenLibrary("intuition.library",37L))
  26.             {
  27.                 struct View *View=ViewAddress();
  28.                 struct ViewExtra *VE=GfxLookUp(View);
  29.                 struct Screen *Screen=LockPubScreen(NULL);
  30.                 struct ViewPort *VP=&Screen->ViewPort;
  31.                 struct ColorMap *CM=VP->ColorMap;
  32.                 
  33.                 SetRGB32(VP,0,0xffffffff,0,0);
  34.                 
  35.                 UnlockPubScreen(NULL,Screen);
  36.                 CloseLibrary((struct Library*)IntuitionBase);
  37.             }
  38.             CloseLibrary((struct Library*)GfxBase);
  39.         }
  40.         CloseLibrary((struct Library*)DOSBase);
  41.     }
  42.     return(0);
  43. }
  44.