Hello and thanks to all who will read this post, it is my first so I’ll try to explain well.
So, I am stuck on a pretty simle problem but haven’t found the right answer yet: I create a surface with TTF_RenderText_Solid, and then try to Blit it onto a monotone surface, then convert the resulting surface to a Texture, and rendering to screen. Only, the text doesn’t show, on my screen i get the “box”, but not the text that should have been blitted on it… Help! (checked errors and i do not get any)
Code:
SDL_Color paint={0,0,0};
SDL_Surface *Text;
Text=TTF_RenderText_Solid(Font,“HELLO”, paint);
SDL_Surface *Box=SDL_CreateRGBSurface(0,60,30,32,0,0,0,0);
Uint32 color=SDL_MapRGB(Box->format,200,200,200);
SDL_FillRect(Box,NULL,color);
SDL_Rect Rect={0-0-0-0};
SDL_BlitSurface(Text, NULL, Box,NULL );
SDL_Texture *Texture;
Texture=SDL_CreateTextureFromSurface(Renderer,Box);
SDL_RenderCopy(Renderer,Texture,NULL,&Rect);