GL11.glGetTexParameter doesn't accept GL12.GL_TEXTURE_3D

Started by CuppoJava, May 12, 2009, 17:08:03

Previous topic - Next topic

CuppoJava

Hi,
I'm trying to check how much space my compressed 3d texture is taking up by using glGetTexParameter, but it's giving me a OpenGLException: Invalid Enum.

According to the OpenGL documentation, GL_TEXTURE_3D should be accepted for OpenGL 1.2 and greater. Is there a way to work around this?

Thanks a lot
  -Patrick

Ciardhubh

glGetTexParameter with GL_TEXTURE_3D works fine for me, e.g.:
IntBuffer out = BufferUtils.createIntBuffer(4);
GL11.glGetTexParameter(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_RESIDENT, out);
System.out.println("Resident: " + ((out.get(0) == 1) ? "GL_TRUE" : "GL_FALSE"));

out = BufferUtils.createIntBuffer(4);
GL11.glGetTexParameter(GL12.GL_TEXTURE_3D, GL14.GL_GENERATE_MIPMAP, out);
System.out.println("Mipmap: " + ((out.get(0) == 1) ? "GL_TRUE" : "GL_FALSE"));

FloatBuffer outf = BufferUtils.createFloatBuffer(4);
GL11.glGetTexParameter(GL12.GL_TEXTURE_3D, GL11.GL_TEXTURE_PRIORITY, outf);
System.out.println("Priority: " + outf.get(0));


What's your call that causes the Invalid Enum exception?

CuppoJava

Thanks for verifying it for me. I realized that I made a stupid mistake.
I was supposed to use glGetTexLevelParameter, not glGetTexParameter
-Patrick