Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange Results with ChangeDisplaySettings and Intel graphics card
    primarykey
    data
    text
    <p>I've been getting weird results with ChangeDisplaySettings and my Intel Graphics card. I find that when I try to go fullscreen, it won't do it in the same way as other programs. </p> <p>My Intel control panel lets me handle different resolutions in 3 ways: Stretching the image, using the original resolution but centering the image, or Maintaining the aspect ratio with letterboxing. I set the default to maintain the aspect ratio, and some old games on my computer end up doing that. However, my program won't do the same. Instead, it gets centered.</p> <p>Here's the code I'm using:<br></p> <pre><code>#include "windows.h" DEVMODE DevMode; DEVMODE UsedDevMode; struct stOptions { char szFiles[260]; int xres; int yres; int bpp; bool bMultiMon; }; stOptions options; void ApplyOptions(HWND hWnd) { int iModeNum=0; bool bRes, bBpp, bFreq; bRes=bBpp=bFreq=false; bool bResult=true; bool bChanged=false; int iFreq; EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &DevMode); //Get the current frequency iFreq=DevMode.dmDisplayFrequency; //With this, I try to find a DevMode that will work for the display. If it can't match all of the user's //preferences, it will at least try to match as much as it can. while (bResult) { bResult=EnumDisplaySettings(NULL, iModeNum, &DevMode); if ((DevMode.dmPelsWidth==options.xres)&&(DevMode.dmPelsHeight==options.yres)) { if (!bRes) EnumDisplaySettings(NULL, iModeNum, &UsedDevMode); bRes=true; bChanged=true; if (DevMode.dmBitsPerPel==options.bpp) { if (!bBpp) EnumDisplaySettings(NULL, iModeNum, &UsedDevMode); bBpp=true; if (DevMode.dmDisplayFrequency==iFreq) { EnumDisplaySettings(NULL, iModeNum, &UsedDevMode); bFreq=true; break; } } } iModeNum++; } if (!bChanged) { //TODO: add error handling } ChangeDisplaySettings(&UsedDevMode, CDS_FULLSCREEN); MoveWindow(hWnd, 0, 0, options.xres, options.yres, true); }</code></pre> <p>I'd like to know if anyone else with an intel card has this problem.</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload