Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Window::draw(Object toDraw)
- {
- SDL_RenderCopy(coreRenderer, convertSurfaceToTexture(toDraw.getSurface(), coreRenderer), NULL, NULL);
- }
- SDL_Texture *convertSurfaceToTexture(SDL_Surface *image, SDL_Renderer *ren)
- {
- SDL_Texture *texture;
- texture = SDL_CreateTextureFromSurface(ren, image);
- if(texture == nullptr){
- std::cout << "Ошибка конвертирования SDL_Surface в SDL_Texture: " << "nt" << SDL_GetError() << std::endl;
- exit(1);
- }
- return texture;
- }
Add Comment
Please, Sign In to add comment