本文整理汇总了C++中CTexture::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::size方法的具体用法?C++ CTexture::size怎么用?C++ CTexture::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::size方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AllocResources
void CGUITextureBase::AllocResources()
{
if (m_info.filename.IsEmpty())
return;
if (m_texture.size())
return; // already have our texture
// reset our animstate
m_frameCounter = 0;
m_currentFrame = 0;
m_currentLoop = 0;
if (m_info.useLarge)
{ // we want to use the large image loader, but we first check for bundled textures
if (!IsAllocated())
{
int images = g_TextureManager.Load(m_info.filename, true);
if (images)
{
m_isAllocated = NORMAL;
m_texture = g_TextureManager.GetTexture(m_info.filename);
}
}
if (m_isAllocated != NORMAL)
{ // use our large image background loader
CTexture texture = g_largeTextureManager.GetImage(m_info.filename, m_largeOrientation, !IsAllocated());
m_isAllocated = LARGE;
if (!texture.size()) // not ready as yet
return;
m_texture = texture;
}
}
else
{
int images = g_TextureManager.Load(m_info.filename);
// set allocated to true even if we couldn't load the image to save
// us hitting the disk every frame
m_isAllocated = NORMAL;
if (!images)
return;
m_texture = g_TextureManager.GetTexture(m_info.filename);
}
m_frameWidth = (float)m_texture.m_width;
m_frameHeight = (float)m_texture.m_height;
// load the diffuse texture (if necessary)
if (!m_info.diffuse.IsEmpty())
{
g_TextureManager.Load(m_info.diffuse);
m_diffuse = g_TextureManager.GetTexture(m_info.diffuse);
}
CalculateSize();
// call our implementation
Allocate();
}