Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "LTexture.h"
- LTexture::LTexture()
- {
- }
- LTexture::~LTexture()
- {
- }
- bool LTexture::loadFromFile(std::string path)
- {
- bool success = true;
- SDL_Surface* loadedSurface = IMG_Load(path.c_str());
- if (loadedSurface == NULL)
- {
- std::cout << " Could not load: " << path.c_str() << " Error: " << SDL_GetError() << std::endl;
- success = false;
- }
- else
- {
- mTexture = SDL_CreateTextureFromSurface(gRenderer, loadedSurface);
- if (mTexture == NULL)
- {
- std::cout << "Could not load Texture image: " << path.c_str() << " Error: " << SDL_GetError() << std::endl;
- success = false;
- }
- SDL_FreeSurface(loadedSurface);
- }
- return success;
- }
- void LTexture::free()
- {
- }
- void LTexture::render(int x, int y)
- {
- }
- int LTexture::getWidth()
- {
- return 0;
- }
- int LTexture::getHeight()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement