diff options
Diffstat (limited to '')
-rw-r--r-- | pipermail/nel/2001-February/000293.html | 305 |
1 files changed, 305 insertions, 0 deletions
diff --git a/pipermail/nel/2001-February/000293.html b/pipermail/nel/2001-February/000293.html new file mode 100644 index 00000000..de2c505e --- /dev/null +++ b/pipermail/nel/2001-February/000293.html @@ -0,0 +1,305 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> + <HEAD> + <TITLE> [Nel] Linux fullscreen patches</TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:dayta%40ucc.gu.uwa.edu.au"> + <LINK REL="Previous" HREF="000302.html"> + <LINK REL="Next" HREF="000296.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[Nel] Linux fullscreen patches</H1> + <B>Leighton Haynes</B> + <A HREF="mailto:dayta%40ucc.gu.uwa.edu.au" + TITLE="[Nel] Linux fullscreen patches">dayta@ucc.gu.uwa.edu.au</A><BR> + <I>Wed, 28 Feb 2001 20:16:17 +0800</I> + <P><UL> + <LI> Previous message: <A HREF="000302.html">[Nel] Re: Nel digest, Vol 1 #64 - 21 msgs</A></li> + <LI> Next message: <A HREF="000296.html">[Nel] Linux fullscreen patches</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#293">[ date ]</a> + <a href="thread.html#293">[ thread ]</a> + <a href="subject.html#293">[ subject ]</a> + <a href="author.html#293">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>--vkogqOf2sHV7VnPd +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi Guys, + Attached to this should be 3 diffs against the current cvs tree + to enable fullscreen under linux using the XFree86 VidMode + extensions. The aptches are for the configure.in script, + and driver_opengl.{cpp,h}. + + To enable it you need to remake the configure script (./bootstrap) + and run configure with the --with-xf86vidmode=<position of the + Xxf86vm lib> - usually /usr/X11R6/lib. If this option isn't given, + it will currently compile without fullscreen support. + + Anyhow, have a play, if anyone finds bugs... erm.. bug me ;) + +Leighton... + +-- + +Part-time student. Full-time Programmer. +Seeking the 36 hour day and the 10 hour working week. +(08) 9272 9058 (Home - like I'm ever there) +0401 335 136 (Mobile - like it's ever on) + +--vkogqOf2sHV7VnPd +Content-Type: text/plain; charset=us-ascii +Content-Disposition: attachment; filename="diff.configure.in" + +Index: configure.in +=================================================================== +RCS file: /home/cvsroot/code/nel/configure.in,v +retrieving revision 1.23 +diff -r1.23 configure.in +232a233,251 +><i> dnl ============================================ +</I>><i> dnl Check for XF86VidMode extension (-lXxf86vm) +</I>><i> dnl ============================================ +</I>><i> AC_MSG_CHECKING("for XF86VidMode extension") +</I>><i> AC_ARG_WITH( xf86vidmode, +</I>><i> [ --with-xf86vidmode=<path> path to the XF86VidMode lib. +</I>><i> e.g. /usr/X11R6/lib], +</I>><i> [VMLIB_DIR=$with_xf86vidmode +</I>><i> AC_MSG_RESULT(using VidMode library located in $with_xf86vidmode.)], +</I>><i> AC_MSG_RESULT(Compiling without Xf86VidMode and hence fullscreen support to compile with XF86VidMode support, use --with-xf86vidmode=<pathtolib>) +</I>><i> ) +</I>><i> +</I>><i> if test X"$VMLIB_DIR" != X; +</I>><i> then +</I>><i> LIBS="-L$VMLIB_DIR -lXxf86vm $LIBS"; +</I>><i> CXXFLAGS="$CXXFLAGS -DXF86VIDMODE"; +</I>><i> fi +</I>><i> +</I>><i> +</I> +--vkogqOf2sHV7VnPd +Content-Type: text/plain; charset=us-ascii +Content-Disposition: attachment; filename="diff.driver_opengl.cpp" + +Index: driver_opengl.cpp +=================================================================== +RCS file: /home/cvsroot/code/nel/src/3d/driver/opengl/driver_opengl.cpp,v +retrieving revision 1.75 +diff -r1.75 driver_opengl.cpp +140d139 +< _FullScreen= false; +144c143,149 +< #endif // NL_OS_WINDOWS +--- +><i> #elif defined (NL_OS_UNIX) // NL_OS_WINDOWS +</I>><i> #ifdef XF86VIDMODE +</I>><i> memset(&_OldScreenMode,0,sizeof(_OldScreenMode));// zero the old screen mode +</I>><i> #endif //XF86VIDMODE +</I>><i> #endif +</I>><i> +</I>><i> _FullScreen= false; +</I>225a231 +><i> { +</I>226a233 +><i> } +</I>351c358 +< { +--- +><i> { +</I>353c360 +< } +--- +><i> } +</I>355c362 +< { +--- +><i> { +</I>357c364 +< } +--- +><i> } +</I>364c371,385 +< attr.override_redirect = False; +--- +><i> #ifdef XF86VIDMODE +</I>><i> // If we're going to attempt fullscreen, we need to set redirect to True, +</I>><i> // This basically places the window with no borders in the top left +</I>><i> // corner of the screen. +</I>><i> if (mode.Windowed) +</I>><i> { +</I>><i> attr.override_redirect = False; +</I>><i> } +</I>><i> else +</I>><i> { +</I>><i> attr.override_redirect = True; +</I>><i> } +</I>><i> #else +</I>><i> attr.override_redirect = False; +</I>><i> #endif +</I>409,411c430,507 +< // XEvent event; +< // XIfEvent(dpy, &event, WaitForNotify, (char *)this); +< +--- +><i> #ifdef XF86VIDMODE +</I>><i> if (!mode.Windowed) +</I>><i> { +</I>><i> +</I>><i> // Set window to the right size, map it to the display, and raise it +</I>><i> // to the front +</I>><i> XResizeWindow(dpy,win,mode.Width,mode.Height); +</I>><i> XMapRaised(dpy,win); +</I>><i> XRaiseWindow(dpy, win); +</I>><i> +</I>><i> // grab the mouse and keyboard on the fullscreen window +</I>><i> if ((XGrabPointer(dpy, win, True, 0, +</I>><i> GrabModeAsync, GrabModeAsync, +</I>><i> win, None, CurrentTime) != GrabSuccess) || +</I>><i> (XGrabKeyboard(dpy, win, True, +</I>><i> GrabModeAsync, GrabModeAsync, CurrentTime) != 0) ) +</I>><i> { +</I>><i> // Until I work out how to deal with this nicely, it just gives +</I>><i> // an error and exits the prorgam. +</I>><i> nlerror("Unable to grab keyboard and mouse\n"); +</I>><i> } +</I>><i> else +</I>><i> { +</I>><i> // Save the old screen mode and dotclock +</I>><i> memset(&_OldScreenMode, 0, sizeof(_OldScreenMode)); +</I>><i> XF86VidModeGetModeLine(dpy, +</I>><i> DefaultScreen(dpy), +</I>><i> &_OldDotClock, +</I>><i> &_OldScreenMode); +</I>><i> // Save the old viewport +</I>><i> XF86VidModeGetViewPort(dpy, +</I>><i> DefaultScreen(dpy), +</I>><i> &_OldX, +</I>><i> &_OldY); +</I>><i> +</I>><i> // get a list of modes, search for an appropriate one. +</I>><i> XF86VidModeModeInfo **modes; +</I>><i> int nmodes; +</I>><i> if (XF86VidModeGetAllModeLines(dpy, +</I>><i> DefaultScreen(dpy), +</I>><i> &nmodes,&modes)) +</I>><i> { +</I>><i> int mode_index = -1; // Gah, magic numbers all bad. +</I>><i> for (int i = 0; i < nmodes; i++) +</I>><i> { +</I>><i> nldebug("Available mode - %dx%d\n",mode.Width,mode.Height); +</I>><i> if( (modes[i]->hdisplay == mode.Width) && +</I>><i> (modes[i]->vdisplay == mode.Height)) +</I>><i> { +</I>><i> mode_index = i; +</I>><i> } +</I>><i> } +</I>><i> // Switch to the mode +</I>><i> if (mode_index != -1) +</I>><i> { +</I>><i> if(XF86VidModeSwitchToMode(dpy, +</I>><i> DefaultScreen(dpy), +</I>><i> modes[mode_index])) +</I>><i> { +</I>><i> nlinfo("Switching to mode %dx%d,\n",mode.Width, +</I>><i> mode.Height); +</I>><i> XF86VidModeSetViewPort(dpy,DefaultScreen(dpy),0, 0); +</I>><i> _FullScreen = true; +</I>><i> } +</I>><i> } +</I>><i> else +</I>><i> { +</I>><i> // This is a problem, since we've nuked the border from +</I>><i> // window in the setup stage, until I work out how +</I>><i> // to get it back (recreate window? seems excessive) +</I>><i> nlerror("Couldn't find an appropriate mode %dx%d\n", +</I>><i> mode.Width, +</I>><i> mode.Height); +</I>><i> } +</I>><i> } +</I>><i> } +</I>><i> } +</I>><i> #endif // XF86VIDMODE +</I>659c755,776 +< #endif // NL_OS_WINDOWS +--- +><i> #elif defined (NL_OS_UNIX)// NL_OS_WINDOWS +</I>><i> +</I>><i> #ifdef XF86VIDMODE +</I>><i> if(_FullScreen) +</I>><i> { +</I>><i> XF86VidModeModeInfo info; +</I>><i> nlinfo("Switching back to original mode \n"); +</I>><i> +</I>><i> // This is a bit ugly - a quick hack to copy the ModeLine structure +</I>><i> // into the modeInfo structure. +</I>><i> memcpy((XF86VidModeModeLine *)((char *)&info + sizeof(info.dotclock)), &_OldScreenMode, sizeof(XF86VidModeModeLine)); +</I>><i> info.dotclock = _OldDotClock; +</I>><i> +</I>><i> nlinfo("Mode is %dx%d,\n",info.hdisplay,info.vdisplay); +</I>><i> XF86VidModeSwitchToMode(dpy,DefaultScreen(dpy),&info); +</I>><i> nlinfo("Switching viewporr to %d,%d,\n",_OldX, _OldY); +</I>><i> XF86VidModeSetViewPort(dpy,DefaultScreen(dpy),_OldX,_OldY); +</I>><i> // Ungrab the keyboard (probably not necessary); +</I>><i> XUngrabKeyboard(dpy, CurrentTime); +</I>><i> } +</I>><i> #endif // XF86VIDMODE +</I>><i> #endif // NL_OS_UNIX +</I> +--vkogqOf2sHV7VnPd +Content-Type: text/plain; charset=us-ascii +Content-Disposition: attachment; filename="diff.driver_opengl.h" + +Index: driver_opengl.h +=================================================================== +RCS file: /home/cvsroot/code/nel/src/3d/driver/opengl/driver_opengl.h,v +retrieving revision 1.50 +diff -r1.50 driver_opengl.h +40a41 +><i> #include <X11/extensions/xf86vmode.h> +</I>219a221 +><i> bool _FullScreen; +</I>230d231 +< bool _FullScreen; +238a240,244 +><i> //#ifdef XF86VIDMODE +</I>><i> int _OldDotClock; // old dotclock +</I>><i> XF86VidModeModeLine _OldScreenMode; // old modeline +</I>><i> int _OldX, _OldY; //Viewport settings +</I>><i> //#endif //XF86VIDMODE +</I>240d245 +< + +--vkogqOf2sHV7VnPd-- + +</pre> + + + + + + + + + + + + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI> Previous message: <A HREF="000302.html">[Nel] Re: Nel digest, Vol 1 #64 - 21 msgs</A></li> + <LI> Next message: <A HREF="000296.html">[Nel] Linux fullscreen patches</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#293">[ date ]</a> + <a href="thread.html#293">[ thread ]</a> + <a href="subject.html#293">[ subject ]</a> + <a href="author.html#293">[ author ]</a> + </LI> + </UL> +</body></html> |