Recent Resources
-
GLSL 4.0: Discarding Fragments to Create a Perf...
-
GLSL 4.0: Using Subroutines to Select Shader Fu...
-
Building a Complete Board-based Puzzle Game wit...
-
JIRA: Programming Workflows
-
.NET Generics 4.0: Container Patterns and Best...
-
Raw Meat: Game Design Tips from Team Meat's...
-
Sedge: An Automated Error Reporting Tool
Multiple Monitor Support Code
By David Stubbs | Published Aug 15 2000 02:50 PM in Game Programming
This code allows the user to select which video card to use if there are more than one present.
static GUID *gpSelectedDriverGUID;And to use the routine in your code:
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;
}
DirectDrawEnumerateExA(Callback, NULL, DDENUM_ATTACHEDSECONDARYDEVICES |Then when creating the DirectDraw object just call it like this:
DDENUM_NONDISPLAYDEVICES | DDENUM_DETACHEDSECONDARYDEVICES);
if (!gpSelectedDriverGUID)
gpSelectedDriverGUID = NULL;
DirectDrawCreate(gpSelectedDriverGUID, &lpdd, NULL);


















