1 Glaze: A thin, flexible layer for wrapping OpenGL
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
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"
13 In order to use glaze, the following three environment variables
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:
22 LD_LIBRARY_PATH=/home/user/src/glaze/lib64:${LD_LIBRARY_PATH}
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:
31 GLAZE_WRAPPER=/home/user/src/mywrapper/libGL.so
35 This should be set to the complete path to the "real",
36 underlying OpengL library implementation. For example:
38 GLAZE_LIBGL=/usr/lib/libGL.so
40 For any questions or comments about Glaze, please feel free to email
43 Carl Worth <cworth@cworth.org>
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
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.