本文整理汇总了C++中ogre::TextureUnitState::getTextureBorderColour方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::getTextureBorderColour方法的具体用法?C++ TextureUnitState::getTextureBorderColour怎么用?C++ TextureUnitState::getTextureBorderColour使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::getTextureBorderColour方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exportFont
// ----------------------------------------------------------------------
void FontSerializer::exportFont(const Font *pFont, const Ogre::String &fileName)
{
// Open/create the file
mpfFile = fopen(fileName.c_str(), "wb");
if (!mpfFile)
{
// Throw an error if the file was not found, or was not possible to read
SONETTO_THROW("A file was not found!");
}
fwrite(&Font::mFourCC, sizeof(uint32), 1, mpfFile);
fwrite(&pFont->mVersion, sizeof(uint32), 1, mpfFile);
fwrite(&pFont->mEncode, sizeof(uint32), 1, mpfFile);
fwrite(&pFont->mVerticalOffsetTop, sizeof(float), 1, mpfFile);
fwrite(&pFont->mVerticalOffsetBottom, sizeof(float), 1, mpfFile);
fwrite(&pFont->mHorizontalScale, sizeof(float), 1, mpfFile);
saveString(pFont->mIName);
if(pFont->mMaterial.isNull())
SONETTO_THROW("Material does not exist");
Ogre::Pass * pass = pFont->mMaterial->getTechnique(0)->getPass(0);
bool has_separate_blend = pass->hasSeparateSceneBlending();
uint32 mat_scene_blend_source = (uint32)pass->getSourceBlendFactor();
uint32 mat_scene_blend_dest = (uint32)pass->getDestBlendFactor();
uint32 mat_scene_blend_source_a = (uint32)pass->getSourceBlendFactorAlpha();
uint32 mat_scene_blend_dest_a = (uint32)pass->getDestBlendFactorAlpha();
fwrite(&has_separate_blend, sizeof(bool), 1, mpfFile);
fwrite(&mat_scene_blend_source, sizeof(uint32), 1, mpfFile);
fwrite(&mat_scene_blend_dest, sizeof(uint32), 1, mpfFile);
fwrite(&mat_scene_blend_source_a, sizeof(uint32), 1, mpfFile);
fwrite(&mat_scene_blend_dest_a, sizeof(uint32), 1, mpfFile);
uint32 mat_alpha_reject_func = (uint32)pass->getAlphaRejectFunction();
uint8 mat_alpha_reject_val = (uint8)pass->getAlphaRejectValue();
bool map_alpha_reject_atc = pass->isAlphaToCoverageEnabled();
fwrite(&mat_alpha_reject_func, sizeof(uint32), 1, mpfFile);
fwrite(&mat_alpha_reject_val, sizeof(uint8), 1, mpfFile);
fwrite(&map_alpha_reject_atc, sizeof(bool), 1, mpfFile);
Ogre::TextureUnitState * texunit = pass->getTextureUnitState(0);
Ogre::TextureUnitState::UVWAddressingMode tex_address_mode_uvw = texunit->getTextureAddressingMode();
uint32 tex_address_mode_u = (uint32)tex_address_mode_uvw.u;
uint32 tex_address_mode_v = (uint32)tex_address_mode_uvw.v;
uint32 tex_address_mode_w = (uint32)tex_address_mode_uvw.w;
uint32 tex_filtering_min = (uint32)texunit->getTextureFiltering(Ogre::FT_MIN);
uint32 tex_filtering_mag = (uint32)texunit->getTextureFiltering(Ogre::FT_MAG);
Ogre::ColourValue tex_border_color = texunit->getTextureBorderColour();
fwrite(&tex_address_mode_u,sizeof(uint32), 1, mpfFile);
fwrite(&tex_address_mode_v,sizeof(uint32), 1, mpfFile);
fwrite(&tex_address_mode_w,sizeof(uint32), 1, mpfFile);
fwrite(&tex_filtering_min,sizeof(uint32), 1, mpfFile);
fwrite(&tex_filtering_mag,sizeof(uint32), 1, mpfFile);
fwrite(tex_border_color.ptr(),sizeof(float)*4, 1, mpfFile);
uint32 colsize = (uint32)pFont->mColorList.size();
fwrite(&colsize,sizeof(uint32), 1, mpfFile);
for(uint32 i = 0; i != colsize; ++i)
{
fwrite(pFont->mColorList[i].ptr(),sizeof(float)*4, 1, mpfFile);
}
for(uint32 i = 0; i != 256; ++i)
{
FontGlyph glyph = pFont->mGlyph[i];
fwrite(&glyph, sizeof(FontGlyph), 1,mpfFile);
}
Ogre::Image * tex = pFont->mFontImage;
size_t uWidth = tex->getWidth();
size_t uHeight = tex->getHeight();
size_t uDepth = tex->getDepth();
size_t eFormat = (uint32)tex->getFormat();
size_t numFaces = tex->getNumFaces();
size_t numMipMaps = tex->getNumMipmaps();
fwrite(&uWidth, sizeof(size_t), 1, mpfFile);
fwrite(&uHeight, sizeof(size_t), 1, mpfFile);
fwrite(&uDepth, sizeof(size_t), 1, mpfFile);
fwrite(&eFormat, sizeof(size_t), 1, mpfFile);
fwrite(&numFaces, sizeof(size_t), 1, mpfFile);
fwrite(&numMipMaps, sizeof(size_t), 1, mpfFile);
size_t texdatasize = Ogre::Image::calculateSize(numMipMaps,
numFaces,
uWidth,
uHeight,
uDepth,
//.........这里部分代码省略.........