Jump to content
  • Advertisement
  • 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!