Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Multi Monitor Info, resolutions, graphics cards #477009
05/02/19 09:17
05/02/19 09:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
I want to share a code snippet with you that I had made some time ago to enumerate all available monitor resolutions (at the current frequency - you can get others as well, easy to change) on all connected monitors.

Screenshot of the test program:


Download: http://www.pogostuck.com/multiMonitorInfo.zip

How to use: Have a look at the test program. You only need to call multiMonitorGetInfo() once.
Open multiMonitorInfo.h and check what info is available.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Multi Monitor Info, resolutions, graphics cards [Re: Superku] #477012
05/02/19 11:27
05/02/19 11:27
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Thank you Felix! You are generous as always.

There is just one little thing. Not a big deal for me but i want to let you know, because since your game is already on market, maybe you'd like to change it. (though it is not necessary for my opinion.)

Your codes can't detect virtual super resolution, until i select one of them. For example; my monitor support maximum 1920x1080. With super resolution option, it's reach 3840x2160.

When i run the code, i get this (desktop resolution is 1920x1080);


then i set the resolution 2304x1296 and i get all resolution;



So, as long as the resolution is in 1920x1080, pogostuck can't detect higher (virtual) resolutions.

Re: Multi Monitor Info, resolutions, graphics cards [Re: Emre] #477013
05/02/19 11:46
05/02/19 11:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Interesting, I did not know that was a thing (super resolutions).
However, I'm using Windows functions to grab all available resolutions, and what you see is what Windows reports.
Can you pick higher/ super resolutions in other games?


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Multi Monitor Info, resolutions, graphics cards [Re: Superku] #477014
05/02/19 11:55
05/02/19 11:55
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Yes. Tomb Raider series, Resident Evil 7, Dying Light, even Dishonored (very old game) detect and list all resolution. (no need to change desktop resolution )

Edit: i understand it's windows reports but it's also odd that it doesn't list super resolutions, until i change desktop resolution to higher. it doesn't happen in other games. Maybe other developers are using another method to get resolution list. i don't know.

Last edited by Emre; 05/02/19 12:17.
Re: Multi Monitor Info, resolutions, graphics cards [Re: Emre] #477015
05/02/19 12:22
05/02/19 12:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Okay, thank you. Will look that up later or the next couple of days!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Multi Monitor Info, resolutions, graphics cards [Re: Superku] #477018
05/02/19 14:38
05/02/19 14:38
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
You are welcome! And be ready, i think i found the cause of the problem and it's bigger than i thought.

it's about desktop refresh rate. When it is set to the highest freq (60 hz), your code can list all resolutions. But, when it was set to 59, it can't detect all resolutions.

i realized; when i set resolution to 2304x1296, refresh rate automatically change to 60 hz. that is why your code detect all resolutions when desktop resolution is 2304x1296.

Most interesting thing is, when i set it 50hz, i just get two resolution:


image upload


as far as i understand, it's related with this code: "displayMode.RefreshRate == multiMonitorInfo.currentFrequency", but you are the expert.

Re: Multi Monitor Info, resolutions, graphics cards [Re: Emre] #477021
05/02/19 15:28
05/02/19 15:28
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Oh, good find!
Yeah, I included that line to not have to deal with different frequencies. Did not know that that's resolution dependent.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Multi Monitor Info, resolutions, graphics cards [Re: Superku] #477022
05/02/19 18:18
05/02/19 18:18
Joined: Jul 2007
Posts: 619
Turkey, Izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 619
Turkey, Izmir
Here is a quick solution;

Code:
if(multiMonitorInfo.numMonitors)
	{
		int count = 0;
		// get screen rects
		multiMonitorInfo.monitorInfo = (MYMONITORINFO*)sys_malloc(sizeof(MYMONITORINFO)*multiMonitorInfo.numMonitors);
		EnumDisplayMonitors(NULL, NULL, MonitorEnumProc, (LPARAM)&count);
		
		// get display modes
		D3DDISPLAYMODE displayMode;
		int i,j;
		int last_res[2];
		last_res[0]=0;
		last_res[1]=0;
		for(i = 0; i < multiMonitorInfo.numMonitors; i++)
		{
			MYMONITORINFO *pinfo = &(multiMonitorInfo.monitorInfo)[i];
			int maxModes = pd3dKu->GetAdapterModeCount(i,D3DFMT_X8R8G8B8);
			for(j = 0; j < maxModes; j++)
			{
				if(D3D_OK != pd3dKu->EnumAdapterModes(i,D3DFMT_X8R8G8B8,j,&displayMode)) break;
				if(displayMode.Width >= MMminWidth && displayMode.Height >= MMminHeight/* && displayMode.RefreshRate == multiMonitorInfo.currentFrequency*/) 
				{
					if(displayMode.Width==last_res[0]&&displayMode.Height==last_res[1])
					{
						//skip
					}
					else
					{
						pinfo->numModes++;	
						last_res[0]=displayMode.Width;
						last_res[1]=displayMode.Height;
					}
					
				}
				
				
			}
			if(pinfo->numModes)
			{
				last_res[0]=0;
				last_res[1]=0;
				pinfo->displayModes = (DISPLAYMODE*)sys_malloc(sizeof(DISPLAYMODE)*pinfo->numModes);
				int k = 0;
				for(j = 0; j < maxModes; j++)
				{
					if(D3D_OK != pd3dKu->EnumAdapterModes(i,D3DFMT_X8R8G8B8,j,&displayMode)) break;
					if(displayMode.Width >= MMminWidth && displayMode.Height >= MMminHeight /*&& displayMode.RefreshRate == multiMonitorInfo.currentFrequency*/)
					{
						
						if(displayMode.Width==last_res[0]&&displayMode.Height==last_res[1])
						{
							//skip
						}
						else
						{
							DISPLAYMODE* pMode = &(pinfo->displayModes)[k];
							pMode->Width = displayMode.Width;
							pMode->Height = displayMode.Height;
							k++;	
							last_res[0]=displayMode.Width;
							last_res[1]=displayMode.Height;	
						}
						
						
						
					}
				}
			}
			else pinfo->displayModes = NULL;
			MMInfoSortDisplayModes(pinfo,0);
		}
	}



Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1