[comp.sys.mac.programmer] '...Sure is cold...', 'Yeah, and it's deep too!'

smargari@nmsu.edu (Susan Margarit) (05/09/91)

I am trying to cope with changing screen depths in an
application I am writing. When the depth is >= 8 bits I blit a
color picture to the background. In lesser modes, I fill the
background with a pattern (either a color pix pattern or
standard gray for 1 bit mode). Consequently, every update I
check the depth of the device that holds the majority of the
window. If the depth changes, I destroy the offscreen pixmaps,
create new ones at the same depth as the screen and redraw
the screen.  I like to keep the offscreens at the same depth as
the window because copybits'ing from one depth to another is
painfully slow. The window and the pixmaps are always color,
even in 1 bit mode.  The problem (finally eh?) is that no update
is generated by the system when I switch into and out of 1 bit
mode. I can switch from 256 to 16 to 4 and back as much as I
want successfully. As a result, switching  to and from 1 bit
mode results in a crash at some point or another.  Should I just
poll the screen depth every pass through WNE or am I missing
something. Anyone got a clue for sale as I need to buy one.
 
Jim (aka Susan) Margarit
 
DisposSig(mySig); ExitToShell;