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 - Render Directly to a streaming texture
Summary: Render Directly to a streaming texture
Status: ASSIGNED
Alias: None
Product: SDL_ttf
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-27 10:24 UTC by Rodrigo Cardoso
Modified: 2018-11-13 09:48 UTC (History)
2 users (show)

See Also:


Attachments
protype patch (6.10 KB, patch)
2018-11-13 09:48 UTC, Sylvain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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()".