Jump to content
  • Advertisement

Archived

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

nagromo

DDraw setup

This topic is 5724 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 am using Dev-Cpp and ddraw 7, and I finally got it to compile, but it gives me an error when I try to create a surface. I got Dev-Cpp's modified headers, etc. Here is the source: Near the top:
      
LPDIRECTDRAW7 lpdd = NULL;
DDSURFACEDESC2 ddsd;
LPDIRECTDRAWSURFACE7 lpddsPrimary;  
  
And in function Init:
  
    if(FAILED(DirectDrawCreateEx(NULL,(void**&lpdd,IID_IDirectDraw7,NULL))) {
        MSGBOX("Init error.");
        KillWindow();
        return false;
    }
    
    INIT_DXSTRUCT(ddsd);
    ddsd.dwFlags = DDSD_CAPS;
    ddsd.ddsCaps.dwCaps=DDSCAPS_PRIMARYSURFACE|DDSCAPS_VIDEOMEMORY;
    
    if (FAILED(lpdd->CreateSurface(&ddsd,&lpddsPrimary,NULL))) {
        MSGBOX("lpdd Init error.");
        KillWindow();
        return false;
    }
    
It always makes a message box saying, "lpdd Init error." I've tried messing around with it but it won't work. [edited by - nagromo on April 18, 2003 2:59:02 PM] [edited by - nagromo on April 18, 2003 2:59:54 PM]

Share this post


Link to post
Share on other sites
Advertisement
Try to do not force the DDSCAPS_VIDEOMEMORY flag and another thing
and another thing:
dont use a Directly chech if you creating a surface I have the same problem as you and I solved it by doing a check after the CreateSurface function finished executing:

  
HRESULT hr;
lpdd->CreateSurface(&ddsd,&lpddsPrimary,NULL);
if (FAILED(hr))
{
MSGBOX("lpdd Init error.");
KillWindow();
return false;
}

I dont use this function INIT_DXSTRUCT I prefer this method:

  
ddsd.dwSize = sizeof(ddsd);

You must give the size of your ddsd structure




Can u run faster than AMD Athlon processor ??:>

[edited by - Maker on April 18, 2003 7:02:34 PM]

[edited by - Maker on April 18, 2003 7:05:16 PM]

[edited by - Maker on April 18, 2003 7:12:37 PM]

[edited by - Maker on April 18, 2003 7:17:45 PM]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!