Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

andreas_sweden

16bit DirectDrawSurfaces using direct memory access

This topic is 5599 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve got a fairly simple question which I need to get answered: When working with 16bit DirectDrawSurfaces you "have" to use 24bit images, if you are still going to make them 16bit is there any meaning of saving the 24bit version? Because, I''ve been reading and 5:6:5 is what I''m using...but some graphiccards seem to have other standards... Is there a risk to save 16bit images?... Or are all graphiccards capable of 5:6:5 bit masks? If I specifiy it when creating the surfaces using the PIXELFORMAT. "Visual Basic, Java and trashed cars offers the same performance...trashed cars only move if it''s really steep, but on the other hand would Visual Basic and Java crash."

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
you need to get the pixel format (bit per pixel depth) by querying the hardware with the IDIRECTDRAWSURFACE7::GetPixelFormat(). (if you''re using directx 7 or whatever). its prototype is:
HRESULT GetPixelFormat (LPDDPIXELFORMAT lpDDPixelFormat);

Share this post


Link to post
Share on other sites
Yes I know, and I''ve already made that work...
My question is, is it possible to tell the graphiccard to use 5:6:5 or are the graphiccards that doesn''t support that mode?

Because, if it''s not possible to always use 5:6:5 I have to save the images as 24bit instead of 16bit.

...Question: Is 5:6:5 safe on all computers?

Share this post


Link to post
Share on other sites
quote:
Original post by andreas_sweden
Yes I know, and I''ve already made that work...
My question is, is it possible to tell the graphiccard to use 5:6:5 or are the graphiccards that doesn''t support that mode?

Because, if it''s not possible to always use 5:6:5 I have to save the images as 24bit instead of 16bit.

...Question: Is 5:6:5 safe on all computers?



Some graphic cards don''t support 5:6:5. But those cards do support 1:5:5:5 so you only have to write two code paths.

(the 1 in 1:5:5:5 is unused for DirectDraw surfaces, set it to 0)



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Huge thanks....

So with other words, if I would come across a 5:5:5 graphiccard I only "downsample" the image from 5:6:5 to 5:5:5. Great, now my suspicions are confirmed.

Yeah, I''ve been thinking of palettizing the images, thanks anyway. (they are only 32x32 so I''ll see about that, but might work anyway, also compressed

"Visual Basic, Java and trashed cars offers the same performance...trashed cars only move if it''s really steep, but on the other hand would Visual Basic and Java crash."

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!