本文整理汇总了C++中LLPluginClassMedia::getTextureCoordsOpenGL方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPluginClassMedia::getTextureCoordsOpenGL方法的具体用法?C++ LLPluginClassMedia::getTextureCoordsOpenGL怎么用?C++ LLPluginClassMedia::getTextureCoordsOpenGL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPluginClassMedia
的用法示例。
在下文中一共展示了LLPluginClassMedia::getTextureCoordsOpenGL方法的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: 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 );
}
}