🔒 Locked
DirectX Code Rot?
Advertisement
Original Post
Ok, so I've dug some old code that I wrote about 6 months ago and started playing with it. Problem is, when I try to run the executable it produces, it fails. I've traced the problem into this piece of code:
DDSURFACEDESC2 ddsd; // DD surface description (Primary surface)
DDSCAPS2 ddscaps; // DD surface capabilites struct
// 0-fill ddsd (just to be safe)
ZeroMemory(&ddsd, sizeof(ddsd));
// Fill in the surface description
ddsd.dwSize = sizeof(ddsd); // Set the size
ddsd.dwFlags = DDSD_CAPS / DDSD_BACKBUFFERCOUNT; // Set valid flags
ddsd.dwBackBufferCount = DISPLAY_BACKBUFFERCOUNT; // Back buffer count
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE / // Request a primary surface
DDSCAPS_COMPLEX / // " a complex surface
DDSCAPS_FLIP; // " a flippable surface
// Create the primary surface
if (FAILED(rVal = m_lpDD->CreateSurface(&ddsd, &m_lpDDSPrimary, NULL)))
return rVal;
The call to CreateSurface always fails with "Invalid Params". I don't understand why when this worked six months ago. Everything that I do prior to this call; SetDisplayMode, Initialize, etc. works fine and returns DD_OK. It's only this call that fails (in any display mode I try).
If somebody has had a similar problem, please let me know.
Thanks,
David
Edited by - Stark on 7/6/00 12:21:24 PM
Anonymous, the board turns binary OR operators into divides. /// (that *should* be three binary OR signs, but they show up as divides).
- Muzzafarath
Mad House Software
The Field Marshals
- Muzzafarath
Mad House Software
The Field Marshals
quote:
Original post by DeltaVee
I have had a similar problem. I think the problem lies in the fact that your driver doesn''t support one of the Caps
DDSCAPS_COMPLEX or DDSCAPS_FLIP. Do a DevCaps to findout if these are supported on your machine.
It''s possible. The only thing that has changed is my machine. Originally developped my code using a P-166 and Matrox Mystique. Recently, I upgraded to an Athlon 550 with a TNT2.
Weird thing is, I''ve tried to write the struct initialise like so, also:
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
It still return "Invalid Params".
I''ve tried this same code on a GeForce, and a 3D Rage Pro. All with the same result.
I get a similar weird ass problem when trying to attach a backbuffer, but only in DirectX 7.
I have 650 athlon and Rage 128.
I have 650 athlon and Rage 128.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement