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