🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Know how i can change screen resolutions?

Started by
1 comment, last by shamen 23 years, 12 months ago
Anyone know a way to change the screen resolution using xlib or something similar (ie the equivelent of ChangeDisplaySettings under win32)? I have my program running in a window, but would like it to run fullscreen. thanks.
Advertisement
ok, its a little sad replying to my own post (has it come to this!) but i have just discovered how to change the video mode under X windows (though i havent tried it yet). Thought some other people might be interested.

There is actually an XFree86 extension which does this. You can find the manual page here:

http://www.xfree86.org/4.0/XF86VidModeSwitchMode.3.html

(sorry dont know how to do fancy links)

So the method goes like this:
Switch your video mode using the XFree86 extension.
Create an X Window the size of your screen with the OverrideRedirect set to True
Grab keyboard and mouse input.

I''ll try this tonight and see if it works.

Cheers.
Chances are it won''t work first time.

Before you change the video mode, you need to enumerate the video mode list (something like XF86GetVideoLines(), but don''t quote me on that).

The man page for XF86VideoSwitchMode() also covers several other related functions, so these should help you out a little.

One thing to note though: XFree86 3 (not sure about 4) didn''t support the changing of colour depths. They said this feature was going to be available in XF86 4, but don''t get your hopes up.

Mark Collins (aka Nurgle)
me@thisisnurgle.org.uk

After careful deliberation, I have come to the conclusion that Nazrix is not cool. I am sorry for any inconvienience my previous mistake may have caused. We now return you to the original programming

This topic is closed to new replies.

Advertisement