SDL icon indicating copy to clipboard operation
SDL copied to clipboard

A way to access logical_dst_rect?

Open Ethanscharlie opened this issue 1 year ago • 5 comments

I'm working with ImGui and am facing an issue when using logical rendering and an aspect ratio change. I believe I could fix my issue my offsetting the panel position with the logical_dst_rect position, but currently it doesn't look like there is any way to access it without the definition of the SDL_Renderer

Ethanscharlie avatar Jan 10 '24 03:01 Ethanscharlie

Can you explain more? Conceptually the logical rect is the viewport that you can draw into and it shouldn't matter where it is.

slouken avatar Jan 11 '24 17:01 slouken

Sorry it took me so long to respond, I need to know where it is to correctly draw an imgui panel, for logical rendering I have to turn it off before I render the imgui frame, because of that I need to know where to put the frame, and that involves the offset that the logical rect is from 0, 0 because of how it is pushed to the middle with letterboxing, currently I am using a modified version of the UpdateLogicalPresentation method to get the rect, but this should just be a sdl feature

Ethanscharlie avatar Jan 22 '24 02:01 Ethanscharlie

That makes sense, thanks.

slouken avatar Jan 22 '24 16:01 slouken

If I were to add this would it belong in SDL_render.h?

Ethanscharlie avatar Jan 24 '24 01:01 Ethanscharlie

I made a pull request

Ethanscharlie avatar Jan 24 '24 03:01 Ethanscharlie