FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

DRAWING

Take a note about shades of grey GWorld


Unless you specificially tell it otherwise, the gWorld will match the highest color depth of any monitors the computer is using: if you're at "millions" you'll get a 32-bit world, at 256 you'll get an 8-bit world. And unless you really, really know what you're doing, you're better off passing a 0 ("unspecified") value and letting the program set the depth for you, _and_ be sure it gets updated whenever color depth changes. The easiest way is to include an UPDATEGWORLD call in your refresh code. If you change monitor depth while the app is running, and the code doesn't account for the change, I can guarantee you will be sorry (crash is likely).
If it's on your own computer, set your monitor at 256 and keep it there. If it's for distribution, you can _tell_ people it will use more memory at higher color resolutions, and prompt them at startup to switch down to 256, but if you do anything more you'll have some annoyed users--people who, for example, happen to have color-intensive apps running concurrently with yours. (To say nothing of people concurrently running apps that crash on the spot if color depth is changed.) Yes, I realize some of this has more to do with programming philosophy than programming technique--but it all comes under the heading of Human Interface.
A bigger problem is one you may not have encountered yet: if your monitor is set to "256 grays" as opposed to 256 colors, white-as-transparent in copying among gWorlds will no longer work; it will come through as solid white. (Anyone know a fix?)
As long as you're using existing images--PICTs, or graphics drawn by explicit color commands--you don't need to set up a color table _unless_ you're using more shades of grey than the 14+2 in the system's 256-color palette. The easiest way to make color tables is to cheat, using some graphics program that creates color tables: for example, I make mine as part of SuperPaint documents, take the resulting clut and paste its contents into a pltt resource. (Going the opposite direction may not work, but this is a simple & easy route.) Change its number to 0 and it will become the default palette for your whole app.

Lucy