1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8">
5 <title>Off-screen Rendering
</title>
6 <link rel=
"stylesheet" type=
"text/css" href=
"mesa.css">
11 <h1>The Mesa
3D Graphics Library
</h1>
14 <iframe src=
"contents.html"></iframe>
17 <h1>Off-screen Rendering
</h1>
21 Mesa's off-screen interface is used for rendering into user-allocated memory
22 without any sort of window system or operating system dependencies.
23 That is, the GL_FRONT colorbuffer is actually a buffer in main memory,
24 rather than a window on your display.
28 The OSMesa API provides three basic functions for making off-screen
29 renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
30 OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for
31 more information about the API functions.
35 The OSMesa interface may be used with any of three software renderers:
38 <li>llvmpipe - this is the high-performance Gallium LLVM driver
39 <li>softpipe - this it the reference Gallium software driver
40 <li>swrast - this is the legacy Mesa software rasterizer
45 There are several examples of OSMesa in the mesa/demos repository.
48 <h1>Building OSMesa
</h1>
51 Configure and build Mesa with something like:
54 configure --enable-osmesa --disable-driglx-direct --disable-dri --with-gallium-drivers=swrast
59 Make sure you have LLVM installed first if you want to use the llvmpipe driver.
63 When the build is complete you should find:
66 lib/libOSMesa.so (swrast-based OSMesa)
67 lib/gallium/libOSMsea.so (gallium-based OSMesa)
71 Set your LD_LIBRARY_PATH to point to one directory or the other to select
72 the library you want to use.
76 When you link your application, link with -lOSMesa