问题
I have done some research and cant find anyone that have the same experience of this problem.
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?
Texture disappears on osx - GL_TEXTURE_2D JOGL Eclipse java
回答1:
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.
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());
????????? 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.
Edit.: You call call Texture.enable(), Texture.bind() and Texture.disable() too.
来源:https://stackoverflow.com/questions/26800500/jogl-texture-disappears-on-mac-osx