本文整理汇总了C++中GLTexture::setMode方法的典型用法代码示例。如果您正苦于以下问题:C++ GLTexture::setMode方法的具体用法?C++ GLTexture::setMode怎么用?C++ GLTexture::setMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLTexture
的用法示例。
在下文中一共展示了GLTexture::setMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initTexture
void Surface::initTexture(const AttributeSet& attributes,
GLTexture& texture,
int line, int column,
ErrorManager* errorManager)
{
for(unsigned int i=0; i< attributes.size(); i++)
{
if (attributes[i].attribute == "file")
texture.setTexName(attributes[i].value);
else if(attributes[i].attribute == "mode")
{
if(attributes[i].value == "GL_MODULATE")
texture.setMode(GL_MODULATE);
else if(attributes[i].value == "GL_REPLACE")
texture.setMode(GL_REPLACE);
else if(attributes[i].value == "GL_ADD")
texture.setMode(GL_ADD);
else if(attributes[i].value == "GL_DECAL")
texture.setMode(GL_DECAL);
}
else if (attributes[i].attribute == "wrapS")
{
GLenum mode = (GLenum)ParserUtilities::toTextureWrapMode(attributes[i].value);
if(mode == GL_NONE)
errorManager->addError("Unknown Texture Mode", "Unknown Texture Mode \""
+ attributes[i].value + "\". Try( GL_CLAMP | GL_CLAMP_TO_EDGE | GL_CLAMP_TO_BORDER | GL_MIRRORED_REPEAT | GL_REPEAT)", line, column);
else
texture.setWrapS(mode);
}
else if (attributes[i].attribute == "wrapT")
{
GLenum mode = (GLenum)ParserUtilities::toTextureWrapMode(attributes[i].value);
if(mode == GL_NONE)
errorManager->addError("Unknown Texture Mode", "Unknown Texture Mode \""
+ attributes[i].value + "\". Try( GL_CLAMP | GL_CLAMP_TO_EDGE | GL_CLAMP_TO_BORDER | GL_MIRRORED_REPEAT | GL_REPEAT)", line, column);
else
texture.setWrapT(mode);
}
else if (attributes[i].attribute == "wrapR")
{
GLenum mode = (GLenum)ParserUtilities::toTextureWrapMode(attributes[i].value);
if(mode == GL_NONE)
errorManager->addError("Unknown Texture Mode", "Unknown Texture Mode \""
+ attributes[i].value + "\". Try( GL_CLAMP | GL_CLAMP_TO_EDGE | GL_CLAMP_TO_BORDER | GL_MIRRORED_REPEAT | GL_REPEAT)", line, column);
else
texture.setWrapR(mode);
}
else if (attributes[i].attribute == "priority")
diffuseTexture.setPriority((GLclampf)ParserUtilities::toDouble(attributes[i].value));
else
{
errorManager->addError("Unknown Texture Parameter",
"The provided texture parameter \"" + name + "\" is unknown", line, column);
}
}
}