mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Improve safety notes on the slint::Image texture import functions
Elaborate how to call this function safely, and copy the same description to the C++ docs.
This commit is contained in:
parent
279c143d31
commit
aa41277df1
2 changed files with 18 additions and 2 deletions
|
@ -126,6 +126,16 @@ public:
|
|||
///
|
||||
/// The texture must be bindable against the `GL_TEXTURE_2D` target, have `GL_RGBA` as format
|
||||
/// for the pixel data.
|
||||
///
|
||||
/// Safety:
|
||||
///
|
||||
/// This function is unsafe because invalid texture ids may lead to undefind behavior in OpenGL
|
||||
/// drivers. A valid texture id is one that was created by the same OpenGL context that is
|
||||
/// current during any of the invocations of the callback set on
|
||||
/// [`Window::set_rendering_notifier()`]. OpenGL contexts between instances of [`slint::Window`]
|
||||
/// are not sharing resources. Consequently
|
||||
/// [`slint::Image`] objects created from borrowed OpenGL textures cannot be shared between
|
||||
/// different windows.
|
||||
[[nodiscard]] static Image create_from_borrowed_gl_2d_rgba_texture(uint32_t texture_id,
|
||||
Size<unsigned int> size)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue