1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
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>
|