blob: 981df7c088a09abb8528eb4a66e4a8fcc86b447d [file] [log] [blame]
Brian Paul99cfc4e2003-12-06 17:26:50 +00001<HTML>
2
3<TITLE>Mesa glFBDev Driver</TITLE>
4
Brian Paul36da0452005-01-20 03:55:10 +00005<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
Brian Paul99cfc4e2003-12-06 17:26:50 +00008
9<center><H1>Mesa glFBDev Driver</H1></center>
10
11
12<H1>1. Introduction</H1>
13
14<p>
15The GLFBDev driver interface allows one to do OpenGL rendering into a
16framebuffer managed with the Linux's fbdev interface.
17</p>
18
19<p>
20Basically, the programmer uses the fbdev functions to initialize the
21graphics hardware and setup the framebuffer.
22Then, using a calls to Mesa's glFBDev API functions, one can render
23into the framebuffer with the OpenGL API functions.
24</p>
25
26<p>
27Note, only software rendering is supported; there is no hardware
28acceleration.
29</p>
30
31
32<p>
33The GL/glfbdev.h header file defines the glFBDev interface.
34</p>
35
36<p>
37The progs/fbdev/glfbdevtest.c demonstrates how to use the glFBDev interface.
38</p>
39
Brian Paulfe3242f2006-07-31 14:24:21 +000040
Brian Paul99cfc4e2003-12-06 17:26:50 +000041<p>
42For more information about fbdev, see the
43<a href="http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html" target="_parent">
44Framebuffer Howto</a>
45</p>
Brian Paulfe3242f2006-07-31 14:24:21 +000046<p>
47You will need at minimum, a framebuffer device, check /dev/fb0
48</p>
Brian Paul99cfc4e2003-12-06 17:26:50 +000049
50<h1>2. Compilation</h1>
51
52<p>
53To compile Mesa with support for the glFBDev interface:
54<pre>
Brian Paulfe3242f2006-07-31 14:24:21 +000055 make realclean
56 make linux-fbdev
Brian Paul99cfc4e2003-12-06 17:26:50 +000057</pre>
58
59<p>
60When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo.
61</p>
Brian Paulfe3242f2006-07-31 14:24:21 +000062<h1>3. Permissions</h1>
Brian Paul99cfc4e2003-12-06 17:26:50 +000063
64<p>
Brian Paulfe3242f2006-07-31 14:24:21 +000065Typically /dev/fb/0 is grouped to the video group. It may be useful to add
66your user to the video group so the demos will not have to be run as root.
67To use fbdevglut with the prefered tty input, you should add the user to the
68tty group as well
Brian Paul99cfc4e2003-12-06 17:26:50 +000069<p>
Brian Paul99cfc4e2003-12-06 17:26:50 +000070
Brian Paulfe3242f2006-07-31 14:24:21 +000071<h1>4. Using fbdevglut</h1>
72Almost all of the programs in the progs directory use glut, and they compile with fbdevglut.
Sean D'Epagnier7196cdd2006-08-10 10:21:17 +000073
Brian Paul99cfc4e2003-12-06 17:26:50 +000074<p>
Brian Paulfe3242f2006-07-31 14:24:21 +000075To compile the redbook sample programs:
76<pre>
77 cd progs/redbook
78 make
79</pre>
Brian Paul99cfc4e2003-12-06 17:26:50 +000080</p>
Brian Paulfe3242f2006-07-31 14:24:21 +000081<p>glut features not supported:
82<li>Overlays
83<li>Subwindows
84<li>Input devices other than Keyboard/Mouse
85<li>No support for GLUT_MULTISAMPLE, GLUT_STEREO, or GLUT_LUMINANCE
86<li>Cursor and Menu Support will flicker in GLUT_SINGLE mode
Brian Paul99cfc4e2003-12-06 17:26:50 +000087
Brian Paulfe3242f2006-07-31 14:24:21 +000088<p>Keyboard input is read by opening /dev/tty and reading keycodes in medium raw mode.
89<p>Mouse input is read from env var MOUSE, or /dev/gpmdata and should be in ms3 format.
90To forward data in this format to /dev/gpmdata, run gpm with the -Rms3 option.
91<p> glutInit allows glut programs to pass parameters to the glut library, currently the
92following options are supported for fbdevglut:
93<p><li>-geometry widthxheight -- This will force the resolution to be widthxheight instead of autodetecting.
94The modes are read from /etc/fb.modes
95<p><li>-bpp -- This will force the bitdepth to the one specified
96<p><li>-vt -- This allows you to specify the virtual terminal to attach keyboard input to. It is useful to specify when running inside screen.
97<p><li>-mousespeed -- A floating point multiplication factor to increase mouse speed
98<p><li>-nomouse -- Disable mouse support
99<p><li>-nokeyboard -- Disable keyboard support (this will probably break mouse support as well)
100<p><li>-stdin -- Use stdin for input instead of attaching to kbd in medium-raw mode.
101This will make it impossible to detect keypresses like Shift+Tab, you will also need to specify -gpmmouse for mouse support. This option can be used with a debugger, and it is possible to single step a program with gdb and set the FRAMEBUFFER environment variable to a different framebuffer for display. The program will not be able to handle vt switching on it's own, so it will always display.
102<p><li>-gpmmouse -- This will attempt to connect to the /dev/gpmctl socket using liblow
103for mouse data. Gpm does not provide this data when in graphics mode, so vt switching
104will briefly display text. This mode typically has no initial mouse delay.
105<p><li>-- Ignore any additional arguments
106<p>Notes:
107<p>
1081. The mouse pointer flickers in single buffering mode, as it must be rendered in software. Hopefully in the future there will be a way to access hardware cursors in fbdev devices.
Brian Paul99cfc4e2003-12-06 17:26:50 +0000109</p>
Brian Paul99cfc4e2003-12-06 17:26:50 +0000110</body>
111</html>