Jump to content
  • Advertisement
  • Remove ads and support GameDev.net for only $3. Learn more: The New GDNet+: No Ads!

  • 08/15/00 02:50 PM
    Sign in to follow this  

    Multiple Monitor Support Code

    General and Gameplay Programming

    Myopic Rhino
    This code allows the user to select which video card to use if there are more than one present.

    static GUID *gpSelectedDriverGUID;

    BOOL WINAPI Callback(
    GUID FAR *lpGUID,
    LPSTR lpDriverDescription,
    LPSTR lpDriverName,
    LPVOID lpContext,
    HMONITOR hm
    )
    {
    char buffer[256];

    if (lpGUID)
    {
    wsprintf(buffer, "Use the %hs video card?", lpDriverDescription);
    if (MessageBoxEx(NULL, buffer, "Avoidance", MB_YESNO, NULL) == IDYES)
    {
    gpSelectedDriverGUID=lpGUID;
    return DDENUMRET_CANCEL;
    }
    }
    return DDENUMRET_OK;
    }
    And to use the routine in your code:

    DirectDrawEnumerateExA(Callback, NULL, DDENUM_ATTACHEDSECONDARYDEVICES |
    DDENUM_NONDISPLAYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES);
    if (!gpSelectedDriverGUID)
    gpSelectedDriverGUID = NULL;
    Then when creating the DirectDraw object just call it like this:

    DirectDrawCreate(gpSelectedDriverGUID, &lpdd, NULL);


      Report Article
    Sign in to follow this  


    User Feedback


    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!