From e6d23f1d8fedef6b862f2613b534704a9ea59943 Mon Sep 17 00:00:00 2001 From: chyyran Date: Sat, 10 Aug 2024 23:45:55 -0400 Subject: [PATCH] doc: update opengl example --- include/README.md | 8 +------- librashader-capi/src/runtime/gl/filter_chain.rs | 1 + librashader/src/lib.rs | 3 --- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/include/README.md b/include/README.md index 6c4b85f..f4b471e 100644 --- a/include/README.md +++ b/include/README.md @@ -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; diff --git a/librashader-capi/src/runtime/gl/filter_chain.rs b/librashader-capi/src/runtime/gl/filter_chain.rs index 97e44be..09bec23 100644 --- a/librashader-capi/src/runtime/gl/filter_chain.rs +++ b/librashader-capi/src/runtime/gl/filter_chain.rs @@ -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 ) { diff --git a/librashader/src/lib.rs b/librashader/src/lib.rs index e022be7..9660943 100644 --- a/librashader/src/lib.rs +++ b/librashader/src/lib.rs @@ -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,