Mac OS X - Incorrect Texture Object ID's.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mac OS X - Incorrect Texture Object ID's.

millerni456
Hey I'm using JOGL to create some textures for an application.

I noticed that on Windows, my texture ID's point to the correct textures.  However, on Mac OS X, the first two texture ID's that are given to me are incorrect.  When used on a quadrilateral, they show the entire rendered image of my application's GLCanvas, but upside down.

I'm curious if anyone can confirm if this is a problem with JOGL's texture functions, or if it is a nuance for developing with OpenGL on a Mac.

I'm using AWTTextureIO.newTexture() to create my texture ID's, and I'm passing a BufferedImage as it's data.


If anyone knows about this or can confirm my issue, it'd be greatly appreciated.  Thanks much!

- Nick Miller
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS X - Incorrect Texture Object ID's.

jmaasing
That sounds more like the texture data isn't uploaded rather than texture ids (just guessing). Anyway, I use this on Mac

final InputStream in = getClass().getResourceAsStream(resourcename);
final Texture tex = TextureIO.newTexture(in, false, "png");
tex.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER,
                GL.GL_LINEAR);
tex.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER,
                GL.GL_LINEAR);

then later on when rendering I do

tex.bind(gl);

to bind the texture when needed, that works fine for reading an image from file, so if that is your use case you could have a look at TextureIO

http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/util/texture/TextureIO.html#newTexture(java.io.InputStream,%20boolean,%20java.lang.String)
Reply | Threaded
Open this post in threaded view
|

Re: Mac OS X - Incorrect Texture Object ID's.

gouessej
Administrator
In reply to this post by millerni456
It has nothing to do with Mac, I had a similar problem under Linux and it has nothing to do with texture identifiers or OpenGL, it comes from AWT or AWTTextureIO which has an inconsistent behaviour. That's why I use TextureIO. Sven is right, we should just remove this class and ensure that the functionalities it contains have some equivalents.
Julien Gouesse | Personal blog | Website