home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / !DeskLib / h / Screen < prev    next >
Encoding:
Text File  |  1993-04-29  |  2.2 KB  |  64 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Screen.h
  12.     Author:  Copyright © 1992 Jasn Williams
  13.     Version: 1.00 (23 Mar 1992)
  14.     Purpose: Screen functions (read size, eig factors, etc.)
  15. */
  16.  
  17. #ifndef __dl_screen_h
  18.  
  19. #ifndef __dl_wimp_h
  20. #include "Wimp.h"
  21. #endif
  22.  
  23. /* EXTRA NOTES:
  24.  * See Handler.c and '!TestApp.c' for examples of mode_change handlers to
  25.  * automatically keep all these mode variables up-to-date, etc.
  26.  */
  27.  
  28. /* These variables can be accessed globally for maximum efficiency.
  29.  * Note that they are not valid unless screen_mode == the current screen mode
  30.  * This can be guaranteed if you call Screen_CacheModeInfo() every time
  31.  * you get a mode change message, or before you attempt to use these variables
  32.  *
  33.  * Usage should be:
  34.  *   Screen_CacheModeInfo();
  35.  *   ...
  36.  *   screenwidth = screen_size.x;   (or whatever)
  37.  *   ...
  38.  */
  39.  
  40. extern int        screen_mode;
  41. extern wimp_point screen_size;
  42. extern wimp_point screen_eig;
  43. extern wimp_point screen_delta;
  44. extern int        screen_bpp;
  45.  
  46.  
  47.  /* Screen_CacheModeInfo --------------------------------------------------
  48.   * This should be called before you try to use any of the above screen 
  49.   * variables. It only needs to be called whenever the screen mode changes
  50.   * so call it:
  51.   *   a) When you initialise your program, and whenever a mode change
  52.   *      message is received (see ModeChangeHandler, below)
  53.   *   b) Immediately before you use the variables (i.e. in your redraw
  54.   *      handler, etc.)
  55.   *
  56.   * It checks the screenmode, and if it has not changed, then the variables
  57.   * are not updated, so it is not too bad if you call it more often than
  58.   * you really need to (i.e. every time you redraw, for example).
  59.   */
  60. extern BOOL Screen_CacheModeInfo(void);
  61.  
  62.  
  63. #endif
  64.