当前位置: 首页>>代码示例>>C++>>正文


C++ LLPointer::setExplicitFormat方法代码示例

本文整理汇总了C++中LLPointer::setExplicitFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPointer::setExplicitFormat方法的具体用法?C++ LLPointer::setExplicitFormat怎么用?C++ LLPointer::setExplicitFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLPointer的用法示例。


在下文中一共展示了LLPointer::setExplicitFormat方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getImageFromUrl

LLViewerFetchedTexture* LLViewerTextureList::getImageFromUrl(const std::string& url,
												   BOOL usemipmaps,
												   LLViewerTexture::EBoostLevel boost_priority,
												   S8 texture_type,
												   LLGLint internal_format,
												   LLGLenum primary_format, 
												   const LLUUID& force_id)
{
	// generate UUID based on hash of filename
	LLUUID new_id;
	if (force_id.notNull())
	{
		new_id = force_id;
	}
	else
	{
		new_id.generate(url);
	}

	LLPointer<LLViewerFetchedTexture> imagep = findImage(new_id);
	
	if (imagep.isNull())
	{
		switch(texture_type)
		{
		case LLViewerTexture::FETCHED_TEXTURE:
			imagep = new LLViewerFetchedTexture(url, new_id, usemipmaps);
			break ;
		case LLViewerTexture::LOD_TEXTURE:
			imagep = new LLViewerLODTexture(url, new_id, usemipmaps);
			break ;
		default:
			llerrs << "Invalid texture type " << texture_type << llendl ;
		}		
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}

		addImage(imagep);
		
		if (boost_priority != 0)
		{
			if (boost_priority == LLViewerFetchedTexture::BOOST_UI ||
				boost_priority == LLViewerFetchedTexture::BOOST_ICON)
			{
				imagep->dontDiscard();
			}
			imagep->setBoostLevel(boost_priority);
		}
	}

	imagep->setGLTextureCreated(true);

	return imagep;
}
开发者ID:Xara,项目名称:kris-clone,代码行数:57,代码来源:llviewertexturelist.cpp

示例2: getImageFromFile

LLViewerImage* LLViewerImageList::getImageFromFile(const std::string& filename,
												   BOOL usemipmaps,
												   BOOL level_immediate,
												   LLGLint internal_format,
												   LLGLenum primary_format, 
												   const LLUUID& force_id)
{
	if (gNoRender)
	{
		// Never mind that this ignores image_set_id;
		// getImage() will handle that later.
		return getImage(IMG_DEFAULT, TRUE, TRUE);
	}

	std::string full_path = gDirUtilp->findSkinnedFilename("textures", filename);
	if (full_path.empty())
	{
		llwarns << "Failed to find local image file: " << filename << llendl;
		return getImage(IMG_DEFAULT, TRUE, TRUE);
	}

	// generate UUID based on hash of filename
	LLUUID new_id;
	if (force_id.notNull())
	{
		new_id = force_id;
	}
	else
	{
		new_id.generate(full_path);
	}

	LLPointer<LLViewerImage> imagep = hasImage(new_id);
	
	if (imagep.isNull())
	{
		imagep = new LLViewerImage(full_path, new_id, usemipmaps);
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}

		addImage(imagep);
		
		if (level_immediate)
		{
			imagep->dontDiscard();
			imagep->setBoostLevel(LLViewerImage::BOOST_UI);
		}
	}

	return imagep;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:54,代码来源:llviewerimagelist.cpp

示例3: getImageFromUrl

LLViewerImage* LLViewerImageList::getImageFromUrl(const std::string& url,
												   BOOL usemipmaps,
												   BOOL level_immediate,
												   LLGLint internal_format,
												   LLGLenum primary_format, 
												   const LLUUID& force_id)
{
	if (gNoRender)
	{
		// Never mind that this ignores image_set_id;
		// getImage() will handle that later.
		return getImage(IMG_DEFAULT, TRUE, TRUE);
	}

	// generate UUID based on hash of filename
	LLUUID new_id;
	if (force_id.notNull())
	{
		new_id = force_id;
	}
	else
	{
		new_id.generate(url);
	}

	LLPointer<LLViewerImage> imagep = hasImage(new_id);
	
	if (imagep.isNull())
	{
		imagep = new LLViewerImage(url, new_id, usemipmaps);
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}

		addImage(imagep);
		
		if (level_immediate)
		{
			imagep->dontDiscard();
			imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
		}
	}

	imagep->setGLTextureCreated(true);

	return imagep;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:49,代码来源:llviewerimagelist.cpp

