entryway
Forum Staple
Posts: 2522
Registered: 01-04 |
Enjay said:
However, that doesn't seem to be Entryway's main problem. A possible source of the problem could be that the desktop settings do not match those in the registry for the monitor. Is the monitor properly registered?
Yes, this is the problem. I have "General Monitor" in monitor settings and Hide Unsupported Resolutions is unchecked (this is on the video).
Anyway, SDL_ListModes() in prboom+ enumerates all my modes correctly. GZDoom also has no problems with enumeration.
EnumDisplaySettings() of course works fine too and returns 85Hz instead of 100 for 1024x768x32 and looks like Risen3D has problems with that, because my desktop resolution is 1024x768, but refresh rate is 100Hz.
EnumDisplaySettings output for 1024x768x32:
1024x768: 32 bpp 60 Hz
1024x768: 32 bpp 70 Hz
1024x768: 32 bpp 72 Hz
1024x768: 32 bpp 75 Hz
1024x768: 32 bpp 85 Hz
Similar code can help Risen3D in my case
code:
settings.dmBitsPerPel = video->format->BitsPerPixel;
settings.dmPelsWidth = width;
settings.dmPelsHeight = height;
settings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;
if ( width <= (int)SDL_desktop_mode.dmPelsWidth &&
height <= (int)SDL_desktop_mode.dmPelsHeight )
{
settings.dmDisplayFrequency = SDL_desktop_mode.dmDisplayFrequency;
settings.dmFields |= DM_DISPLAYFREQUENCY;
}
changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
if ( !changed && (settings.dmFields & DM_DISPLAYFREQUENCY) )
{
settings.dmFields &= ~DM_DISPLAYFREQUENCY;
changed = (ChangeDisplaySettings(&settings, CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
}
Enjay said:
Risen3D checks the registry settings to try to avoid people externally setting values that the monitor can't handle.
Risen3D just fails with setting the resolution. I do not set refresh rate (is there an ability?) and Risen should use best values from EnumDisplaySettings for used resolution or my desktop values if they are equal. Even 60Hz would be better than nothing
As you saw on the video, even -width 800 -height 600 -bpp 32 -window does not work with strange message about 1024x768.
code: #include <windows.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
DEVMODE settings;
settings.dmSize = sizeof(DEVMODE);
for (int i = 0; EnumDisplaySettings(NULL, i, &settings); ++i )
{
printf("%dx%d: %d bpp %d Hz\n",
settings.dmPelsWidth, settings.dmPelsHeight,
settings.dmBitsPerPel, settings.dmDisplayFrequency);
}
getchar();
return 0;
}
800x600: 32 bpp 60 Hz
800x600: 32 bpp 70 Hz
800x600: 32 bpp 72 Hz
800x600: 32 bpp 75 Hz
800x600: 32 bpp 85 Hz
Last edited by entryway on 12-23-09 at 12:43
|