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

Added tiled 9-grid texture rendering function #12076

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Oen44
Copy link

@Oen44 Oen44 commented Jan 24, 2025

Description

New function SDL_RenderTexture9GridTiled, borders and center is tiled instead of stretched. This is a known alternative method for 9-slicing.

Here is the difference (right is tiled):
image

@slouken
Copy link
Collaborator

slouken commented Jan 24, 2025

This looks good to me. I'll add it for the 3.4 milestone, thanks!

@slouken slouken added this to the 3.4.0 milestone Jan 24, 2025
@sezero
Copy link
Contributor

sezero commented Jan 24, 2025

Changes to SDL_dynapi_overrides.h and SDL_dynapi_procs.h must not be
inserted, but appended instead. And SDL_dynapi.sym doesn't include the
new proc: Revert manual changes to src/dynapi/* and run gendynapi.py

@Oen44
Copy link
Author

Oen44 commented Jan 24, 2025

Changes to SDL_dynapi_overrides.h and SDL_dynapi_procs.h must not be inserted, but appended instead. And SDL_dynapi.sym doesn't include the new proc: Revert manual changes to src/dynapi/* and run gendynapi.py

Gotcha, amended, clean commit with generated api is ready.

@slouken
Copy link
Collaborator

slouken commented Jan 24, 2025

Actually, just revert the dynapi changes entirely. We’ll regenerate them once we merge, to avoid conflicts with other new API functions.

* New function SDL_RenderTexture9GridTiled, borders and center is tiled instead of stretched
@Oen44
Copy link
Author

Oen44 commented Jan 24, 2025

Actually, just revert the dynapi changes entirely. We’ll regenerate them once we merge, to avoid conflicts with other new API functions.

All right, I will keep that in mind for the future

@madebr
Copy link
Contributor

madebr commented Jan 24, 2025

Question: this tiles left-to-right, and is not configurable.
Is that something that people want to configure?
It's e.g. possible to tile from the center, or right-to-lleft.

@Oen44
Copy link
Author

Oen44 commented Jan 24, 2025

Question: this tiles left-to-right, and is not configurable.
Is that something that people want to configure?
It's e.g. possible to tile from the center, or right-to-lleft.

Never came across such behavior. Even in modern game engines it's not configurable. The most common and default behavior is just this.

@Oen44
Copy link
Author

Oen44 commented Jan 24, 2025

Hmm, build failed due to undefined reference to 'SDL_RenderTexture9GridTiled', but that can't be right, it is clearly defined in all the right places, same as SDL_RenderTexture9Grid. Should I worry or is Haiku to blame?

@madebr
Copy link
Contributor

madebr commented Jan 24, 2025

Hmm, build failed due to undefined reference to 'SDL_RenderTexture9GridTiled', but that can't be right, it is clearly defined in all the right places, same as SDL_RenderTexture9Grid. Should I worry or is Haiku to blame?

That's expected because you didn't add dynapi. You can ignore it.
All symbols not known by dynapi are considered internal, and not exported from the shared SDL3 library.

@slouken
Copy link
Collaborator

slouken commented Jan 24, 2025

Yes, it previously passed CI, you’re good to go. Thank you very much!

@icculus
Copy link
Collaborator

icculus commented Jan 25, 2025

Is that something that people want to configure?

I think at that point they can implement it themselves on top of existing primitives. I think we're as robust with 9grid stuff as we want to be after this PR merges.

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 this pull request may close these issues.

5 participants