Archived

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

nabeshin

DDraw init problem

Recommended Posts

nabeshin    122
Whenever I try to set the cooperation of the DirectDraw object to anything but DDSCL_NORMAL, it tells me I''m giving it invalid parameters. I can''t understand how it cannot work, since I''m following a very basic DirectX example. Anyone have a clue? Here''s the snippet that doesn''t work:
	LPDIRECTDRAW7 lpdd  = NULL;
	if(FAILED(DirectDrawCreateEx(NULL, (void **)&lpdd, IID_IDirectDraw7, NULL)))
	{
		MessageBox(NULL, "Could not create DirectDraw surface!", "Error!", NULL);
		return(0); 
	}

	MessageBox(NULL, 
		DXGetErrorDescription8(
			lpdd->SetCooperativeLevel(hWnd, DDSCL_ALLOWMODEX | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT)), "Error", NULL);

Share this post


Link to post
Share on other sites
Nik02    4348
Try disabling modex flag.
Not all drivers support it.

Also, DirectDrawCreateEx does not create a surface as your error message seems to suggest. (I'm sure you already know that.)

EDIT:
And, ironically, the message box may not let the cooperation level change (the switch to fullscreen). Try to use some other form of debug message.

Sorry, i can't test it myself right now, not on my own machine, you see


[edited by - Nik02 on August 6, 2003 7:15:05 AM]

Share this post


Link to post
Share on other sites