8-bit Grayscale Surface.
Hi !
How can I create an Offscreen 8-bit Grayscale Surface.
I am trying this:
DDPIXELFORMAT g_ddpf;
g_ddpf.dwSize = sizeof(DDPIXELFORMAT);
g_ddpf.dwFlags = DDPF_RGB;
g_ddpf.dwRGBBitCount = 8;
g_ddpf.dwRBitMask = 0xFF;
g_ddpf.dwGBitMask = 0xFF;
g_ddpf.dwBBitMask = 0xFF;
But CreateSurface returns DDERR_INVALIDPIXELFORMAT.
What DDPIXELFORMAT should I create for Grayscale surface ?
Thanks.
Edited by - DDzuba on January 11, 2002 5:56:34 AM
Enumerate the available formats, the callback from the enumeration gives you the complete pixel format structure ready to pass to CreateSurface.
Your graphics hardware probably doesn''t support that format for surfaces. This is why you *must* enumerate and check the caps. DirectDraw won''t emulate things like surfaces if the hardware doesn''t support them.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Your graphics hardware probably doesn''t support that format for surfaces. This is why you *must* enumerate and check the caps. DirectDraw won''t emulate things like surfaces if the hardware doesn''t support them.
--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement