summaryrefslogtreecommitdiff
path: root/docs/osmesa.rst
blob: 4d24c44facd263f7206cac82f618fd5b07acee0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head>
  <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  <title>Off-screen Rendering</title>
  <link href="mesa.css" rel="stylesheet" type="text/css"/>
</head>
<body>






<h1>Off-screen Rendering</h1>


<p>
Mesa's off-screen interface is used for rendering into user-allocated memory
without any sort of window system or operating system dependencies.
That is, the GL_FRONT colorbuffer is actually a buffer in main memory,
rather than a window on your display.
</p>

<p>
The OSMesa API provides three basic functions for making off-screen
renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
OSMesaDestroyContext().  See the Mesa/include/GL/osmesa.h header for
more information about the API functions.
</p>

<p>
The OSMesa interface may be used with any of three software renderers:
</p>
<ol>
<li>llvmpipe - this is the high-performance Gallium LLVM driver
</li><li>softpipe - this it the reference Gallium software driver
</li><li>swrast - this is the legacy Mesa software rasterizer
</li></ol>


<p>
There are several examples of OSMesa in the mesa/demos repository.
</p>

<h1>Building OSMesa</h1>

<p>
Configure and build Mesa with something like:

</p><pre>configure --enable-osmesa --disable-driglx-direct --disable-dri --with-gallium-drivers=swrast
make
</pre>

<p>
Make sure you have LLVM installed first if you want to use the llvmpipe driver.
</p>

<p>
When the build is complete you should find:
</p>
<pre>lib/libOSMesa.so  (swrast-based OSMesa)
lib/gallium/libOSMsea.so  (gallium-based OSMesa)
</pre>

<p>
Set your LD_LIBRARY_PATH to point to one directory or the other to select
the library you want to use.
</p>

<p>
When you link your application, link with -lOSMesa
</p>




</body></html>