Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

glfbdev-driver.html 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <HTML>
  2. <TITLE>Mesa glFBDev Driver</TITLE>
  3. <link rel="stylesheet" type="text/css" href="mesa.css"></head>
  4. <BODY>
  5. <center><H1>Mesa glFBDev Driver</H1></center>
  6. <H1>1. Introduction</H1>
  7. <p>
  8. The GLFBDev driver interface allows one to do OpenGL rendering into a
  9. framebuffer managed with the Linux's fbdev interface.
  10. </p>
  11. <p>
  12. Basically, the programmer uses the fbdev functions to initialize the
  13. graphics hardware and setup the framebuffer.
  14. Then, using a calls to Mesa's glFBDev API functions, one can render
  15. into the framebuffer with the OpenGL API functions.
  16. </p>
  17. <p>
  18. Note, only software rendering is supported; there is no hardware
  19. acceleration.
  20. </p>
  21. <p>
  22. The GL/glfbdev.h header file defines the glFBDev interface.
  23. </p>
  24. <p>
  25. The progs/fbdev/glfbdevtest.c demonstrates how to use the glFBDev interface.
  26. </p>
  27. <p>
  28. For more information about fbdev, see the
  29. <a href="http://www.tldp.org/HOWTO/Framebuffer-HOWTO.html" target="_parent">
  30. Framebuffer Howto</a>
  31. </p>
  32. <p>
  33. You will need at minimum, a framebuffer device, check /dev/fb0
  34. </p>
  35. <h1>2. Compilation</h1>
  36. <p>
  37. To compile Mesa with support for the glFBDev interface:
  38. <pre>
  39. make realclean
  40. make linux-fbdev
  41. </pre>
  42. <p>
  43. When compilation is finished look in progs/glfbdev/ for the glfbdevtest demo.
  44. </p>
  45. <h1>3. Permissions</h1>
  46. <p>
  47. Typically /dev/fb/0 is grouped to the video group. It may be useful to add
  48. your user to the video group so the demos will not have to be run as root.
  49. To use fbdevglut with the prefered tty input, you should add the user to the
  50. tty group as well
  51. <p>
  52. <h1>4. Using fbdevglut</h1>
  53. Almost all of the programs in the progs directory use glut, and they compile with fbdevglut.
  54. <p>
  55. To compile the redbook sample programs:
  56. <pre>
  57. cd progs/redbook
  58. make
  59. </pre>
  60. </p>
  61. <p>glut features not supported:
  62. <li>Overlays
  63. <li>Subwindows
  64. <li>Input devices other than Keyboard/Mouse
  65. <li>No support for GLUT_MULTISAMPLE, GLUT_STEREO, or GLUT_LUMINANCE
  66. <li>Cursor and Menu Support will flicker in GLUT_SINGLE mode
  67. <p>Keyboard input is read by opening /dev/tty and reading keycodes in medium raw mode.
  68. <p>Mouse input is read from env var MOUSE, or /dev/gpmdata and should be in ms3 format.
  69. To forward data in this format to /dev/gpmdata, run gpm with the -Rms3 option.
  70. <p> glutInit allows glut programs to pass parameters to the glut library, currently the
  71. following options are supported for fbdevglut:
  72. <p><li>-geometry widthxheight -- This will force the resolution to be widthxheight instead of autodetecting.
  73. The modes are read from /etc/fb.modes
  74. <p><li>-bpp -- This will force the bitdepth to the one specified
  75. <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.
  76. <p><li>-mousespeed -- A floating point multiplication factor to increase mouse speed
  77. <p><li>-nomouse -- Disable mouse support
  78. <p><li>-nokeyboard -- Disable keyboard support (this will probably break mouse support as well)
  79. <p><li>-stdin -- Use stdin for input instead of attaching to kbd in medium-raw mode.
  80. 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.
  81. <p><li>-gpmmouse -- This will attempt to connect to the /dev/gpmctl socket using liblow
  82. for mouse data. Gpm does not provide this data when in graphics mode, so vt switching
  83. will briefly display text. This mode typically has no initial mouse delay.
  84. <p><li>-- Ignore any additional arguments
  85. <p>Notes:
  86. <p>
  87. 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.
  88. </p>
  89. </body>
  90. </html>