I'm trying to find out the depth of the screen I'm running on. To do this, I've got a DrawInfo structure through GetScreenDrawInfo(), and queried the dri_Depth value.
It always returns 8 on screens with a depth >= 8.
Unless this is some sort of compatiblity kludge (in which case I'd like to know (a) why, and (b) how to find out the *actual* screen depth), there seems to be a bug in that the DrawInfo structure, dri_Depth field does not report the correct screen depth.
I've attached example code. It's easy to test by switching Workbench's screenmode and re-running the executable.
struct DrawInfo dri_Depth contains wrong value
struct DrawInfo dri_Depth contains wrong value
- Attachments
-
- depthtest.zip
- Show WB screen depth
- (2.82 KiB) Downloaded 580 times
- LyleHaze
- AmigaOS Core Developer
- Posts: 525
- Joined: Sat Jun 18, 2011 5:06 pm
- Location: North Florida, near the Big Bend
Re: struct DrawInfo dri_Depth contains wrong value
This might help, from Picasso96API.doc:
In the original graphics.library, bitmaps were always planar and
could hold up to eight bitplanes. With the Picasso96 graphics
system, there is also support for chunky, hicolor and truecolor
bitmaps.
When using Picasso96 bitmaps, never look into the BitMap structure
directly, but use the GetBitMapAttr() and p96GetBitMapAttr() query
functions. Especially the plane pointer entries are no longer valid.
Under no circumstances try to use them in any way!
In the original graphics.library, bitmaps were always planar and
could hold up to eight bitplanes. With the Picasso96 graphics
system, there is also support for chunky, hicolor and truecolor
bitmaps.
When using Picasso96 bitmaps, never look into the BitMap structure
directly, but use the GetBitMapAttr() and p96GetBitMapAttr() query
functions. Especially the plane pointer entries are no longer valid.
Under no circumstances try to use them in any way!
Re: struct DrawInfo dri_Depth contains wrong value
Hmm, I'm not touching the BitMap structure, but I suppose I could.LyleHaze wrote:This might help, from Picasso96API.doc:
In the original graphics.library, bitmaps were always planar and
could hold up to eight bitplanes. With the Picasso96 graphics
system, there is also support for chunky, hicolor and truecolor
bitmaps.
When using Picasso96 bitmaps, never look into the BitMap structure
directly, but use the GetBitMapAttr() and p96GetBitMapAttr() query
functions. Especially the plane pointer entries are no longer valid.
Under no circumstances try to use them in any way!
I've changed it to:
Code: Select all
depth = GetBitMapAttr(screen->RastPort.BitMap, BMA_DEPTH);
That's solved my problem, anyway. Thanks.
- salass00
- AmigaOS Core Developer
- Posts: 534
- Joined: Sat Jun 18, 2011 4:12 pm
- Location: Finland
- Contact:
Re: struct DrawInfo dri_Depth contains wrong value
Which it is, 24 bits of RGB data + 8 bits of padding.And this returns the correct thing (except it sees a 32-bit screenmode as having a 24-bit BitMap).
If you need more detailed information about which RGB format is used you need to use p96GetBitMapAttr() (use it with P96BMA_ISP96 first to make sure it's a P96 bitmap). P96BMA_BITSPERPIXEL should return 32 for your 32-bit bitmap while P96BMA_DEPTH will return the actual depth of the bitmap same as BMA_DEPTH.