Page MenuHomePhabricator (Chris)

Visibility.cpp
No OneTemporary

Authored By
Unknown
Size
648 B
Referenced Files
None
Subscribers
None

Visibility.cpp

//
// Created by Ido Mozes on 23/06/2019.
//
#include "Visibility.h"
SDL_Texture *loadTexture(SDL_Renderer * renderer, const char *path) {
SDL_Surface *tmpSurface = IMG_Load(path);
SDL_Texture *tex = SDL_CreateTextureFromSurface(renderer, tmpSurface);
SDL_FreeSurface(tmpSurface);
return tex;
}
Visibility::Visibility(Entity *entity, SDL_Renderer *renderer, const char *path, SDL_Rect *dstR, SDL_Rect *srcR)
: Component(entity) {
texture = loadTexture(renderer, path);
setDstRect(dstR);
setSrcRect(srcR);
}
Visibility::~Visibility() {
delete dstRect;
delete srcRect;
SDL_DestroyTexture(texture);
}

File Metadata

Mime Type
text/x-c
Expires
Sun, Nov 15, 8:37 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
142177
Default Alt Text
Visibility.cpp (648 B)

Event Timeline