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

A way to access logical_dst_rect? #8815

Closed
Ethanscharlie opened this issue Jan 10, 2024 · 5 comments · Fixed by #10147
Closed

A way to access logical_dst_rect? #8815

Ethanscharlie opened this issue Jan 10, 2024 · 5 comments · Fixed by #10147
Milestone

Comments

@Ethanscharlie
Copy link

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

@slouken
Copy link
Collaborator

slouken commented Jan 11, 2024

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

@Ethanscharlie
Copy link
Author

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

@slouken
Copy link
Collaborator

slouken commented Jan 22, 2024

That makes sense, thanks.

@slouken slouken added this to the 3.2.0 milestone Jan 22, 2024
@Ethanscharlie
Copy link
Author

Ethanscharlie commented Jan 24, 2024

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

@Ethanscharlie
Copy link
Author

I made a pull request

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

Successfully merging a pull request may close this issue.

3 participants