JOGL Texture在Mac OS X上消失了 [英] JOGL Texture disappears on mac osx
问题描述
我已经进行了一些研究,但找不到与该问题有相同经验的人.
I have done some research and cant find anyone that have the same experience of this problem.
如果有人可以确认他们可以使用Eclipse和jogl使用JRE1.8运行macbook pro来绘制纹理,我将不胜感激.还是别人遇到同样的问题?
I would appreciate if someone just can confirm that they can draw textures with eclipse and jogl running a macbook pro with JRE1.8. Or does someone else experience same problems?
纹理在osx上消失-GL_TEXTURE_2D JOGL Eclipse Java
推荐答案
jmaasing(一个JogAmp用户)每天在Mac Book Pro上使用带有JOGL 2.2.4的Oracle Java 1.8,他至少运行了我的第一人称射击游戏,没有重现此问题.
jmaasing (a JogAmp user) uses Oracle Java 1.8 with JOGL 2.2.4 daily on a Mac Book Pro, he ran my first person shooter at least once and he didn't reproduce this problem.
您的标题是完全错误的.抱歉,这是挑衅,我真的很生气.此外,错误来自您的代码,请阅读以下内容: https://www.opengl.org/sdk/docs/man/html/glBindTexture.xhtml
Your title is plain wrong. Sorry it's a provocation, I'm really furious. Moreover, the mistake comes from your code, read this: https://www.opengl.org/sdk/docs/man/html/glBindTexture.xhtml
gl.glBindTexture(GL.GL_TEXTURE0, texture.getTarget());
?????????这是错误的.目标是第一个参数,第二个不是纹理单位,它是glGenTextures返回的纹理标识符(有时称为纹理对象"). GL.GL_TEXTURE0应该与glActiveTexture一起使用.如果它有时奏效,您会很幸运.而是写:
gl.glBindTexture(GL.GL_TEXTURE0, texture.getTarget());
????????? This is wrong. The target is the first parameter and the second one isn't the texture unit, it's the texture identifier (sometimes called the texture "object") returned by glGenTextures. GL.GL_TEXTURE0 should be used with glActiveTexture. You're lucky if it works sometimes. Rather write:
gl.glBindTexture(texture.getTarget(), texture.getTextureObject());
祝你好运.很抱歉,请阅读手册.
Good luck. Sorry to be harsh but please read the manual.
您也调用了Texture.enable(),Texture.bind()和Texture.disable().
Edit.: You call call Texture.enable(), Texture.bind() and Texture.disable() too.
这篇关于JOGL Texture在Mac OS X上消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!