doc: update opengl example
This commit is contained in:
parent
2f9df143cf
commit
e6d23f1d8f
|
@ -33,15 +33,9 @@ libra_gl_filter_chain_t load_gl_filter_chain(libra_gl_loader_t opengl, const cha
|
|||
std::cout << "Could not load preset\n";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// OpenGL runtime needs to be initialized.
|
||||
if (librashader.gl_init_context(opengl) != NULL) {
|
||||
std::cout << "Could not initialize OpenGL context\n";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
libra_gl_filter_chain_t chain;
|
||||
if (librashader.gl_filter_chain_create(&preset, NULL, &chain) {
|
||||
if (librashader.gl_filter_chain_create(&preset, opengl, NULL, &chain) {
|
||||
std::cout << "Could not create OpenGL filter chain\n";
|
||||
}
|
||||
return chain;
|
||||
|
|
|
@ -305,6 +305,7 @@ extern_fn! {
|
|||
/// The resulting value in `chain` then becomes null.
|
||||
/// ## Safety
|
||||
/// - `chain` must be either null or a valid and aligned pointer to an initialized `libra_gl_filter_chain_t`.
|
||||
/// - The context that the filter chain was initialized with **must be current** before freeing the filter chain.
|
||||
fn libra_gl_filter_chain_free(
|
||||
chain: *mut libra_gl_filter_chain_t
|
||||
) {
|
||||
|
|
|
@ -259,9 +259,6 @@ pub mod runtime {
|
|||
/// Shader runtime for OpenGL 3.3+.
|
||||
///
|
||||
/// DSA support requires OpenGL 4.6.
|
||||
///
|
||||
/// The OpenGL runtime requires `gl` to be
|
||||
/// initialized with [`gl::load_with`](https://docs.rs/gl/0.14.0/gl/fn.load_with.html).
|
||||
pub mod gl {
|
||||
pub use librashader_runtime_gl::{
|
||||
error,
|
||||
|
|
Loading…
Reference in a new issue