-
OpenGL & Windows Resolution
Hi Everyone,
Is there a simple way to detect the number to colors your video driver is using. Either an OpenGL or MFC solution would be nice. I'm running into a problem where I've made some assumptions in my coding (that I can't back out), that require the desktop to be running with > 256 colors. I'm developing on the Windows platform (95/98/2k) and I can't find anything in the Visual C++ that helps. I figure you guys have already dealt with this.
Any help is appreciated!
Thanks!
-Mark
-
Junior Member
Regular Contributor
Re: OpenGL & Windows Resolution
You need to retrieve the desktop settings?
Use the EnumDisplaySettings() function. Search MSDN for two things:
EnumDisplaySettings
DEVMODE
You'll need to create a struct DEVMODE as per the spec, then pass it to the EnumDisplaySettings function. This will allow you to query the current settings or the registry settings for the display. The specific setting you need is
devMode.dmBitsPerPel
Then, if you're feeling frisky, you redefine that value and call ChangeDisplaySettings(), passing the new devMode values. Just be careful not to force a registry update, else the desktop won't revert back to the original state when the app closes.
Does that help?
Glossifah
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules