Basically, I want to have one texture which contains both text and an image.
How would I go about doing that? I've been Google-ing around, but I can't seem to find a way to combine surfaces with other surfaces, textures with other textures, nor surfaces with textures.
EDIT: So, I'm making a simple RPG, and I want to have it so that when you talk to an NPC, that NPC either can or can't have an image attached to the text.
I would ideally do this by sending the text and image to a function which will gererate a texture I can just render, instead of having to worry about rendering two different ones, and where they should be positioned.
Something like this:
void setSayingText(std::string const& text, std::string const& imageLoc = "") {
SDL_Surface* text = TTF_RenderText_Blended(font, text.c_str(), whiteColor);
if (imageLoc != "") {
SDL_Surface* image = IMG_Load(imageLoc);
texture = SDL_CreateTextureFromSurface(renderer, text + image);
} else {
texture = SDL_CreateTextureFromSurface(renderer, text);
}
}