示例4: getImage

LLViewerImage* LLViewerImageList::getImage(const LLUUID &image_id,
												   BOOL usemipmaps,
												   BOOL level_immediate,
												   LLGLint internal_format,
												   LLGLenum primary_format,
												   LLHost request_from_host)
{
	// Return the image with ID image_id
	// If the image is not found, creates new image and
	// enqueues a request for transmission
	
	if ((&image_id == NULL) || image_id.isNull())
	{
		return (getImage(IMG_DEFAULT, TRUE, TRUE));
	}
	
	LLPointer<LLViewerImage> imagep = hasImage(image_id);
	
	if (imagep.isNull())
	{
		imagep = new LLViewerImage(image_id, request_from_host, usemipmaps);
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}
		
		addImage(imagep);
		
		if (level_immediate)
		{
			imagep->dontDiscard();
			imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_UI);
		}
		else
		{
			//by default, the texure can not be removed from memory even if it is not used.
			//here turn this off
			//if this texture should be set to NO_DELETE, either pass level_immediate == TRUE here, or call setNoDelete() afterwards.
			imagep->forceActive() ;
		}
	}

	imagep->setGLTextureCreated(true);
	
	return imagep;
}
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:47,代码来源:llviewerimagelist.cpp

示例5: createImage

//when this function is called, there is no such texture in the gTextureList with image_id.
LLViewerFetchedTexture* LLViewerTextureList::createImage(const LLUUID &image_id,											       
												   BOOL usemipmaps,
												   LLViewerTexture::EBoostLevel boost_priority,
												   S8 texture_type,
												   LLGLint internal_format,
												   LLGLenum primary_format,
												   LLHost request_from_host)
{
	LLPointer<LLViewerFetchedTexture> imagep ;
	switch(texture_type)
	{
	case LLViewerTexture::FETCHED_TEXTURE:
		imagep = new LLViewerFetchedTexture(image_id, request_from_host, usemipmaps);
		break ;
	case LLViewerTexture::LOD_TEXTURE:
		imagep = new LLViewerLODTexture(image_id, request_from_host, usemipmaps);
		break ;
	default:
		llerrs << "Invalid texture type " << texture_type << llendl ;
	}
	
	if (internal_format && primary_format)
	{
		imagep->setExplicitFormat(internal_format, primary_format);
	}
	
	addImage(imagep);
	
	if (boost_priority != 0)
	{
		if (boost_priority == LLViewerFetchedTexture::BOOST_UI ||
			boost_priority == LLViewerFetchedTexture::BOOST_ICON)
		{
			imagep->dontDiscard();
		}
		imagep->setBoostLevel(boost_priority);
	}
	else
	{
		//by default, the texture can not be removed from memory even if it is not used.
		//here turn this off
		//if this texture should be set to NO_DELETE, call setNoDelete() afterwards.
		imagep->forceActive() ;
	}

	return imagep ;
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:48,代码来源:llviewertexturelist.cpp

示例6: getImage

LLViewerImage* LLViewerImageList::getImage(const LLUUID &image_id,
												   BOOL usemipmaps,
												   BOOL level_immediate,
												   LLGLint internal_format,
												   LLGLenum primary_format,
												   LLHost request_from_host)
{
	// Return the image with ID image_id
	// If the image is not found, creates new image and
	// enqueues a request for transmission
	
	if ((&image_id == NULL) || image_id.isNull())
	{
		return (getImage(IMG_DEFAULT, TRUE, TRUE));
	}
	
	LLPointer<LLViewerImage> imagep = hasImage(image_id);
	
	if (imagep.isNull())
	{
		imagep = new LLViewerImage(image_id, usemipmaps);
		// Might want to request from host other than where the agent is. JC
		imagep->setTargetHost(request_from_host);
		
		if (internal_format && primary_format)
		{
			imagep->setExplicitFormat(internal_format, primary_format);
		}
		
		addImage(imagep);
		
		if (level_immediate)
		{
			imagep->dontDiscard();
			imagep->setBoostLevel(LLViewerImage::BOOST_UI);
		}
	}
	
	return imagep;
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:40,代码来源:llviewerimagelist.cpp


注:本文中的LLPointer::setExplicitFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。