本文整理汇总了C++中LLPluginClassMedia::getTextureFormatSwapBytes方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPluginClassMedia::getTextureFormatSwapBytes方法的具体用法?C++ LLPluginClassMedia::getTextureFormatSwapBytes怎么用?C++ LLPluginClassMedia::getTextureFormatSwapBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPluginClassMedia
的用法示例。
在下文中一共展示了LLPluginClassMedia::getTextureFormatSwapBytes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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;
}