home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gchsrc31.lzh / INCLUDE / RESOLUTI.H < prev    next >
C/C++ Source or Header  |  1992-04-27  |  2KB  |  61 lines

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  This file is part of the Atari Machine Specific Library,
  4. //  and is Copyright 1992 by Warwick W. Allison.
  5. //
  6. //  You are free to copy and modify these sources, provided you acknoledge
  7. //  the origin by retaining this notice, and adhere to the conditions
  8. //  described in the file COPYING.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef _Resolution_h
  13. #define _Resolution_h
  14. //
  15. //  Support for the currently defined (1992) resolutions.
  16. //
  17. //  To change to a different, simply declare that a change in resolution
  18. //  exists, eg.:
  19. //
  20. //        ResolutionChange Rez(STLow);
  21. //
  22. //  This will change the current resolution to ST low resolution.
  23. //  Various modules (esp. Screens) take notice of the current resolution.
  24. //  When the resolution change goes out of scope (ceases to exist), it
  25. //  will revert to the previous resolution.
  26. //
  27. //  Note that due to the fascist way TOS changes resolution, the current
  28. //  logical screen is cleared when resolution is changed.
  29. //
  30. //  Various arrays of resolution dependent values are also supplied.
  31. //
  32.  
  33. typedef enum {STLow=0, STMedium=1, STHigh=2, TTLow=7, TTMedium=4, TTHigh=5} Resolution;
  34. #define NUMRES (TTLow+1)
  35.  
  36. extern short BitPlanes[NUMRES];
  37. extern short BytesPerBitPlaneLine[NUMRES];
  38. extern short BytesPerLine[NUMRES];
  39. extern short ScreenWidth[NUMRES];
  40. extern short ScreenHeight[NUMRES];
  41. extern short NumberOfColours[NUMRES];
  42.  
  43.  
  44. class ResolutionChange
  45. {
  46. public:
  47.     Resolution Before,After;
  48.  
  49.     ResolutionChange();        /* No change */
  50.     ResolutionChange(Resolution);
  51.     ~ResolutionChange();        /* Change back */
  52. };
  53.  
  54. /* The concept here is that resolutions may be changed in a scopewise
  55.  * manner.  Simply by declaring that a ResolutionChange object exists,
  56.  * the resolution will be modified for the scope, but restored at the
  57.  * end on the scope!
  58.  */
  59.  
  60. #endif
  61.