Jump to content
  • Advertisement

Archived

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

Ddraw can't find lock...

This topic is 5499 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

I''ve been using Dev-Cpp to try to make a dx app, and am having problems. When I try to lock a surface, it gives me several errors, one in the DX header. Here is relevant code and headers. 68 C:\Dev-Cpp\Projects\WinApp2\Init.cpp no matching function for call to `IDirectDrawSurface7::Lock(NULL, 2013 C:\Dev-Cpp\Directx8 for DEV-C\Includes\ddraw.h candidates are: virtual and here is my code (I have the right var types)
  
    if(FAILED(DirectDrawCreateEx(NULL,(void**)&lpdd,IID_IDirectDraw7,NULL))) {
        MSGBOX("Init error.");
        KillWindow();
        return false;
    }
    
    lpdd->SetCooperativeLevel(hWnd,DDSCL_ALLOWREBOOT|DDSCL_EXCLUSIVE|DDSCL_FULLSCREEN);
    lpdd->SetDisplayMode(800,600,32,0,0);
    
    INIT_DXSTRUCT(ddsd);
    ddsd.dwFlags = DDSD_CAPS;
    ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
    
    
    if (FAILED(lpdd->CreateSurface(&ddsd,&lpddsPrimary,NULL))) {
        MSGBOX("lpdd Init error.");
        KillWindow();
        return false;
    }
    
    lpddsPrimary->Lock(NULL,ddsd,DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT,NULL);
  
and here is the header''s code:
  
    STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2) PURE;
    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW, LPDDSURFACEDESC2) PURE;
    STDMETHOD(IsLost)(THIS) PURE;
*   STDMETHOD(Lock)(THIS_ LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE) PURE;
    STDMETHOD(ReleaseDC)(THIS_ HDC) PURE;
    STDMETHOD(Restore)(THIS) PURE;
    STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER) PURE;
  
I think it thinks that Lock is virtual. Could anyone help...?

Share this post


Link to post
Share on other sites
Advertisement
Yes, I did, and I wasn''t doing it right earlier, but had to fix that to take care of a different problem. Maybee I should just give up and decite between MSVC and full-screen GDI.

Share this post


Link to post
Share on other sites
"lpddsPrimary->Lock(NULL,ddsd,DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT,NULL);"

Your passing ddsd instead of &ddsd!

Share this post


Link to post
Share on other sites
"lpddsPrimary->Lock(NULL,ddsd,DDLOCK_SURFACEMEMORYPTR|DDLOCK_WAIT,NULL);"

Your passing ddsd instead of &ddsd!

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.

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

Sign me up!