You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src/main.rs:47:36: 47:63 error: the trait bound `sdl2::surface::SurfaceRef: std::convert::AsRef<sdl2::surface::SurfaceRef>` is not satisfied
I'm puzzled if what I'm trying to do is allowed or not. (I've switched to Renderer::into_surface, but I don't want to recreate the Renderer if I don't have to).
The text was updated successfully, but these errors were encountered:
Currently is is pretty non-Rust-y but a Renderer has an inner target called RendererTarget that you can change without having to create another Renderer.
Basically you have to query the RenderTarget from your Renderer, and then "set" the target of your RendererTarget, do your stuff, and then switch back to the initial RenderTarget (I assume your window) with reset.
Also note that switching RenderTarget is pretty slow compared to other methods (few µs instead of ns), so you should avoid doing it every single frame.
Is it possible to change current rendering target of a given
Renderer
?Also when doing:
where prescaled is a
Renderer
https://docs.rs/sdl2/0.24.0/sdl2/render/struct.Renderer.htmlI get:
I'm puzzled if what I'm trying to do is allowed or not. (I've switched to
Renderer::into_surface
, but I don't want to recreate theRenderer
if I don't have to).The text was updated successfully, but these errors were encountered: