figure.frame[figure.counter] = DD_Make_Surface( 68, 100, &lpdd, 0, 0 );
LPDIRECTDRAW7 cant pass by reference?
Hey im making a surface creation function, and Im having issues with the pointer not wanting to pass by reference, any other LP variables like surfaces pass with no issues. Was directx designed this way? This is what I get...
error C2664: 'DD_Make_Surface' : cannot convert parameter 3 from 'LPDIRECTDRAW7 *__w64 ' to 'LPDIRECTDRAW7'
This is my function call...
Is there ANY way to make the LPDIRECTDRAW7 pointer global or able to pass into functions by reference? I tried by value, and the program crashes...probably because its being copied and im trying to make a surface on a interface that doesnt exist or is valid. Any help is appreciated
what version of directx SDK are you using? can you include the function declaration and definition please?
9.0 Summer 2003
heres the definition
heres the definition
LPDIRECTDRAWSURFACE7 DD_Make_Surface( int x, int y, LPDIRECTDRAW7 lpdd, int flags, int transparant = 0){ DDSURFACEDESC2 ddsd; LPDIRECTDRAWSURFACE7 lpdds; memset( &ddsd, 0, sizeof(ddsd) ); ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | flags; ddsd.dwWidth = x; ddsd.dwHeight = y; lpdd->CreateSurface( &ddsd, &lpdds, NULL ); DDCOLORKEY color; color.dwColorSpaceHighValue = 0; color.dwColorSpaceLowValue = 0; lpdds->SetColorKey( DDCKEY_SRCBLT, &color ); return(lpdds);}
like normally LPDIRECTDRAW7 lpdd. Its already a pointer...it wouldnt make a difference how I declare it right? Im confused that when i use the dereference operator it wont pass it, but on any other LP types it works fine.
You will have to step through the code and see where it crashes. Using & is definately wrong in this case.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement