]> git.sesse.net Git - movit/blob - init.h
Allow data files to be fetched somewhere else than the current directory.
[movit] / init.h
1 #ifndef _INIT_H
2 #define _INIT_H
3
4 #include <string>
5
6 // Initialize the library; in particular, will query the GPU for information
7 // that is needed by various components. For instance, it verifies that
8 // we have all the OpenGL extensions we need.
9 //
10 // The parameter gives which directory to read .frag files from.
11 // This is a temporary hack until we add something more solid.
12 // If you call init_movit() twice with different values for data_directory,
13 // only the first will count.
14 void init_movit(const std::string& data_directory);
15
16 // GPU features. These are not intended for end-user use.
17
18 // Whether init_movit() has been called.
19 extern bool movit_initialized;
20
21 // An estimate on the smallest values the linear texture interpolation
22 // of the GPU can distinguish between, i.e., for a GPU with N-bit
23 // texture subpixel precision, this value will be 2^-N.
24 //
25 // From reading the little specs that exist and through practical tests,
26 // the broad picture seems to be that Intel cards have 6-bit precision,
27 // nVidia cards have 8-bit, and Radeon cards have 6-bit before R6xx
28 // (at least when not using trilinear sampling), but can reach
29 // 8-bit precision on R6xx or newer in some (unspecified) cases.
30 //
31 // We currently don't bother to test for more than 1024 levels.
32 extern float movit_texel_subpixel_precision;
33
34 // Whether the GPU in use supports GL_EXT_texture_sRGB.
35 extern bool movit_srgb_textures_supported;
36
37 #endif  // !defined(_INIT_H)