• Advertisement

Archived

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

SetDisplayMode in DirectDraw causing problems

This topic is 6577 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 posted earlier about this problem and a guy suggested that I reinstall directx. It worked, however, it is doing it again and I think it was fixed by accident when I edited something, and not the reinstall, and I am not sure what it was I changed. I am writing a simple Direct3D app that draws a single triangle, however the DirectDraw portion of the initialization failes. Apparently after I call SetDisplayMode I lost my Exclusive Mode from when I set the cooperative level. In order of what I am doing this is how it happens 1 CreateDirectDrawEx() using the DirectDraw7 interface 2 SetCooperativeLevel() I set it to Fullscreen and Exclusive 3 SetDisplayMode() I use 640x480x16 and 0 for refresh/flags 4 CreateSurface() I go to create the surface, but it failes because apparently I lost exclusive mode after setting the display mode. I tried tricking it into reistablishing the Cooperative level by Using SetCooperativeLevel() again after setting the display mode, however, this was a hack and caused major problems later on It shows the triangle rotating, however my cursor is visable, despite me setting it not to be, and the mouse cursor reacts to apps "under" my program like when it moves over a text box where another program should be the cursor changes, and if I click on anything it tries to switch to the window I clicked on (but couldn't see) suggesting that I don't really have exclusive mode still. One other thing, I can compile and use all the samples just fine. I have even been able to get the triangle tutorial they use to go into full screen mode! I checked the way they did it to the way I did it, and except for variable names it is pretty much the same, but theirs works. Any clue on how to keep it from losing exclusive? -Omalacon --If anyone is interested, I can post my initialization code.. don't know if it will help or not. Edited by - Omalacon on 1/17/00 5:40:44 PM

Share this post


Link to post
Share on other sites
Advertisement
Got it working, apparently VC wasn''t giving me a warning (which is usually does) that I was passing a pointer to an HWND instead of my actual HWND to SetCoop. For some reason it still went through the function just fine, but when it tried to create the surface it failed since it didn''t truly have Exclusive. What I don''t get is why VC never gave me a warning about it. Normally it does, in fact normally it gives me an error! Are HWND and HWND * really the same type?

-Omalacon

Share this post


Link to post
Share on other sites
A HWND is acutally a HANDLE, and a HANDLE is actually a void *, so a HWND * is a void ** which isn''t equivilant to a void *.

Share this post


Link to post
Share on other sites

  • Advertisement