Way #1:
void FindResolutionsOfVideocard (void)
{
int n,i; char longString3[2048]; char longString4[2048]; char* string1;
//cards
dbPerformChecklistForGraphicsCards();
n=dbChecklistQuantity();
if (n>0)
{ for (i=1; i<=n; i++)
{ string1=dbChecklistString(i);
strcpy(longString3, string1); //TODO: optimize
delete[] string1;
sprintf (longString4, "Card %d = %s", i, longString3);
dbText(400,20*i,longString4);
}
}
//resolutions;
dbPerformChecklistForDisplayModes();
n=dbChecklistQuantity();
if (n>0)
{ for (i=1; i<=n; i++)
{ string1=dbChecklistString(i);
strcpy(longString3, string1); //TODO: optimize
delete[] string1;
sprintf (longString4, "Resolution %d = %s %d %d %d", i, longString3, dbChecklistValueA(i), dbChecklistValueB(i), dbChecklistValueC(i));
dbText(400,50+20*i,longString4);
}
}
}
Way #2:
if (dbCheckDisplayMode(1024,768,32)){dbSetDisplayMode(1024,768,32);}
But be careful, because if the resolution for full-screen game differs from that established by the user on his Windows desktop, antialiasing does not work.
Example #1:
My monitor original resolution: 1680x1050
I set Windows desktop resolution: 1440x900
In game I use:
dbSetWindowLayout(0,0,0);
dbSetDisplayModeAntialias(1440,900,dbScreenDepth(),1,4,0); //iMultisamplingFactor == 4 (i.e. antialias==4)
dbMaximiseWindow();
dbSetCameraRange (0.5f, 60000.0f);
dbSetCameraFOV(0,FOV); //FOV 62.0f or 31.0f
Result: OK. See picture 1.
Example #2:
My monitor original resolution: 1680x1050
I set Windows desktop resolution: 1680x1050
dbSetWindowLayout(0,0,0);
dbSetDisplayModeAntialias(1440,900,dbScreenDepth(),1,4,0); //iMultisamplingFactor == 4 (i.e. antialias==4)
dbMaximiseWindow();
dbSetCameraRange (0.5f, 60000.0f);
dbSetCameraFOV(0,FOV); //FOV 62.0f or 31.0f
Result: no antialias. See picture 2.
So I use only GetSystemMetrics(SM_CXSCREEN) & GetSystemMetrics(SM_CYSCREEN) for fullscreen.