Replies: 2 comments 1 reply
-
That's a good question. I don't have a good answer for you, though. Right now, the default renderer (mostly just a framework for a simple shader) is opinionated about how the image is scaled and positioned. I have been thinking for some time about how to make the renderer dynamic, or even just replaceable. It's a challenging design, either way. In its present state, we have an API that accepts a closure to do some very basic manipulation of the renderer. For example, you can write a custom renderer that completely replaces the default renderer and call it through the The other issue I've approached in a similar line of reasoning is how to better integrate it with a GUI like egui. The current example just draws the GUI over the top of the default renderer output. I've experimented with rendering to a texture and that does give it a slightly better integration with egui, but I was never really completely happy with it. One of the most promising things about this setup is that egui manages all of the user input, so things like zooming and panning (scrolling) are really simple. It's basically no additional code beyond creating the GUI elements for scrolling a dynamically sizeable image. I think those are both viable solutions, but I would tend to lean on something like egui, personally. It does a lot of this work already, and it's a really great GUI on its own merits. One thing I can help with directly is providing an example that more tightly integrates |
Beta Was this translation helpful? Give feedback.
-
I think this is related, maybe my reply belongs here, not sure #275 (comment). |
Beta Was this translation helpful? Give feedback.
-
Hi, let's say I want to make an image viewer application*. It would be fancy to support features like zooming in and out and navigating the image (panning) so I wonder how it could be done with pixels? obviously it should be done with changing how the buffer itself gets rendered because manipulating the buffer with cpu horsepower will be extremely inefficient.
My question is how to do that and maybe we could have some examples illustrating this type of stuff, it seems pretty common for me.
*in fact I'm thinking of building a drawing app with pixels
Beta Was this translation helpful? Give feedback.
All reactions