DDraw color in fullscreen 
Author Message
 DDraw color in fullscreen

I'm having problems figuring how to use specific colors in fullscreen
DDraw7.  I'm not sure exactly what's going on.
I have my DDraw initialized like this:

    DDraw7.SetCooperativeLevel Me.hWnd, DDSCL_FULLSCREEN Or DDSCL_ALLOWMODEX
Or DDSCL_EXCLUSIVE
    DDraw7.SetDisplayMode 640, 480, 8, 0, DDSDM_DEFAULT
    ddsdPrimary.lFlags = DDSD_CAPS Or DDSD_BACKBUFFERCOUNT
    ddsdPrimary.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE Or DDSCAPS_FLIP Or
DDSCAPS_COMPLEX
    ddsdPrimary.lBackBufferCount = 1
    Set ddsPrimary = DDraw7.CreateSurface(ddsdPrimary)
    ddscBack.lCaps = DDSCAPS_BACKBUFFER
    Set ddsBack = ddsPrimary.GetAttachedSurface(ddscBack)

I'm trying to make a pixel on the backbuffer a certain color.  For example,
red.  So I tried something like this:

    ddsBack.SetLockedPixel X, Y, vbRed

Ok, that didn't work.  So I tried another method:

    ddsBack.SetLockedPixel X, Y, RGB(255, 0, 0)

Then I remembered that Patrice Scribe said something about DDPixelFormat.
So I tried it that way but when I tried to get the pixel format from the
primary surface it returned zeros for the bit masks.

    ddsPrimary.GetPixelFormat PixelFormat

Now I'm confused.  But I did notice that if I change the screen mode to
windowed I get the correct pixel format info.  What do I do?

P.S.  I know that I have to lock the surface before setting a locked pixel.
That part works fine.  It's the color that is wrong.



Fri, 07 May 2004 02:20:43 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Displaying a Window in FullScreen Mode DDraw

2. Fullscreen Option and Fullscreen Background Images

3. ddraw not updating

4. DirectX error messages ddraw.dll problem

5. one directx ddraw question

6. Bad DDRAW.DLL

7. DDraw support in DX8?

8. question... ddraw 7

9. AVI on DDraw surface

10. Transparency DDraw DX7.0

11. DDRAW & CLIPPER

12. Clearing part of a surface in DDraw

 

 
Powered by phpBB® Forum Software