summaryrefslogtreecommitdiff
path: root/index.html
blob: b086a8f19901e011a64113905a7f463890506e53 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<HTML>
<TITLE>Mesa Demos Distribution</TITLE>
<STYLE TYPE="text/css">
  PRE {background-color: #cccccc}
</STYLE>
<BODY>

<H1>Introduction</H1>
<p>
The Mesa Demos package contains a large number of OpenGL demonstration
and test programs.
</p>

<p>
These programs were previously distributed as the MesaDemos-x.y.z.tar.gz
package released in conjunction with the MesaLib-x.y.z.tar.gz package.
The demos are separated now since they don't change often and
aren't tied to a particular version of Mesa.
</p>

<p>
Note that the Mesa demos should be usable with any OpenGL implementation;
not just Mesa.
</p>


<H1>FTP site</H1>

<p>
The latest version of the Mesa demos can be found on the
<a href="ftp://ftp.freedesktop.org/pub/mesa/demos/">freedesktop.org FTP</a>
site.
</p>



<H1>Git Repository</H1>

<p>
The Mesa demos git repository can be obtained with:
<pre>
git clone git://anongit.freedesktop.org/git/mesa/demos
</pre>

Or, if you're a developer:
<pre>
git clone git+ssh://USERNAME@git.freedesktop.org/git/mesa/demos
</pre>

</p>


<H1>Building</H1>

<p>
The Mesa demos can be built with autoconf or <a href="http://www.cmake.org/">CMake</a>.
</p>


<h2>Prerequisites</h2>

<p>
You'll need <a href="http://glew.sourceforge.net/">glew</a> version 1.5.4
or later and glut or <a href="http://freeglut.sourceforge.net/">freeglut</a> (runtime libraries and header files).
</p>

<p>
If you're using an RPM-based Linux distro you can install these items with:
</p>
<pre>
yum install glew glew-devel
yum install freeglut freeglut-devel
</pre>

<p>
And if you're using a Debian based Linux distro you can install these items with:
</p>
<pre>
apt-get install libglew-dev freeglut3-dev
</pre>



<H2>Autoconf</H2>

<p>
Run <b>./configure --help</b> to see the options available for building
the demos.
</p>

<p>
Otherwise, just run <b>./configure ; make</b> to build the demos.
</p>



<H2>CMake</H2>

<p>
See the <a href="http://www.cmake.org/cmake/help/documentation.html">CMake documentation</a> for more information about CMake.
</p>

<H3>Unix</H3>

<p>
Run:
</p>
<pre>
cmake .
make
</pre>

<H3>MSVC</H3>

<ul>
<li>Start the CMake GUI.
<li>Specify where this source is and where to build the binaries.
<li>Click <i>Configure</i>.
<li>Specify where GLEW and GLUT headers and libraries are; specifically via the 
<b>GLEW_INCLUDE_DIR</b>, <b>GLEW_glew_LIBRARY</b>, <b>GLUT_INCLUDE_DIR</b>, and <b>GLUT_glut_LIBRARY</b> variables.
<li>Click <i>Generate</i>.
<li>Open the generated <b>mesademos.sln</b> Visual Studio solution file and build the target <b>ALL</b>.
</ul>

<H3>MinGW cross-compilation</H3>

<p>
Create a <b>Toolchain.cmake</b> file containing:
</p>
<pre>
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)

# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)

# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
</pre>

<p>
Create a <b>Cache.cmake</b> file containing:
</p>
<pre>
set(GLEW_INCLUDE_DIR "/path/to/glew/include" CACHE PATH "" FORCE)
set(GLEW_glew_LIBRARY "/path/to/glew/lib/libglew32.a" CACHE FILEPATH "" FORCE)

set(GLUT_INCLUDE_DIR "/path/to/glut/include" CACHE PATH "" FORCE)
set(GLUT_glut_LIBRARY "/path/to/glut/lib/libglut32.a" CACHE FILEPATH "" FORCE)
</pre>

<p>
Then do:
</p>
<pre>
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/path/to/install -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain.cmake -C /path/to/Cache.cmake
make
make install
</pre>

<p>
Read <a href="http://www.vtk.org/Wiki/CmakeMingw">this</a> for more information about CMake and MinGW cross compilation.
</p>


<H1>The Demos</H1>

<p>
Look in the <b>src/</b> directory for these sub-directories, among others:
</p>
<ul>
<li>demos - the original Mesa demos, such as gears, gloss, etc.
<li>redbook - the OpenGL Programming Guide demos
<li>samples- original SGI OpenGL demos
<li>glsl - OpenGL Shading Language demos
<li>gs - Geometry shader demos
<li>xdemos - GLX-based demos
<li>egl - EGL-based demos
<li>wgl - WGL-based demos
<li>fp - fragment program tests
<li>vp - vertex program tests
<li>data - data files used by the demos
<li>perf - performance tests
<li>tests - assorted test programs
<li>objviewer - program to view .obj modes with a skybox
</ul>



<H1>Getting Help</H1>

<p>
If you have trouble building or using the Mesa demos, you can post
to the<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-users">
Mesa users</a> mailing list.
</p>

<p>
If your question is especially technical, you can try the
to the<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev">
Mesa dev</a> mailing list.
</p>


<H1>Reporting Bugs</H1>

<p>
Bugs in the demos can be reported to the
<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa">
Mesa bug database</a>.
Choose Component="Demos" in the drop-down list.
</p>


</BODY>
</HTML>