home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga Shareware Floppies / ma01.dms / ma01.adf / wasp / src / scrsz.c < prev    next >
C/C++ Source or Header  |  1991-12-26  |  861b  |  39 lines

  1. /* wasp - Copyright 1991 by Steven Reiz
  2.  * see COPYING and wasp.c for further info,
  3.  * scrsz.c, 27/12/90, 8/7/91 - 9/7/91, 8/12/91
  4.  */
  5.  
  6. #ifndef AMIGA
  7. #error AMIGA should be defined!
  8. #endif
  9.  
  10. #ifdef AZTEC_C
  11. #include <functions.h>
  12. #endif
  13. #ifdef LATTICE
  14. #include <proto/exec.h>
  15. #include <proto/dos.h>
  16. #endif
  17. #include <graphics/view.h>
  18. #include <intuition/intuitionbase.h>
  19.  
  20. struct IntuitionBase *IntuitionBase;
  21. extern short scrw, scrh; /* also defined in wasp.h */
  22.  
  23. void
  24. get_scr_size(void)
  25. {
  26.     struct ViewPort *vp;
  27.  
  28.     if (IntuitionBase=(struct IntuitionBase *)OpenLibrary("intuition.library", 0L)) {
  29.         vp=IntuitionBase->ViewLord.ViewPort;
  30.         scrw=vp->DWidth;
  31.         scrh=vp->DHeight;
  32.         if (vp->Modes & HIRES)
  33.             scrw/=2;
  34.         if (vp->Modes & LACE)
  35.             scrh/=2;
  36.         CloseLibrary((struct Library *)IntuitionBase);
  37.     }
  38. }
  39.