【问题标题】:How to use Texture with a UImage as label in WhirlyGlobe如何在 WhirlyGlobe 中使用带有 UImage 的纹理作为标签
【发布时间】:2011-11-20 05:39:16
【问题描述】:

我将 WhirlyGlobe 添加到我的项目中,效果很好。现在我需要添加图像作为标记,我使用这样的代码。但似乎效果不佳。 标签在第一个字符的顶部显示一个白色区域。 和控制台日志'Texture::createInGL() glGenTextures()'。

我能做些什么来解决它。

Texture *theTex = new Texture(@"icon", @"png");
theTex->setUsesMipmaps(true);
SimpleIdentity theTexId = theTex->getId();
theScene->addChangeRequest(new AddTextureReq(theTex));
SingleLabel *gzLabel = [[[SingleLabel alloc] init] autorelease];
gzLabel.text = @"XXXXXX";
gzLabel.iconTexture = theTexId;
[gzLabel setLoc:GeoCoord::CoordFromDegrees(113.2759952545166, 23.117055306224895)];
[labels addObject:gzLabel];

【问题讨论】:

    标签: opengl-es textures


    【解决方案1】:

    纹理是每边的 2 的幂吗?

    【讨论】:

    • 很抱歉我没听懂你的意思。我是openGL的新手,请你解释一下。谢谢。
    • 您提供给 OpenGL 的图像需要是沿每个尺寸的两个像素数的幂。例如,256x256 或 512x512。
    猜你喜欢
    • 2011-12-06
    • 1970-01-01
    • 1970-01-01
    • 2012-12-18
    • 2016-11-26
    • 2020-04-01
    • 2018-04-02
    • 1970-01-01
    • 2020-04-03
    相关资源
    最近更新 更多