Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Dez

DirectDraw Surface Problem

This topic is 6471 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 everybody, I''m trying to get the example from the DirectX 7 SDK working and I cannot figure out why I''m getting this error: Compiling... Learning Code.cpp C:\Msdev\Projects\Testing Ground\Learning Code.cpp(51) : error C2664: ''CreateSurface'' : cannot convert parameter 1 from ''struct _DDSURFACEDESC2 *'' to ''struct _DDSURFACEDESC *'' (new behavior; please see help) Error executing cl.exe. Learning Code.obj - 1 error(s), 0 warning(s) // Here is part of my code: DDSURFACEDESC2 ddsd; LPDIRECTDRAWSURFACE7 FAR *g_pddsPrimary; // Initializes ''ddsd'' structure InitStruct(ddsd); ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT; ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_TEXTURE; ********************** Error Line ******************************* // Create the primary surface. hr = g_pDD->CreateSurface( &ddsd, &g_pddsPrimary, NULL ); ***************************************************************** if( FAILED( hr ) ) return hr; I can''t understand why I''m getting this error, but I''ve seen the exact same code a dozen times tonight (looking for the answer). If anyone could help me, I would appreciate it. Thank you in advance.

Share this post


Link to post
Share on other sites
Advertisement
CreateSurface takes a DDSURFACEDESC if g_pDD is an LPDIRECTDRAW or LPDIRECTDRAW4 object. It only takes a DDSURFACEDESC2 if it is a LPDIRECTDRAW7 object. You should make sure that g_pDD is a LPDIRECTDRAW7.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!