Jump to content
  • Advertisement
Sign in to follow this  
Prune

NVRotate from C++ ??

This topic is 3543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to rotate the Windows desktop to portrait mode from within my C++ program. I can do it from the NVidia control panel, but how do I do it from C++? Some Win32 API call instead of NVRotate is fine as well, as long as the hardware cursor also gets rotated as NVRotate does. I cannot use ChangeDisplaySettingsEx() since EnumDisplaySettingsEx() shows only 0 for allowable display orientation, and thus NVRotate must be doing the rotation through some other call to the NVidia driver :( [Edit] This seems to work, in case anyone else needs this sort of thing: system("rundll32 NvCpl.dll,dtcfg rotate 0 90"); Now, how do I do it on Linux? [Edited by - Prune on January 7, 2009 4:10:37 PM]

Share this post


Link to post
Share on other sites
Advertisement
Try the RandR extension first; you can use the xrandr program from the command line to try rotate your display, there is help all over the web on it. If that works you can do it from your program with the system call or by linking with libXrandr and calling the right functions.

If that doesn't work (I don't know how well Nvidia's closed source driver supports RandR), you can try the NVCONTROL extension. Nvidia provides the nvidia-settings program, which you can use from the command line or as a GUI application, and it is also open source so you can see what functions it calls to get rotation using NVCONTROL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!