We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1399

Summary: Render Directly to a streaming texture
Product: SDL_ttf Reporter: Rodrigo Cardoso <rodrigo.alfenas>
Component: miscAssignee: Sam Lantinga <slouken>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: rodrigo.alfenas, sylvain.becker
Version: unspecified   
Hardware: All   
OS: All   
Attachments: protype patch

Description Rodrigo Cardoso 2012-01-27 10:24:11 UTC
That's it, the summary is self explanatory =]

Would be much easier and faster when using SDL_Textures.

thanks!
Comment 1 Sam Lantinga 2012-01-28 07:27:13 UTC
This is something we can add in the SDL2 upgrade.
Comment 2 Sylvain 2018-11-13 09:48:34 UTC
Created attachment 3484 [details]
protype patch

This is a prototype for rendering text directly to streaming texture.
patch is diff'ed with bug 4361, and test-case app will be updated in bug 4374

It renders to a SD_Texture created with SDL_TEXTUREACCESS_STREAMING and format SDL_PIXELFORMAT_ARGB8888.
Only "Blended" is done. Not sure that it makes senses to do Solid/Shaded, as they are palletized surfaces and that would require a conversion.

Prototype/name of the function is:

int TTF_RenderUTF8_Texture(TTF_Font *font, SDL_Texture *texture, const char *text, SDL_Color fg)

But it should probably also include some dest x/y position.
The function doesn't add much rendering complexity as it only prepares datas and calls "Render_Line()".