Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing/uploading a texture to egui #33

Open
crumblingstatue opened this issue Mar 13, 2023 · 1 comment
Open

Sharing/uploading a texture to egui #33

crumblingstatue opened this issue Mar 13, 2023 · 1 comment

Comments

@crumblingstatue
Copy link

Egui has various functionality that deals with textures, like Ui::image.
However, egui-macroquad doesn't seem to expose any functionality to upload or share textures between macroquad and egui.
macroquad::texture::Texture2D cannot be used as an egui::TextureId, nor does it implement Into<egui::ImageData>. The same seems true for macroquad::texture::Image.
Is it possible to share/upload texture data to egui with egui-macroquad, and if so, how?

@crumblingstatue
Copy link
Author

The following seems to work, but feels rather hacky:

egui::TextureId::User(
    mq_texture.raw_miniquad_texture_handle().gl_internal_id() as _,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant