Basically I’m making an attempt to finish up with a Texture class that may absorb textual content and have or not it’s drawn over easy geometry (resembling a letter ‘A’ over a stuffed rectangle). However I’m working into points when interested by methods to mix these two ideas.
First, following lazy foo’s tutorials, Geometry rendering is easy and is finished with an
SDL_RECT and SDL_RenderFillRect(SDL_Renderer*, &SDL_Rect);
However, when rendering textual content it makes use of Surfaces and Textures so as to ‘draw’ the textual content. Specifically these traces:
SDL_Surface* textSurface = TTF_RenderText_Solid( gFont, textureText.c_str(), textColor );
mTexture = SDL_CreateTextureFromSurface( SDL_Renderer*, textSurface );
My complicated comes from making an attempt to determine a number of issues:
a) Is it potential to possibly first Render the Geometry to a texture, after which render the textual content over that very same texture?
b) I imagine a name to SDL_SetRenderGoal goes to be essential, however I’m unsure the place and when throughout my mixture stage this may have to be finished.
c) Right earlier than posting this query, I noticed additional down on the tutorials this hyperlink which describes rendering geometry to a texture, nevertheless I’m nonetheless unsure methods to mix Text with this.
Any assistance is appreciated, Thanks