Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

DirectX question (more)

Can anyone tell me what's going on here? The code below gives me this error:

error C2660: 'SetDisplayMode' : function does not take 5 parameters

I know that in DirectDraw4, SetDisplayMode takes 5 params: width,height,bpp,refreshrate,and flags

LPDIRECTDRAW lpdd = NULL;
LPDIRECTDRAW lpdd4 = NULL;
HWND hwnd;

hwnd = (HWND)(CBGetHwnd());
if(FAILED(DirectDrawCreate(NULL,&lpdd,NULL)))
{
}
if(FAILED(lpdd->QueryInterface(IID_IDirectDraw4,(LPVOID *)&lpdd4)))
{
}
lpdd->Release();
if(FAILED(lpdd4->SetCooperativeLevel(hwnd,DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE|DDSCL_ALLOWREBOOT|DDSCL_ALLOWMODEX)))
{
}
if(FAILED(lpdd4->SetDisplayMode(800,600,24,0,0)))
{
}

I'd really appreciate any help. Thanks!

Comments

  • ErRoRzErRoRz Member Posts: 1
    Here is the error and where your error is located.

    : error C2660: 'SetDisplayMode' : function does not take 5 parameters
    : if(FAILED(lpdd4->SetDisplayMode(800,600,24,0,0)))

    it should be like:
    if(FAILED(lpdd4->SetDisplayMode(800,600,24,0, INSERTFLAGHERE)))
    or you can try
    if(FAILED(lpdd4->SetDisplayMode(800,600,24,0,NULL)))
Sign In or Register to comment.