🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

D3D IM z-buffer creation problem

Started by
2 comments, last by Wymsical Wyvern 24 years, 8 months ago
Hi,
enumerating Z-Buffer formats causes problems on many cards, so it was on my Elsa Victory Erazor. I had to set the format on my own and it worked on every card I checked it out. Simply set the bitdepth and pixelformat and things like that on your own and it should work.

If the DirectX-samples work, then simply copy the code from that samples and it should work without any problems.

CU

------------------
Skullpture Entertainment
#40842461

Graphix Coding @Skullpture Entertainmenthttp://www.skullpture.de
Advertisement
Are there any bit depth restrictions for the zbuffer when you are using HAL?
I'm trying to get a simple d3d-im program running, but when i create the z-buffer (w/ CreateSurface() ), it returns with DDERR_INVALIDPARAMS, i'm using the exact code from the D3DIM tutorial that comes with DX6, I don't really know whats going on.

heres the code that i'm using:

ddsd.dwSize = sizeof( DDSURFACEDESC2 );
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT;
ddsd.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
ddsd.dwWidth = m_iXSize;
ddsd.dwHeight = m_iYSize;

memcpy( &ddsd.ddpfPixelFormat, &ddpfZBuffer, sizeof( DDPIXELFORMAT ) );

ddsd.ddsCaps.dwCaps |= DDSCAPS_VIDEOMEMORY;
DDSCAPS_SYSTEMMEMORY;

hr = lpDD4->CreateSurface( &ddsd, &m_lpZBuffer, NULL );

if( FAILED( hr ) )
return DDErrToGFXErr( hr );

as you can see i kept everything the same except:
- i already know what size it should be
- i automatically use HAL

I have no idea what i'm doing wrong

Wymsical Wyvern

You can use any bitdepth that is returned in the enumeration. Usually it will be 16 or 32 bits. If you just want to play it safe, use 16.

This topic is closed to new replies.

Advertisement