Jump to content
  • Advertisement

Archived

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

nagromo

CreateSurface() problems

This topic is 5634 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 3:53:06 PM]

Share this post


Link to post
Share on other sites
Advertisement

  • 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!