1 // Copyright 2015 Brendan Zabarauskas and the gl-rs developers
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 //! An OpenGL bindings generator. It defines a function named `generate_bindings` which can be
16 //! used to generate all constants and functions of a given OpenGL version.
23 //! extern crate gl_generator;
25 //! use gl_generator::{Registry, Api, Profile, Fallbacks, GlobalGenerator};
27 //! use std::fs::File;
28 //! use std::path::Path;
31 //! let dest = env::var("OUT_DIR").unwrap();
32 //! let mut file = File::create(&Path::new(&dest).join("gl_bindings.rs")).unwrap();
34 //! Registry::new(Api::Gl, (4, 5), Profile::Core, Fallbacks::All, [])
35 //! .write_bindings(GlobalGenerator, &mut file)
43 //! include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs"));
48 //! When you generate bindings for EGL, the following platform-specific types must be declared
49 //! *at the same level where you include the bindings*:
51 //! - `khronos_utime_nanoseconds_t`
52 //! - `khronos_uint64_t`
53 //! - `khronos_ssize_t`
54 //! - `EGLNativeDisplayType`
55 //! - `EGLNativePixmapType`
56 //! - `EGLNativeWindowType`
58 //! - `NativeDisplayType`
59 //! - `NativePixmapType`
60 //! - `NativeWindowType`
67 #[cfg(feature = "unstable_generator_utils")]
69 #[cfg(not(feature = "unstable_generator_utils"))]
74 pub use generators::debug_struct_gen::DebugStructGenerator;
75 pub use generators::global_gen::GlobalGenerator;
76 pub use generators::static_gen::StaticGenerator;
77 pub use generators::static_struct_gen::StaticStructGenerator;
78 pub use generators::struct_gen::StructGenerator;
79 pub use generators::Generator;