• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<HTML>
2
3<TITLE>Mesa glFBDev Driver</TITLE>
4
5<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
8
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
40
41<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>
46<p>
47You will need at minimum, a framebuffer device, check /dev/fb0
48</p>
49
50<h1>2. Compilation</h1>
51
52<p>
53To compile Mesa with support for the glFBDev interface:
54<pre>
55      make realclean
56      make linux-fbdev
57</pre>
58
59<p>
60When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo.
61</p>
62<h1>3. Permissions</h1>
63
64<p>
65Typically /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
69<p>
70
71<h1>4. Using fbdevglut</h1>
72Almost all of the programs in the progs directory use glut, and they compile with fbdevglut.
73
74<p>
75To compile the redbook sample programs:
76<pre>
77       cd progs/redbook
78       make
79</pre>
80</p>
81<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
87
88<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.
109</p>
110</body>
111</html>
112