How to determine screen depth?

Russell Allen russell.allen at
Wed Mar 1 23:53:06 UTC 2000

At 4:48 PM -0500 1/3/00, Doug Way wrote:
>On Wed, 1 Mar 2000, Tim Rowledge wrote:
>> > > Also, is there some way to change the host display > depth/screen size?
>> > > (ie for a multimedia presentation which requires 640 at 480)
>> > > > Or will I need to roll my own plugin?
>> Screen depth: <Display depth> tells you, <Display newDepth: 8> tells it
>>- 1,2,4,8,16 & 32 are usually acceptable.
>> Screen size:  <DisplayScreen actualScreenSize> tells you, and primitive
>>92 (which is not yet referred to in 2.7) would try to set the screen
>>mode, depth etc.
>> No need to worry about strange scripts.
>Er, I think by "host display" they meant the host operating system display
>depth/size, not the Squeak display depth/size.  (Although I could be

No, you're quite right.  I was looking for a way to find out the depth of
the actual host operating system display, and if possible manipulate it.

In the absence of palette management for the 8bit colour depth, to get good
graphics I need to use a 16 bit depth.  However, (at least on my Mac)
displaying a 16bit depth Squeak display on a 256 colour palette controlled
MacOS screen gives horrible and unpredictable results (green anyone?).

Let me rephrase the minimum of what I am looking for:  a way to
automatically change Squeak's <Display depth> to match the depth of the
display of the host OS.

>I'm nearly positive that you'd need to roll your own pluggable primitive
>to set the host screen's depth or size.  (Not only that, but doing this
>from an application is often frowned upon, even for applications with much
>greater native OS access than Squeak.)

Most multimedia software that has an option to take over the screen like
Squeak either offers a "letterbox" mode, where eg a 640 at 480 screen sits in
the middle of a black expanse, or a "fullscreen" mode where the host OS
display is changed to match the required 640 at 480.

Squeak can do the "letterbox" mode, but only by either (a) shipping as an
8bit image (with resulting loss of display quality) or (b) asking the user
to switch to an 8bit depth if necessary.  It can't do the "fullscreen" mode
without getting the user to switch their own host OS display settings
before running.

>- Doug Way
>  EAI/Transom Technologies, Ann Arbor, MI
>  dway at,



Russell Allen

russell.allen at


More information about the Squeak-dev mailing list