home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 432b.lha / EzLib / doc / makescreen.doc < prev    next >
Encoding:
Text File  |  1990-11-11  |  2.5 KB  |  76 lines

  1. FUNCTION  makescreen()  -  Easily create a custom screen
  2.  
  3.   struct Screen *makescreen(modes, depth)
  4.            int modes;
  5.            int depth;
  6.  
  7.     This function will create a custom screen of the specified modes and
  8. depth for you.    makescreen() will return NULL if something couldn't be
  9. allocated or created.  Check the return value to make sure you have a
  10. valid screen pointer.  Valid modes are defined in graphics/view.h.  The
  11. more common ones are :
  12.  
  13.         LORES           -  open a 320x200 screen
  14.     HIRES        -  open a hires (640 pixels across) screen
  15.     LACE        -  make the screen interlace (400 vertical lines)
  16.     EXTRA_HALFBRITE -  specify extra half bright mode (64 colors)
  17.     HAM        -  make a HAM (hold and modify) 4096 color screen.
  18.  
  19.     If you specify NULL for modes, you will get a standard 320x200 screen.
  20.  
  21.     Some checking is done to make sure that you don't screw yourself.
  22. If graphics.library and intuition.library aren't opened before you call
  23. this function, they WILL be opened for you.
  24.  
  25.     If you specify a depth of greater than 2 (depth > 2), the bitmap data
  26. you need will be allocated.  However, the ExtData field of the screen
  27. structure will be used to hold some information needed for later when you
  28. call killscreen().  This is a warning that you should not use the
  29. screen->ExtData field, or if you do, you should save its value and put it
  30. back BEFORE you call killscreen().
  31.  
  32.     Also be advised that some programs illegally modify the
  33. screen->UserData field of your PRIVATE custom screen.  QMouse was caught
  34. blatantly doing this horrendous crime (at least as far as I could tell).
  35. This is definitely a bug in QMouse, but since I really like QMouse, I
  36. changed Ez.lib to use the screen->ExtData field.  BTW, you wanna talk about
  37. a hard to find bug, try tracking that one down!
  38.  
  39.     To open a HIRES 3 bitplane screen you would do the following :
  40.  
  41.       struct Screen *screen;
  42.  
  43.       screen = makescreen(HIRES, 3);
  44.       if (screen == NULL)
  45.     no_screen();
  46.  
  47.     To open a LORES (320x200) 5 bitplane screen, do this :
  48.  
  49.       struct Screen *screen;
  50.  
  51.       screen = makescreen(LORES, 5);
  52.       if (screen == NULL)
  53.     no_screen();
  54.  
  55.     To open a LORES, interlaced, extra half-brite screen of
  56.     6 bitplanes, do this :
  57.  
  58.       struct Screen *screen;
  59.  
  60.       screen = makescreen(LORES|LACE|EXTRA_HALFBRITE, 6);
  61.       if (screen == NULL)
  62.     no_screen();
  63.  
  64.  
  65. TODO  : maybe more error checking on the modes field.  Everything should be
  66.     covered however.  Probably should #define LORES 0 in lib.h so that
  67.     the calls to makescreen are more readable.
  68.  
  69. BUGS  : None
  70.  
  71. SEE ALSO : killscreen(screen);  makewindow();
  72.  
  73.  
  74.  
  75.  
  76.