3 <TITLE>Mesa glFBDev Driver
</TITLE>
5 <link rel=
"stylesheet" type=
"text/css" href=
"mesa.css"></head>
9 <center><H1>Mesa glFBDev Driver
</H1></center>
12 <H1>1. Introduction
</H1>
15 The GLFBDev driver interface allows one to do OpenGL rendering into a
16 framebuffer managed with the Linux's fbdev interface.
20 Basically, the programmer uses the fbdev functions to initialize the
21 graphics hardware and setup the framebuffer.
22 Then, using a calls to Mesa's glFBDev API functions, one can render
23 into the framebuffer with the OpenGL API functions.
27 Note, only software rendering is supported; there is no hardware
33 The GL/glfbdev.h header file defines the glFBDev interface.
37 The progs/fbdev/glfbdevtest.c demonstrates how to use the glFBDev interface.
42 For more information about fbdev, see the
43 <a href=
"http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html" target=
"_parent">
47 You will need at minimum, a framebuffer device, check /dev/fb0
50 <h1>2. Compilation
</h1>
53 To compile Mesa with support for the glFBDev interface:
60 When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo.
62 <h1>3. Permissions
</h1>
65 Typically /dev/fb/
0 is grouped to the video group. It may be useful to add
66 your user to the video group so the demos will not have to be run as root.
67 To use fbdevglut with the prefered tty input, you should add the user to the
71 <h1>4. Using fbdevglut
</h1>
72 Almost all of the programs in the progs directory use glut, and they compile with fbdevglut.
75 To compile the redbook sample programs:
81 <p>glut features not supported:
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
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.
90 To 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
92 following options are supported for fbdevglut:
93 <p><li>-geometry widthxheight -- This will force the resolution to be widthxheight instead of autodetecting.
94 The 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.
101 This 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
103 for mouse data. Gpm does not provide this data when in graphics mode, so vt switching
104 will briefly display text. This mode typically has no initial mouse delay.
105 <p><li>-- Ignore any additional arguments
108 1. 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.