Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void textrend(int width, int height, string text, TTF_Font* textfont) {
- SDL_Surface* textsurface = TTF_RenderText_Solid(textfont, text.c_str(), textcolour);
- int text_width = textsurface->w;
- int text_height = textsurface->h;
- SDL_Texture* texttexture = SDL_CreateTextureFromSurface(renderer, textsurface);
- SDL_Rect textrect = {width, height, text_width, text_height};
- SDL_RenderCopy(renderer, texttexture, NULL, &textrect);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement