home *** CD-ROM | disk | FTP | other *** search
- FUNCTION makescreen() - Easily create a custom screen
-
- struct Screen *makescreen(modes, depth)
- int modes;
- int depth;
-
- This function will create a custom screen of the specified modes and
- depth for you. makescreen() will return NULL if something couldn't be
- allocated or created. Check the return value to make sure you have a
- valid screen pointer. Valid modes are defined in graphics/view.h. The
- more common ones are :
-
- LORES - open a 320x200 screen
- HIRES - open a hires (640 pixels across) screen
- LACE - make the screen interlace (400 vertical lines)
- EXTRA_HALFBRITE - specify extra half bright mode (64 colors)
- HAM - make a HAM (hold and modify) 4096 color screen.
-
- If you specify NULL for modes, you will get a standard 320x200 screen.
-
- Some checking is done to make sure that you don't screw yourself.
- If graphics.library and intuition.library aren't opened before you call
- this function, they WILL be opened for you.
-
- If you specify a depth of greater than 2 (depth > 2), the bitmap data
- you need will be allocated. However, the ExtData field of the screen
- structure will be used to hold some information needed for later when you
- call killscreen(). This is a warning that you should not use the
- screen->ExtData field, or if you do, you should save its value and put it
- back BEFORE you call killscreen().
-
- Also be advised that some programs illegally modify the
- screen->UserData field of your PRIVATE custom screen. QMouse was caught
- blatantly doing this horrendous crime (at least as far as I could tell).
- This is definitely a bug in QMouse, but since I really like QMouse, I
- changed Ez.lib to use the screen->ExtData field. BTW, you wanna talk about
- a hard to find bug, try tracking that one down!
-
- To open a HIRES 3 bitplane screen you would do the following :
-
- struct Screen *screen;
-
- screen = makescreen(HIRES, 3);
- if (screen == NULL)
- no_screen();
-
- To open a LORES (320x200) 5 bitplane screen, do this :
-
- struct Screen *screen;
-
- screen = makescreen(LORES, 5);
- if (screen == NULL)
- no_screen();
-
- To open a LORES, interlaced, extra half-brite screen of
- 6 bitplanes, do this :
-
- struct Screen *screen;
-
- screen = makescreen(LORES|LACE|EXTRA_HALFBRITE, 6);
- if (screen == NULL)
- no_screen();
-
-
- TODO : maybe more error checking on the modes field. Everything should be
- covered however. Probably should #define LORES 0 in lib.h so that
- the calls to makescreen are more readable.
-
- BUGS : None
-
- SEE ALSO : killscreen(screen); makewindow();
-
-
-
-
-