Hi,
I'm working on a 2D sprite routine in full-screen mode
I need the actual monitor RefreshRate to do some calculations.
According to MSDN when enumerating RefreshRates it can return 0 Hz.
The value of 0 Hz indicates an adapter default.
But with 0 Hz I can't use that value for my calculations because it could be 60 or 85 Hz etc.
Now I'm curious if it returns 0 Hz, if it is only the first of all enumerated values?
I have enumerated all refreshrates for a 1024 X 768 full-screen resolution.
So, my question is: If someone of you gets a returned refreshrate of 0Hz, could you then post all "Hz" values?
Thanks.
13 modes, 60Hz for both 1024 and 1366px wide. Acer Notebook on Win7-64, lowcost NVidia card.
Biterider
I have never seen a refresh rate of 0 or 1 in my whole life but Microsoft says they exist.
I have also never seen a 0 Hz refreshrate.
Thinking it all over, it could be that if you set 0 Hz as an input value, the adapter automatically sets it to the default refreshrate.
I have just tested this with an input value of 0 and the monitors refreshrate is set to 60 Hz. ( my default refreshrate )
If I'm correct, when enumerating the refreshrate output values, it will never send back 0 Hz refreshrates because 0 can only be an input value?
I hope this is the case, MSDN is not very clear on that subject.
Hi,
Windows 2000, no response. No required DLL?
Windows XP
AdapterModeCount: 13
Monitor Aspect Ratio: 1.333
1024x768 60 Hz
Actual 1024x768 60 Hz
Windows 8.1
AdapterModeCount: 10
Monitor Aspect Ratio: 1.779
1024x768 40 Hz
1024x768 60 Hz
Actual 1366x768 60 Hz
HTH,
Steve N.
Hi siekmanski, the program fails to run on my system. It seems that fails in the function call to CreateDirect3d9 something... :idea:
Siekmanski i think i was wrong the problem is not there. Maybe it's at some point when making a call to a d3d9 function when an error with "a not module found" message error and then seems like occurs an infinite loop. But i can't confirm this because i would have to play for a long time with the debugger...What do you think it is? :idea:
Hi Felipe,
Try this version, it will return an error number so I have an indication were to look in the code.
Be sure to unzip the files, it could be that the bitmap images are not correctly loaded when executed from within the zip file.
Hi Siekmanski!
I don't pay to much atention yesterday! Work perfectly if you open and close, but if program lost focus then there is a problem if you try to activate it.
Hi HSE,
Yeah I know, I didn't include "restore lost devices" when focus is lost. :biggrin:
Maybe I'll implement code that prevents using ALT-TAB, I'm not sure yet....
No problem then, just a "feature", :biggrin:
This is an alternative way of enumeration (I believe Siekmanski is doing it from Dx9):
#include <stdio.h>
#include <conio.h>
#include <windows.h>
int main()
{
DWORD iMode = 0;
BOOL bRetVal;
printf("Available Video Modes\n\n");
do
{
DEVMODE dm = { 0 };
bRetVal = EnumDisplaySettings(NULL, iMode, &dm);
iMode++;
if (bRetVal)
{
printf("%d x %d, %d bits %dhtz\n", dm.dmPelsWidth,
dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency);
}
}
while (bRetVal);
_getch();
}
Available Video Modes
640 x 480, 32 bits 59htz
640 x 480, 32 bits 60htz
640 x 480, 32 bits 75htz
720 x 480, 32 bits 60htz
720 x 480, 32 bits 59htz
720 x 576, 32 bits 50htz
800 x 600, 32 bits 60htz
800 x 600, 32 bits 75htz
1024 x 768, 32 bits 60htz
1152 x 864, 32 bits 60htz
1152 x 864, 32 bits 60htz
1152 x 864, 32 bits 60htz
1176 x 664, 32 bits 50htz
1176 x 664, 32 bits 50htz
1176 x 664, 32 bits 50htz
1176 x 664, 32 bits 60htz
1176 x 664, 32 bits 60htz
1176 x 664, 32 bits 60htz
1176 x 664, 32 bits 59htz
1176 x 664, 32 bits 59htz
1176 x 664, 32 bits 59htz
1280 x 720, 32 bits 60htz
1280 x 720, 32 bits 59htz
1280 x 720, 32 bits 50htz
1280 x 768, 32 bits 60htz
1280 x 768, 32 bits 60htz
1280 x 768, 32 bits 60htz
1280 x 800, 32 bits 60htz
1280 x 960, 32 bits 60htz
1280 x 960, 32 bits 60htz
1280 x 960, 32 bits 60htz
1280 x 1024, 32 bits 60htz
1360 x 768, 32 bits 60htz
1360 x 768, 32 bits 60htz
1360 x 768, 32 bits 60htz
1366 x 768, 32 bits 60htz
1366 x 768, 32 bits 60htz
1366 x 768, 32 bits 60htz
1600 x 900, 32 bits 60htz
1600 x 1024, 32 bits 59htz
1600 x 1024, 32 bits 60htz
1600 x 1024, 32 bits 59htz
1600 x 1024, 32 bits 60htz
1600 x 1024, 32 bits 59htz
1600 x 1024, 32 bits 60htz
1680 x 1050, 32 bits 59htz
1680 x 1050, 32 bits 60htz
1768 x 992, 32 bits 25htz
1768 x 992, 32 bits 25htz
1768 x 992, 32 bits 25htz
1768 x 992, 32 bits 30htz
1768 x 992, 32 bits 30htz
1768 x 992, 32 bits 30htz
1768 x 992, 32 bits 29htz
1768 x 992, 32 bits 29htz
1768 x 992, 32 bits 29htz
1920 x 1080, 32 bits 60htz
1920 x 1080, 32 bits 59htz
1920 x 1080, 32 bits 50htz
1920 x 1080, 32 bits 30htz
1920 x 1080, 32 bits 29htz
1920 x 1080, 32 bits 25htz
Interesting that the AdaptarModeCount I got from Siemanski's was 36 and here I have more modes.
Yes I used DX9 for the enumeration and only for 32 bits resolutions without the alpha channel.
I have unzipped correctly both files. This time i see a black color full screen for 1 or 2 seconds and then the program is stopped by windows. :( I this some indicator of a problem with my graphic video adapter?? :idea:
No messagebox with an error number?
The program needs d3d9.dll, gdiplus.dll and the SSE2 instruction set.
No message. And i have those .dlls and also my machine can execute sse2 instruction set. :idea:
The debugger starts to behave buggy after the call to createwindowex :idea: Buggy here means that after that call i can only stop the debugging process by terminating the debugger itself with the task manager :idea:
when the program crashes, windows tells me that the module igdumd32.dll has the problem :idea:
Hi Felipe,
It could be a driver issue,
https://software.intel.com/en-us/forums/developing-games-and-graphics-on-intel/topic/292778
seems like that is, thanks. :icon14:
Hi Felipe,
It maybe that 1 of the renderstates I use chokes your graphics card.
Send you a PM.