first commit
This commit is contained in:
22
src/assetmgr/TextureManager.cpp
Normal file
22
src/assetmgr/TextureManager.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* TextureManager.cpp
|
||||
*
|
||||
* Created on: Feb 11, 2020
|
||||
* Author: ayoungblood
|
||||
*/
|
||||
|
||||
#include "TextureManager.h"
|
||||
|
||||
SDL_Texture* TextureManager::LoadTexture(const char* texture)
|
||||
{
|
||||
SDL_Surface* tempSurface = IMG_Load(texture);
|
||||
SDL_Texture* tex = SDL_CreateTextureFromSurface(Game::renderer, tempSurface);
|
||||
SDL_FreeSurface(tempSurface);
|
||||
return tex;
|
||||
}
|
||||
|
||||
void TextureManager::Draw(SDL_Texture* tex, SDL_Rect src, SDL_Rect dest, SDL_RendererFlip flip)
|
||||
{
|
||||
|
||||
SDL_RenderCopyEx(Game::renderer, tex, &src, &dest, NULL, NULL, flip);
|
||||
}
|
Reference in New Issue
Block a user