SetCooperativeLevel()-Not setting fullscreen

This is a discussion on SetCooperativeLevel()-Not setting fullscreen within the Game Programming forums, part of the General Programming Boards category; Im trying to make a simple fullscreen application for DirectDraw, but even with the DDSCL_FULLSCREEN flag set when I call ...

  1. #1
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972

    Question SetCooperativeLevel()-Not setting fullscreen

    Im trying to make a simple fullscreen application for DirectDraw, but even with the DDSCL_FULLSCREEN flag set when I call SetCooperativeLevel, it only makes window that covers the whole screen (still with the title bar)...
    Code:
    if(FAILED(lpdd->SetCooperativeLevel(main_window_handle, DDSCL_FULLSCREEN|DDSCL_EXCLUSIVE|DDSCL_ALLOWMODEX|DDSCL_ALLOWREBOOT))) 
    {
       
       MessageBox(NULL,"SetCooperativeLevel() failed!","Error!",MB_OK|MB_ICONEXCLAMATION);
    }
    Shouldn't that make it a full black screen?? Also, if I only have DDSCL_FULLSCREEN for the last argument, the function fails...For a good measure heres my complete source if someone feels like really helping me
    Oh, and I'm using Dev Cpp since MSVC++ 6 didn't want to compile it! >
    Attached Files Attached Files
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    The problem is with your CreateWindowEx function. You have the wrong style specified. The WS_VISIBLE flag is correct but change the WS_OVERLAPPED to WS_POPUP and it should work fine. Also you might want to try using the WS_EX_TOPMOST flag for the extended styles.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  3. #3
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    Ah thanks! Actually I had to set it to WS_VISIBLE | WS_POPUP to get it to work...heres a screenshot:
    Attached Images Attached Images  
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    Yea if you re-read my post i say that your VISIBLE style is correct but change your overlapped to popup. Implying that you should leave your visible one in. Just thought I'd point that out. If you need any DirectX7 help let me know I have a lot of experience with it.
    "...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

  5. #5
    carry on JaWiB's Avatar
    Join Date
    Feb 2003
    Location
    Seattle, WA
    Posts
    1,972
    Lol I misread your post...thought you said overlapped was correct but visible was not!
    "Think not but that I know these things; or think
    I know them not: not therefore am I short
    Of knowing what I ought."
    -John Milton, Paradise Regained (1671)

    "Work hard and it might happen."
    -XSquared

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 10:06 AM
  2. This is how to get your program to run fullscreen (console)
    By Raigne in forum Windows Programming
    Replies: 11
    Last Post: 11-25-2005, 07:26 AM
  3. Your favourite fantasy game setting?
    By fry in forum Game Programming
    Replies: 4
    Last Post: 10-16-2002, 06:26 AM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. cursor remains in openGL fullscreen
    By Ken Fitlike in forum Game Programming
    Replies: 5
    Last Post: 03-14-2002, 07:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21