aboutsummaryrefslogtreecommitdiff
path: root/pipermail/nel/2001-February/000293.html
diff options
context:
space:
mode:
Diffstat (limited to 'pipermail/nel/2001-February/000293.html')
-rw-r--r--pipermail/nel/2001-February/000293.html305
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=&lt;position of the
+ Xxf86vm lib&gt; - 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=&quot;diff.configure.in&quot;
+
+Index: configure.in
+===================================================================
+RCS file: /home/cvsroot/code/nel/configure.in,v
+retrieving revision 1.23
+diff -r1.23 configure.in
+232a233,251
+&gt;<i> dnl ============================================
+</I>&gt;<i> dnl Check for XF86VidMode extension (-lXxf86vm)
+</I>&gt;<i> dnl ============================================
+</I>&gt;<i> AC_MSG_CHECKING(&quot;for XF86VidMode extension&quot;)
+</I>&gt;<i> AC_ARG_WITH( xf86vidmode,
+</I>&gt;<i> [ --with-xf86vidmode=&lt;path&gt; path to the XF86VidMode lib.
+</I>&gt;<i> e.g. /usr/X11R6/lib],
+</I>&gt;<i> [VMLIB_DIR=$with_xf86vidmode
+</I>&gt;<i> AC_MSG_RESULT(using VidMode library located in $with_xf86vidmode.)],
+</I>&gt;<i> AC_MSG_RESULT(Compiling without Xf86VidMode and hence fullscreen support to compile with XF86VidMode support, use --with-xf86vidmode=&lt;pathtolib&gt;)
+</I>&gt;<i> )
+</I>&gt;<i>
+</I>&gt;<i> if test X&quot;$VMLIB_DIR&quot; != X;
+</I>&gt;<i> then
+</I>&gt;<i> LIBS=&quot;-L$VMLIB_DIR -lXxf86vm $LIBS&quot;;
+</I>&gt;<i> CXXFLAGS=&quot;$CXXFLAGS -DXF86VIDMODE&quot;;
+</I>&gt;<i> fi
+</I>&gt;<i>
+</I>&gt;<i>
+</I>
+--vkogqOf2sHV7VnPd
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename=&quot;diff.driver_opengl.cpp&quot;
+
+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
+&lt; _FullScreen= false;
+144c143,149
+&lt; #endif // NL_OS_WINDOWS
+---
+&gt;<i> #elif defined (NL_OS_UNIX) // NL_OS_WINDOWS
+</I>&gt;<i> #ifdef XF86VIDMODE
+</I>&gt;<i> memset(&amp;_OldScreenMode,0,sizeof(_OldScreenMode));// zero the old screen mode
+</I>&gt;<i> #endif //XF86VIDMODE
+</I>&gt;<i> #endif
+</I>&gt;<i>
+</I>&gt;<i> _FullScreen= false;
+</I>225a231
+&gt;<i> {
+</I>226a233
+&gt;<i> }
+</I>351c358
+&lt; {
+---
+&gt;<i> {
+</I>353c360
+&lt; }
+---
+&gt;<i> }
+</I>355c362
+&lt; {
+---
+&gt;<i> {
+</I>357c364
+&lt; }
+---
+&gt;<i> }
+</I>364c371,385
+&lt; attr.override_redirect = False;
+---
+&gt;<i> #ifdef XF86VIDMODE
+</I>&gt;<i> // If we're going to attempt fullscreen, we need to set redirect to True,
+</I>&gt;<i> // This basically places the window with no borders in the top left
+</I>&gt;<i> // corner of the screen.
+</I>&gt;<i> if (mode.Windowed)
+</I>&gt;<i> {
+</I>&gt;<i> attr.override_redirect = False;
+</I>&gt;<i> }
+</I>&gt;<i> else
+</I>&gt;<i> {
+</I>&gt;<i> attr.override_redirect = True;
+</I>&gt;<i> }
+</I>&gt;<i> #else
+</I>&gt;<i> attr.override_redirect = False;
+</I>&gt;<i> #endif
+</I>409,411c430,507
+&lt; // XEvent event;
+&lt; // XIfEvent(dpy, &amp;event, WaitForNotify, (char *)this);
+&lt;
+---
+&gt;<i> #ifdef XF86VIDMODE
+</I>&gt;<i> if (!mode.Windowed)
+</I>&gt;<i> {
+</I>&gt;<i>
+</I>&gt;<i> // Set window to the right size, map it to the display, and raise it
+</I>&gt;<i> // to the front
+</I>&gt;<i> XResizeWindow(dpy,win,mode.Width,mode.Height);
+</I>&gt;<i> XMapRaised(dpy,win);
+</I>&gt;<i> XRaiseWindow(dpy, win);
+</I>&gt;<i>
+</I>&gt;<i> // grab the mouse and keyboard on the fullscreen window
+</I>&gt;<i> if ((XGrabPointer(dpy, win, True, 0,
+</I>&gt;<i> GrabModeAsync, GrabModeAsync,
+</I>&gt;<i> win, None, CurrentTime) != GrabSuccess) ||
+</I>&gt;<i> (XGrabKeyboard(dpy, win, True,
+</I>&gt;<i> GrabModeAsync, GrabModeAsync, CurrentTime) != 0) )
+</I>&gt;<i> {
+</I>&gt;<i> // Until I work out how to deal with this nicely, it just gives
+</I>&gt;<i> // an error and exits the prorgam.
+</I>&gt;<i> nlerror(&quot;Unable to grab keyboard and mouse\n&quot;);
+</I>&gt;<i> }
+</I>&gt;<i> else
+</I>&gt;<i> {
+</I>&gt;<i> // Save the old screen mode and dotclock
+</I>&gt;<i> memset(&amp;_OldScreenMode, 0, sizeof(_OldScreenMode));
+</I>&gt;<i> XF86VidModeGetModeLine(dpy,
+</I>&gt;<i> DefaultScreen(dpy),
+</I>&gt;<i> &amp;_OldDotClock,
+</I>&gt;<i> &amp;_OldScreenMode);
+</I>&gt;<i> // Save the old viewport
+</I>&gt;<i> XF86VidModeGetViewPort(dpy,
+</I>&gt;<i> DefaultScreen(dpy),
+</I>&gt;<i> &amp;_OldX,
+</I>&gt;<i> &amp;_OldY);
+</I>&gt;<i>
+</I>&gt;<i> // get a list of modes, search for an appropriate one.
+</I>&gt;<i> XF86VidModeModeInfo **modes;
+</I>&gt;<i> int nmodes;
+</I>&gt;<i> if (XF86VidModeGetAllModeLines(dpy,
+</I>&gt;<i> DefaultScreen(dpy),
+</I>&gt;<i> &amp;nmodes,&amp;modes))
+</I>&gt;<i> {
+</I>&gt;<i> int mode_index = -1; // Gah, magic numbers all bad.
+</I>&gt;<i> for (int i = 0; i &lt; nmodes; i++)
+</I>&gt;<i> {
+</I>&gt;<i> nldebug(&quot;Available mode - %dx%d\n&quot;,mode.Width,mode.Height);
+</I>&gt;<i> if( (modes[i]-&gt;hdisplay == mode.Width) &amp;&amp;
+</I>&gt;<i> (modes[i]-&gt;vdisplay == mode.Height))
+</I>&gt;<i> {
+</I>&gt;<i> mode_index = i;
+</I>&gt;<i> }
+</I>&gt;<i> }
+</I>&gt;<i> // Switch to the mode
+</I>&gt;<i> if (mode_index != -1)
+</I>&gt;<i> {
+</I>&gt;<i> if(XF86VidModeSwitchToMode(dpy,
+</I>&gt;<i> DefaultScreen(dpy),
+</I>&gt;<i> modes[mode_index]))
+</I>&gt;<i> {
+</I>&gt;<i> nlinfo(&quot;Switching to mode %dx%d,\n&quot;,mode.Width,
+</I>&gt;<i> mode.Height);
+</I>&gt;<i> XF86VidModeSetViewPort(dpy,DefaultScreen(dpy),0, 0);
+</I>&gt;<i> _FullScreen = true;
+</I>&gt;<i> }
+</I>&gt;<i> }
+</I>&gt;<i> else
+</I>&gt;<i> {
+</I>&gt;<i> // This is a problem, since we've nuked the border from
+</I>&gt;<i> // window in the setup stage, until I work out how
+</I>&gt;<i> // to get it back (recreate window? seems excessive)
+</I>&gt;<i> nlerror(&quot;Couldn't find an appropriate mode %dx%d\n&quot;,
+</I>&gt;<i> mode.Width,
+</I>&gt;<i> mode.Height);
+</I>&gt;<i> }
+</I>&gt;<i> }
+</I>&gt;<i> }
+</I>&gt;<i> }
+</I>&gt;<i> #endif // XF86VIDMODE
+</I>659c755,776
+&lt; #endif // NL_OS_WINDOWS
+---
+&gt;<i> #elif defined (NL_OS_UNIX)// NL_OS_WINDOWS
+</I>&gt;<i>
+</I>&gt;<i> #ifdef XF86VIDMODE
+</I>&gt;<i> if(_FullScreen)
+</I>&gt;<i> {
+</I>&gt;<i> XF86VidModeModeInfo info;
+</I>&gt;<i> nlinfo(&quot;Switching back to original mode \n&quot;);
+</I>&gt;<i>
+</I>&gt;<i> // This is a bit ugly - a quick hack to copy the ModeLine structure
+</I>&gt;<i> // into the modeInfo structure.
+</I>&gt;<i> memcpy((XF86VidModeModeLine *)((char *)&amp;info + sizeof(info.dotclock)), &amp;_OldScreenMode, sizeof(XF86VidModeModeLine));
+</I>&gt;<i> info.dotclock = _OldDotClock;
+</I>&gt;<i>
+</I>&gt;<i> nlinfo(&quot;Mode is %dx%d,\n&quot;,info.hdisplay,info.vdisplay);
+</I>&gt;<i> XF86VidModeSwitchToMode(dpy,DefaultScreen(dpy),&amp;info);
+</I>&gt;<i> nlinfo(&quot;Switching viewporr to %d,%d,\n&quot;,_OldX, _OldY);
+</I>&gt;<i> XF86VidModeSetViewPort(dpy,DefaultScreen(dpy),_OldX,_OldY);
+</I>&gt;<i> // Ungrab the keyboard (probably not necessary);
+</I>&gt;<i> XUngrabKeyboard(dpy, CurrentTime);
+</I>&gt;<i> }
+</I>&gt;<i> #endif // XF86VIDMODE
+</I>&gt;<i> #endif // NL_OS_UNIX
+</I>
+--vkogqOf2sHV7VnPd
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename=&quot;diff.driver_opengl.h&quot;
+
+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
+&gt;<i> #include &lt;X11/extensions/xf86vmode.h&gt;
+</I>219a221
+&gt;<i> bool _FullScreen;
+</I>230d231
+&lt; bool _FullScreen;
+238a240,244
+&gt;<i> //#ifdef XF86VIDMODE
+</I>&gt;<i> int _OldDotClock; // old dotclock
+</I>&gt;<i> XF86VidModeModeLine _OldScreenMode; // old modeline
+</I>&gt;<i> int _OldX, _OldY; //Viewport settings
+</I>&gt;<i> //#endif //XF86VIDMODE
+</I>240d245
+&lt;
+
+--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>