DirectX7 Trouble
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:
Becomes...
Rather than do that though, show us the first part of your initialization code. You probably aren''t using the right version of DirectDraw.
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
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
Popular Topics
Advertisement