Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 1 | <HTML> |
| 2 | |
| 3 | <TITLE>Mesa glFBDev Driver</TITLE> |
| 4 | |
Brian Paul | 36da045 | 2005-01-20 03:55:10 +0000 | [diff] [blame] | 5 | <link rel="stylesheet" type="text/css" href="mesa.css"></head> |
| 6 | |
| 7 | <BODY> |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 8 | |
| 9 | <center><H1>Mesa glFBDev Driver</H1></center> |
| 10 | |
| 11 | |
| 12 | <H1>1. Introduction</H1> |
| 13 | |
| 14 | <p> |
| 15 | The GLFBDev driver interface allows one to do OpenGL rendering into a |
| 16 | framebuffer managed with the Linux's fbdev interface. |
| 17 | </p> |
| 18 | |
| 19 | <p> |
| 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. |
| 24 | </p> |
| 25 | |
| 26 | <p> |
| 27 | Note, only software rendering is supported; there is no hardware |
| 28 | acceleration. |
| 29 | </p> |
| 30 | |
| 31 | |
| 32 | <p> |
| 33 | The GL/glfbdev.h header file defines the glFBDev interface. |
| 34 | </p> |
| 35 | |
| 36 | <p> |
| 37 | The progs/fbdev/glfbdevtest.c demonstrates how to use the glFBDev interface. |
| 38 | </p> |
| 39 | |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 40 | |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 41 | <p> |
| 42 | For more information about fbdev, see the |
| 43 | <a href="http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html" target="_parent"> |
| 44 | Framebuffer Howto</a> |
| 45 | </p> |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 46 | <p> |
| 47 | You will need at minimum, a framebuffer device, check /dev/fb0 |
| 48 | </p> |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 49 | |
| 50 | <h1>2. Compilation</h1> |
| 51 | |
| 52 | <p> |
| 53 | To compile Mesa with support for the glFBDev interface: |
| 54 | <pre> |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 55 | make realclean |
| 56 | make linux-fbdev |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 57 | </pre> |
| 58 | |
| 59 | <p> |
| 60 | When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo. |
| 61 | </p> |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 62 | <h1>3. Permissions</h1> |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 63 | |
| 64 | <p> |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 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 |
| 68 | tty group as well |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 69 | <p> |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 70 | |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 71 | <h1>4. Using fbdevglut</h1> |
| 72 | Almost all of the programs in the progs directory use glut, and they compile with fbdevglut. |
Sean D'Epagnier | 7196cdd | 2006-08-10 10:21:17 +0000 | [diff] [blame] | 73 | |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 74 | <p> |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 75 | To compile the redbook sample programs: |
| 76 | <pre> |
| 77 | cd progs/redbook |
| 78 | make |
| 79 | </pre> |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 80 | </p> |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 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 |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 87 | |
Brian Paul | fe3242f | 2006-07-31 14:24:21 +0000 | [diff] [blame] | 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 |
| 106 | <p>Notes: |
| 107 | <p> |
| 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. |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 109 | </p> |
Brian Paul | 99cfc4e | 2003-12-06 17:26:50 +0000 | [diff] [blame] | 110 | </body> |
| 111 | </html> |