]> git.cworth.org Git - glaze/blob - README
Add egl definitions and related buildsupport.
[glaze] / README
1 Glaze: A thin, flexible layer for wrapping OpenGL
2
3 Glaze is a very thin layer intended to assist developers of
4 OpenGL-wrapping libraries. The result of compiling Glaze is a tiny
5 libGL.so library with a symbol for every possible GL and GLX function
6 in the OpenGL API.
7
8 Each symbol within the Glaze library is merely an "ifunc resolver"[*]
9 which will resolve to a function in the wrapper library if one exists,
10 or will otherwise resolve to a function in the underlying "real"
11 OpenGL library.
12
13 In order to use glaze, the following three environment variables
14 should be set:
15
16     LD_LIBRARY_PATH
17
18         This should be set so that the directory containing Glaze's
19         libGL.so appears on the list earlier than any other OpenGL
20         library implementation. For example:
21
22             LD_LIBRARY_PATH=/home/user/src/glaze/lib64:${LD_LIBRARY_PATH}
23
24     GLAZE_WRAPPER
25
26         This should be set to the complete path to the library
27         containing some OpenGL wrapper functions. These functions must
28         manually call into the underlying OpenGL functions as
29         needed. An example of setting this variable is:
30
31             GLAZE_WRAPPER=/home/user/src/mywrapper/libGL.so
32
33     GLAZE_LIBGL
34
35         This should be set to the complete path to the "real",
36         underlying OpengL library implementation. For example:
37
38             GLAZE_LIBGL=/usr/lib/libGL.so
39
40 For any questions or comments about Glaze, please feel free to email
41 me:
42
43         Carl Worth <cworth@cworth.org>
44
45 Credits: Many thanks to Alexander Monakov who gave me the idea for
46 using "ifunc resolvers" for efficient wrapping of OpenGL functions,
47 (and for patiently teaching me how they work). See Alexander's
48 project, Primus, for the inspiration for Glaze:
49 https://github.com/amonakov/primus
50
51 [*] An "ifunc resolver" is a glibc mechanism for performing efficent,
52 one-shot function resolutions. The first call to the function will
53 invoke the resolver which has the job of returning the "real" function
54 to call. At that point, the application PLTs will be updated with the
55 returned function pointer so that all future calls will call the
56 desired function without any subsequent overhead.