Beispiel #1
0
bool FixedTexSheet::AddTexture(BaseTexture *img, ImageMemory &data)
{
    if (InsertTexture(img) == false)
        return false;

    // Copy the pixel data for the texture over.
    if (CopyRect(img->x, img->y, data) == false) {
        IF_PRINT_WARNING(VIDEO_DEBUG) << "VIDEO ERROR: CopyRect() failed in TexSheet::AddImage()!" << std::endl;
        return false;
    }

    return true;
}
	TextureId TextureManager::CreateTextureFromImage(const Core::Image<unsigned char>& image, GraphicsCore::TextureFormat format)
	{
		GraphicsCore::Texture* texture = new GraphicsCore::Texture(image, format);
		return InsertTexture(texture);
	}
//-----------------------------------------------------------------------------
TextureId TextureManager::CreateTexture(const Utilities::Image::ImageParameters<unsigned char>& imageParameters, const LowLevelGraphics::LowLevelAPI::TextureFormat& format)
{
    LowLevelGraphics::Texture* texture = new LowLevelGraphics::Texture(imageParameters, format);
    return InsertTexture(texture);
}