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


C++ LLPluginClassMedia::getTextureFormatInternal方法代码示例

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


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

示例1: updateBrowserTexture

bool LLWebBrowserTexture::updateBrowserTexture()
{
	if (!adjustSize())
		return false;
		
	LLPluginClassMedia* media = mMediaSource->getMediaPlugin();
	
	if(!media->textureValid())
		return false;
	
	if(mMediaSource->mNeedsNewTexture
		|| media->getTextureWidth() != getFullWidth()
		|| media->getTextureHeight() != getFullHeight() )
	{
		//releaseGLTexture();
		
		mFullWidth = media->getTextureWidth();
		mFullHeight = media->getTextureHeight();
		mTextureCoordsOpenGL = media->getTextureCoordsOpenGL();

		const LLColor4U fill_color(0,0,0,255);
		// will create mWidth * mHeight sized texture, using the texture params specified by the media.
		generateGLTexture(
				media->getTextureFormatInternal(), 
				media->getTextureFormatPrimary(), 
				media->getTextureFormatType(), 
				media->getTextureFormatSwapBytes(),
				&fill_color); //Initialize the texture to black.


		mMediaSource->mNeedsNewTexture = false;
	}
	
	return true;
}
开发者ID:aragornarda,项目名称:SingularityViewer,代码行数:35,代码来源:llmediactrl.cpp

示例2: createTexture

		void createTexture()
		{
			// create the texture used to display the browser data
			if(mMediaSource->textureValid())
			{
				mAppTextureWidth = mMediaSource->getTextureWidth();
				mAppTextureHeight = mMediaSource->getTextureHeight();
				mAppTextureCoordsOpenGL = mMediaSource->getTextureCoordsOpenGL();
				
				if(mAppTexture != 0)
				{
					glDeleteTextures( 1, &mAppTexture );
					mAppTexture = 0;
				}
				
				glGenTextures( 1, &mAppTexture );
				glBindTexture( GL_TEXTURE_2D, mAppTexture );
				glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
				glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
				glTexImage2D( GL_TEXTURE_2D, 0,
						mMediaSource->getTextureFormatInternal(),
						mAppTextureWidth, 
						mAppTextureHeight,
						0, 
						mMediaSource->getTextureFormatPrimary(), 
						mMediaSource->getTextureFormatType(), 
						NULL );
			}
		}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:29,代码来源:media_plugin_test.cpp

示例3: getMediaPlugin

/*LLViewerMediaTexture*/LLViewerTexture* LLViewerMediaImpl::updatePlaceholderImage()
{
	if(mTextureId.isNull())
	{
		// The code that created this instance will read from the plugin's bits.
		return NULL;
	}
	
	LLViewerMediaTexture* placeholder_image = (LLViewerMediaTexture*)LLViewerTextureManager::getFetchedTexture( mTextureId );
	LLPluginClassMedia* plugin = getMediaPlugin();

	placeholder_image->getLastReferencedTimer()->reset();

	if (mNeedsNewTexture 
		|| placeholder_image->getUseMipMaps()
		|| ! placeholder_image->mIsMediaTexture
		|| (placeholder_image->getWidth() != plugin->getTextureWidth())
		|| (placeholder_image->getHeight() != plugin->getTextureHeight())
		|| (mTextureUsedWidth != plugin->getWidth())
		|| (mTextureUsedHeight != plugin->getHeight())
		)
	{
		llinfos << "initializing media placeholder" << llendl;
		llinfos << "movie image id " << mTextureId << llendl;

		int texture_width = plugin->getTextureWidth();
		int texture_height = plugin->getTextureHeight();
		int texture_depth = plugin->getTextureDepth();
		
		// MEDIAOPT: check to see if size actually changed before doing work
		placeholder_image->destroyGLTexture();
		// MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work?
		placeholder_image->reinit(FALSE);	// probably not needed

		// MEDIAOPT: seems insane that we actually have to make an imageraw then
		// immediately discard it
		LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth);
		raw->clear(0x0f, 0x0f, 0x0f, 0xff);
		int discard_level = 0;

		// ask media source for correct GL image format constants
		placeholder_image->setExplicitFormat(plugin->getTextureFormatInternal(),
											 plugin->getTextureFormatPrimary(),
											 plugin->getTextureFormatType(),
											 plugin->getTextureFormatSwapBytes());

		placeholder_image->createGLTexture(discard_level, raw);

		// placeholder_image->setExplicitFormat()
		placeholder_image->setUseMipMaps(FALSE);

		// MEDIAOPT: set this dynamically on play/stop
		placeholder_image->mIsMediaTexture = true;
		mNeedsNewTexture = false;
				
		// If the amount of the texture being drawn by the media goes down in either width or height, 
		// recreate the texture to avoid leaving parts of the old image behind.
		mTextureUsedWidth = plugin->getWidth();
		mTextureUsedHeight = plugin->getHeight();
	}
	
	return placeholder_image;
}
开发者ID:NickyPerian,项目名称:SingularityViewer,代码行数:63,代码来源:llviewermedia.cpp


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