Jump to content
  • Advertisement
Sign in to follow this  
NegativeGeForce

LPDIRECTDRAW7 cant pass by reference?

This topic is 5059 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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...
figure.frame[figure.counter] = DD_Make_Surface( 68, 100, &lpdd, 0, 0 );


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

Share this post


Link to post
Share on other sites
Advertisement
what version of directx SDK are you using? can you include the function declaration and definition please?

Share this post


Link to post
Share on other sites
9.0 Summer 2003

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);
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!