Page MenuHome

Mode switching for GHOST under X11
Closed, ArchivedPublicPATCH

Description

This patch adds the ability to change screen resolutions under X Windows (e.g. on GNU/Linux). It is a port of the mode-setting code in Quake 2, which is licensed under the GPL version 2+.

The patch works on my system (Ubuntu 11.10 64-bit, ATI Radeon with fglrx driver) - however, after changing modes, GLSL fails to initialise: calls to glCreateShaderObjectARB return zero. I don't know why this happens. Looking through the Quake 3 source, it doesn't look like anything else is done to fix the GL state. But I'll keep looking.

Attached is the first cut of the patch, and a test scene. By running the scene through blenderplayer, the screen resolution should be set to 640x480 until the player exits. The test scene also has a script that changes the modes mid-game, but that won't work without another patch for the game engine API.

Event Timeline

attached a patch with updates to cmake part.

x11_modeswitch_2.patch: Minor fix for cmake vidmode library test.

Miraculously, GLSL is working for me now. Maybe I just needed to do a clean rebuild!

Committed with Campbell's approval, r43070. Currently disabled by default; enable by turning on WITH_X11_XF86VMODE in cmake.

Forgot to mention: thanks to Campbell for helping with CMake, and with testing!

Adding a new patch (x11_modeswitch_3) that implements the mode-getting functions too. Cam, maybe this fixes the problems you were seeing? Before I implemented these in the SDL version, I was seeing crashes too. This patch applies against r43233 (the previous patch has already been committed to trunk).

This patch also enables the xvidmode extension by default for cmake.

Cam, is it ok to commit this?

Committed, r43286. Thanks, Campbell!

Alex Fraser (z0r) changed the task status from Unknown Status to Unknown Status.Jan 11 2012, 1:29 PM