Advertisement

DirectX7 Trouble

Started by August 31, 2001 09:18 AM
2 comments, last by cyberfool 23 years, 3 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
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.
Advertisement

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