在 GL_TEXTURE_COORD_ARRAY 和 GL_COLOR_ARRAY 客户端状态之间切换时出现空白屏幕
我的 iOS 5 应用程序中有一个绘图功能,可以绘制纹理六边形地图。我正在尝试实现颜色选择以使六边形选择更容易,因此我构建了另一个绘图函数,以各种纯色绘制六边形。只要我从不调用备用函数,每个函数都可以正常运行。
当我在绘制纹理六边形图后尝试在任何时候绘制纯色图时,即使在不同的渲染循环中,也会出现问题。我
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
在绘制纯色贴图和
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
绘制纹理贴图时使用。
但纹理状态似乎保持活动状态并阻止纯色正确绘制。据我所知,它试图将纯色绘制为纹理,即使我已经禁用了该状态。没有任何绑定纹理,它们显示为空白。
我是否需要调用其他函数才能在颜色和纹理模式之间成功切换?
I have a drawing function in my iOS 5 app that draws a map of textured hexagons. I'm trying to implement color picking to make the hexagon selection easier, so I built another drawing function that draws the hexagons in various solid colors. Each of these runs fine as long as I never call the alternate function.
The problem happens when I try and draw the solid color map at any point after I've drawn the textured hexagon map - even in different render loops. I am using
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
when drawing the solid color map, and
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
when drawing the textured map.
But it seems like the texture state is staying active and preventing the solid colors from drawing correctly. As far as I can tell, it's trying to draw the solid colors as textures, even though I've disabled that state. Without any bound texture, they show up blank.
Is there some other function I need to call to successfully switch between color and texture modes?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,想通了。 我还必须打电话
除了
Ok, figured it out. I had to call
in addition to