Wondering how to determine current color depth in System 6 and 7.
For example - if my app wants to know if it should show color or not - it should check something no doubt that tells it whether the current screen (GDevice likely) has color or not as well as what bit depth it's set to.
Best I can tell from Inside Macintosh - imaging with Quickdraw -pg 5-32, is the TestDeviceAttribute(...) function as in:
My understanding of this from Inside Macintosh is that this should test for the gDevType flag on the main screen (e.g. if it's a color monitor, set to colors, gColorScreen should be True but if it is a b&w monitor or a color monitor set to b&w, it should return False).
HOWEVER -- when I run this, I get True no matter whether my color monitor is set to color or B&W -- so it's like it's checking if the screen supports color as opposed to whether it's set to color presently which is what I want...
Anyone have a little more experience with this function?
For example - if my app wants to know if it should show color or not - it should check something no doubt that tells it whether the current screen (GDevice likely) has color or not as well as what bit depth it's set to.
Best I can tell from Inside Macintosh - imaging with Quickdraw -pg 5-32, is the TestDeviceAttribute(...) function as in:
Code:
void BeepIfYouHaveColor()
{
GDHandle screen;
Boolean gColorScreen;
screen = GetMainDevice();
gColorScreen = TestDeviceAttribute(screen,gdDevType);
if(true == gColorScreen)
SysBeep(10);
}
My understanding of this from Inside Macintosh is that this should test for the gDevType flag on the main screen (e.g. if it's a color monitor, set to colors, gColorScreen should be True but if it is a b&w monitor or a color monitor set to b&w, it should return False).
HOWEVER -- when I run this, I get True no matter whether my color monitor is set to color or B&W -- so it's like it's checking if the screen supports color as opposed to whether it's set to color presently which is what I want...
Anyone have a little more experience with this function?