Game/Source/Textures.cpp
// Load new texture from file path
Load new texture from file path
Load new texture from file path
SDL_Texture* const Textures::Load(const char* path)
{
	LOG("Loading Texture %s", path);
	SDL_Texture* texture = NULL;
	SDL_Surface* surface = IMG_Load(path);
	if (surface == NULL)
	{
		LOG("Could not load surface with path: %s. IMG_Load: %s", path, IMG_GetError());
	}
	else
	{
		texture = LoadSurface(surface); 
		if (texture == NULL)
		{
			LOG("Could not load texture from surface with path: %s. IMG_LOAD: %S", path, IMG_GetError());
		}
		SDL_FreeSurface(surface);
	}
	return texture;
}
SDL_Texture * const Textures :: Load ( const char * path ) { LOG ( " " , path ) ; SDL_Texture * texture = NULL ; SDL_Surface * surface = IMG_Load ( path ) ; if ( surface == NULL ) { LOG ( " " , path , IMG_GetError ( ) ) ; } else { texture = LoadSurface ( surface ) ; if ( texture == NULL ) { LOG ( " " , path , IMG_GetError ( ) ) ; } SDL_FreeSurface ( surface ) ; } return texture ; }
Load new texture from file path
Load new texture from file path
// Adds texture to the list