Archived

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

Sand_Hawk

DirectDraw won't go fullscreen

Recommended Posts

I''m trying to learn DirectX from TOTWGPG using DirectX 6. But when I use SetDisplayMode(640, 480, 8 ,0, 0) the app goes fullscreen in a window. I still see the toolbar above the window. This is my code:
  
    if (FAILED(DirectDrawCreate(NULL, &lpdd, NULL)))
    {
        MessageBox(NULL, "Failed(1)", "Init Error", MB_OK | MB_ICONSTOP);
        return (FALSE);
    }

    if (FAILED(lpdd->QueryInterface(IID_IDirectDraw4, (LPVOID *)&lpdd4)))
    {
        MessageBox(NULL, "Failed(2)", "Init Error", MB_OK | MB_ICONSTOP);
        return (FALSE);
    }

    lpdd->Release();
    lpdd = NULL;
    if (FAILED(lpdd4->SetCooperativeLevel(hWndApp, 
                                          DDSCL_FULLSCREEN | 
                                          DDSCL_ALLOWMODEX | 
                                          DDSCL_EXCLUSIVE  | 
                                          DDSCL_ALLOWREBOOT)))
    {
        MessageBox(NULL, "Failed(3)", "Init Error", MB_OK | MB_ICONSTOP);
        return (FALSE);
    }

    if (FAILED(lpdd4->SetDisplayMode(640, 480, 8, 0, 0)))
    {
        MessageBox(NULL, "Failed(4)", "Init Error", MB_OK | MB_ICONSTOP);
        return (FALSE);
    }
    
    return (TRUE);

  
What can I make it fill the entire screen? Sand Hawk ---------------- -Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Chances are that you are creating the window (hWndApp) with the wrong styles (WS_*). Make sure that you are not including WS_CAPTION, WS_MAXIMIZE, WS_MINIMIZE, or maybe even WS_OVERLAPPED. If I recall, WS_POPUP is the one you want. Hope this helps!

Share this post


Link to post
Share on other sites
Hi,
I think your problem is not with that part of your code try looking at your CreateWindowEx call and change window style from
WS_OVERLAPPEDWINDOW to WS_VISIBLE|WS_POPUP I hope this fixes your problem if not let me know.

Cya

PaulJ

Share this post


Link to post
Share on other sites
Your damn right!!! I got it too work! Thanks guys for the help!

Sand Hawk


----------------
-Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites