Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. void textrend(int width, int height, string text, TTF_Font* textfont) {
  2. SDL_Surface* textsurface = TTF_RenderText_Solid(textfont, text.c_str(), textcolour);
  3. int text_width = textsurface->w;
  4. int text_height = textsurface->h;
  5. SDL_Texture* texttexture = SDL_CreateTextureFromSurface(renderer, textsurface);
  6. SDL_Rect textrect = {width, height, text_width, text_height};
  7. SDL_RenderCopy(renderer, texttexture, NULL, &textrect);
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement