Guest User

Untitled

a guest
Oct 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. void Window::draw(Object toDraw)
  2. {
  3. SDL_RenderCopy(coreRenderer, convertSurfaceToTexture(toDraw.getSurface(), coreRenderer), NULL, NULL);
  4. }
  5.  
  6. SDL_Texture *convertSurfaceToTexture(SDL_Surface *image, SDL_Renderer *ren)
  7. {
  8. SDL_Texture *texture;
  9. texture = SDL_CreateTextureFromSurface(ren, image);
  10. if(texture == nullptr){
  11. std::cout << "Ошибка конвертирования SDL_Surface в SDL_Texture: " << "nt" << SDL_GetError() << std::endl;
  12. exit(1);
  13. }
  14. return texture;
  15. }
Add Comment
Please, Sign In to add comment