Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
DX Surface memory usage Posted by Hickory on 8 Jul 2002 at 7:51 PM
This may seem like a silly question but I want to be certain. If I create a DirectX surface, is it required to be of the same bit depth as the primary/secondary surfaces? i.e. If I have a 32-bit primary surface and I create a 16-bit surface for something or other, will it actually take up only Width*Height*16 or will DirectX force the surface secretly to become 32-bit to be compatible with the primary?

Mainly I want to know because I have a very large bitmap I'd like to store that is only 8-bit mono and I'd rather it didnt take up as much Video Mem as it would if it were put on a 32-bit surface.

Thanks
Report
Re: DX Surface memory usage Posted by Genjuro on 9 Jul 2002 at 1:54 AM
: This may seem like a silly question but I want to be certain. If I create a DirectX surface, is it required to be of the same bit depth as the primary/secondary surfaces? i.e. If I have a 32-bit primary surface and I create a 16-bit surface for something or other, will it actually take up only Width*Height*16 or will DirectX force the surface secretly to become 32-bit to be compatible with the primary?
:
: Mainly I want to know because I have a very large bitmap I'd like to store that is only 8-bit mono and I'd rather it didnt take up as much Video Mem as it would if it were put on a 32-bit surface.
:
: Thanks
:

It is *not* required. However, DirectX Blts are just memory copies with *no* color conversion. So, you *can* load it as a paletted image, but then you have to convert it on your own - or blt it and expect almost random color, and DDERR_INVALIDPARAMS here and there.

DirectX never does *anything* secretly. But then, if it doesn't do some things, as for these you're on your own.
Report
Re: DX Surface memory usage Posted by Hickory on 9 Jul 2002 at 8:23 AM
: It is *not* required. However, DirectX Blts are just memory copies with *no* color conversion. So, you *can* load it as a paletted image, but then you have to convert it on your own - or blt it and expect almost random color, and DDERR_INVALIDPARAMS here and there.
:
: DirectX never does *anything* secretly. But then, if it doesn't do some things, as for these you're on your own.
:

Thanks. By secretly I was refering to the fact that it is possible that the format you specify you desire will not actually be the format that you get. its not DX's fault, its just that if the card doest support it or whatnot, it will give you the next closest thing. Doesnt warn you though, you have to check. Thats all I meant.

I'm not doing blits I'm using it as a 3D texture. This would be okay?

Thanks for the reply.
Report
Re: DX Surface memory usage Posted by Genjuro on 10 Jul 2002 at 1:03 AM
: : It is *not* required. However, DirectX Blts are just memory copies with *no* color conversion. So, you *can* load it as a paletted image, but then you have to convert it on your own - or blt it and expect almost random color, and DDERR_INVALIDPARAMS here and there.
: :
: : DirectX never does *anything* secretly. But then, if it doesn't do some things, as for these you're on your own.
: :
:
: Thanks. By secretly I was refering to the fact that it is possible that the format you specify you desire will not actually be the format that you get. its not DX's fault, its just that if the card doest support it or whatnot, it will give you the next closest thing. Doesnt warn you though, you have to check. Thats all I meant.
:
: I'm not doing blits I'm using it as a 3D texture. This would be okay?
:
: Thanks for the reply.

Oh, don't worry: DirectX surface creation will just fail, in that case.
3D textures... uhm... well, that's just the same. After all, they are Surfaces nonentheless...



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.