本文整理汇总了C++中Directory::Filename方法的典型用法代码示例。如果您正苦于以下问题:C++ Directory::Filename方法的具体用法?C++ Directory::Filename怎么用?C++ Directory::Filename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directory
的用法示例。
在下文中一共展示了Directory::Filename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetTextureData
void Image::SetTextureData(ImageData *ImgInfo, bool Reassign)
{
if (Reassign) Destroy();
CreateTexture(); // Make sure our texture exists.
Bind();
if (ImgInfo->Data == nullptr && !Reassign)
{
return;
}
if (!TextureAssigned || Reassign) // We haven't set any data to this texture yet, or we want to regenerate storage
{
TextureAssigned = true;
Directory Dir = ImgInfo->Filename;
Dir = Dir.Filename();
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
if (!Configuration::TextureParameterExists(Dir, "gen-mipmap") || Configuration::GetTextureParameter(Dir, "gen-mipmap") == "true")
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
GLint param;
switch (ImgInfo->WrapMode)
{
case ImageData::WM_CLAMP_TO_EDGE:
param = GL_CLAMP_TO_EDGE;
break;
case ImageData::WM_REPEAT:
param = GL_REPEAT;
break;
default:
param = GL_CLAMP_TO_EDGE;
}
GLint wrapS = param, wrapT = param;
if (Configuration::GetTextureParameter(Dir, "wrap-s") == "clamp-edge")
wrapS = GL_CLAMP_TO_EDGE;
else if (Configuration::GetTextureParameter(Dir, "wrap-s") == "repeat")
wrapS = GL_REPEAT;
else if (Configuration::GetTextureParameter(Dir, "wrap-s") == "clamp-border")
wrapS = GL_CLAMP_TO_BORDER;
else if (Configuration::GetTextureParameter(Dir, "wrap-s") == "repeat-mirrored")
wrapS = GL_MIRRORED_REPEAT;
if (Configuration::GetTextureParameter(Dir, "wrap-t") == "clamp-edge")
wrapT = GL_CLAMP_TO_EDGE;
else if (Configuration::GetTextureParameter(Dir, "wrap-t") == "repeat")
wrapT = GL_REPEAT;
else if (Configuration::GetTextureParameter(Dir, "wrap-t") == "clamp-border")
wrapT = GL_CLAMP_TO_BORDER;
else if (Configuration::GetTextureParameter(Dir, "wrap-t") == "repeat-mirrored")
wrapT = GL_MIRRORED_REPEAT;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapS);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapT);
GLint minparam;
switch (ImgInfo->ScalingMode)
{
case ImageData::SM_LINEAR:
minparam = GL_LINEAR;
param = GL_LINEAR;
break;
case ImageData::SM_MIPMAP:
minparam = GL_LINEAR_MIPMAP_LINEAR;
param = GL_LINEAR;
break;
case ImageData::SM_NEAREST:
minparam = GL_NEAREST;
param = GL_NEAREST;
break;
default:
minparam = GL_LINEAR_MIPMAP_LINEAR;
param = GL_LINEAR;
}
GLint minp = minparam, maxp = param;
if (Configuration::GetTextureParameter(Dir, "minfilter") == "linear")
minp = GL_LINEAR;
else if (Configuration::GetTextureParameter(Dir, "minfilter") == "nearest")
minp = GL_NEAREST;
else if (Configuration::GetTextureParameter(Dir, "minfilter") == "linear-mipmap-linear")
minp = GL_LINEAR_MIPMAP_LINEAR;
else if (Configuration::GetTextureParameter(Dir, "minfilter") == "linear-mipmap-nearest")
minp = GL_LINEAR_MIPMAP_NEAREST;
else if (Configuration::GetTextureParameter(Dir, "minfilter") == "nearest-mipmap-nearest")
minp = GL_NEAREST_MIPMAP_NEAREST;
else if (Configuration::GetTextureParameter(Dir, "minfilter") == "nearest-mipmap-linear")
minp = GL_NEAREST_MIPMAP_LINEAR;
if (Configuration::GetTextureParameter(Dir, "maxfilter") == "linear")
maxp = GL_LINEAR;
else if (Configuration::GetTextureParameter(Dir, "maxfilter") == "nearest")
maxp = GL_NEAREST;
else if (Configuration::GetTextureParameter(Dir, "maxfilter") == "linear-mipmap-linear")
maxp = GL_LINEAR_MIPMAP_LINEAR;
else if (Configuration::GetTextureParameter(Dir, "maxfilter") == "linear-mipmap-nearest")
maxp = GL_LINEAR_MIPMAP_NEAREST;
else if (Configuration::GetTextureParameter(Dir, "maxfilter") == "nearest-mipmap-nearest")
//.........这里部分代码省略.........