🎉 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!

DirectX7 Trouble

Started by
2 comments, last by cyberfool 22 years, 10 months ago
I try to use this code.... DDSURFACEDESC2 ddsd; ddrval = lpDD->CreateSurface( &ddsd, &lpDDSPrimary, NULL ); and vc++6 says... ''CreateSurface'' : cannot convert parameter 1 from ''struct _DDSURFACEDESC2 *'' to ''struct _DDSURFACEDESC *'' this is the only thing stopping my app to work. Its probably very simple but i cant see anything wrong. Please help as i am desperate
Advertisement
This will fix it, but not what you want probably:

DDSURFACEDESC2 ddsd; 

Becomes...

DDSURFACEDESC ddsd; 

Rather than do that though, show us the first part of your initialization code. You probably aren''t using the right version of DirectDraw.

Did you fill out your structure ?

Example:

  DDSURFACEDESC2 ddsd;ZeroMemory(&ddsd, sizeof(ddsd));ddsd.dwSize = sizeof(ddsd);ddsd.dwFlags = DDSD_CAPS;ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;ddrval = lpDD->CreateSurface(&ddsd, &lpDDSPrimary, NULL);  

Adulthood is the vehicle for making you childhood dreams come true.
the full code for initialization is...

DDSURFACEDESC2 ddsd;
DDSCAPS2 ddscaps;
ZeroMemory(&ddsd,sizeof(ddsd));
ddsd.dwSize = sizeof( ddsd );
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE |
DDSCAPS_FLIP |
DDSCAPS_COMPLEX;
ddsd.dwBackBufferCount = 1;
ddrval = lpDD->CreateSurface( &ddsd, &lpDDSPrimary, NULL );
if (ddrval!=DD_OK) {
ErrStr=Err_CreateSurf;
return FALSE;
}

ive already been told to change DDSURFACEDESC2 to DDSURFACEDESC and that didnt help either.

thanks

This topic is closed to new replies.

Advertisement