Game/Source/Textures.cpp
// Translate a surface into a texture
Translate a surface into a texture
Translate a surface into a texture
SDL_Texture* const Textures::LoadSurface(SDL_Surface* surface)
{
	Textures* p = this;
	SDL_Texture* texture = SDL_CreateTextureFromSurface(render->renderer, surface);
	if (texture == NULL)
	{
		LOG("Unable to create texture from surface! SDL Error: %s\n", SDL_GetError());
	}
	else
	{
		textures.Add(texture);
	}
	return texture;
}
SDL_Texture * const Textures :: LoadSurface ( SDL_Surface * surface ) { Textures * p = this ; SDL_Texture * texture = SDL_CreateTextureFromSurface ( render -> renderer , surface ) ; if ( texture == NULL ) { LOG ( " \n " , SDL_GetError ( ) ) ; } else { textures . Add ( texture ) ; } return texture ; }
Translate a surface into a texture
Translate a surface into a texture