I just tried the latest nightly build, but still get the same error code. I even tried to switch from bitmaps to JPGs picture files, but no improvement
Maybe I can show you my complete cubemap class:
public class CubeMap implements EnvironmentMappingIface
{
private Texture cubeMapTex = null;
private String posX = "";
private String posY = "";
private String posZ = "";
private String negX = "";
private String negY = "";
private String negZ = "";
/**
* Creates a new cube map with the specified six textures.
* @param posX path to posX texture
* @param negX path to negX texture
* @param posY path to posY texture
* @param negY path to negY texture
* @param posZ path to posZ texture
* @param negZ path to negZ texture
* @param width texture width in pixels
* @param height texture height in pixels
*/
public CubeMap(GL gl, String posX, String negX, String posY, String negY, String posZ, String negZ /*, int width, int height */)
{
this.posX = posX;
this.negX = negX;
this.posY = posY;
this.negY = negY;
this.posZ = posZ;
this.negZ = negZ;
this.init(gl); // init the cube map data
}
/**
* Initializes the cube map data.
* @param gl
*/
private void init(GL gl)
{
this.cubeMapTex = TextureIO.newTexture(GL.GL_TEXTURE_CUBE_MAP);
try
{
this.cubeMapTex.updateImage(TextureIO.newTextureData(new File(this.posX), true, null), GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X);
this.cubeMapTex.updateImage(TextureIO.newTextureData(new File(this.negX), true, null), GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X);
this.cubeMapTex.updateImage(TextureIO.newTextureData(new File(this.posY), true, null), GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y);
this.cubeMapTex.updateImage(TextureIO.newTextureData(new File(this.negY), true, null), GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y);
this.cubeMapTex.updateImage(TextureIO.newTextureData(new File(this.posZ), true, null), GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z);
this.cubeMapTex.updateImage(TextureIO.newTextureData(new File(this.negZ), true, null), GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);
}
catch (GLException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/* (non-Javadoc)
* @see de.adventure.engine.effect.environmentmapping.EnvironmentMappingIface#bind(javax.media.opengl.GL)
*/
public void bind(GL gl)
{
gl.glPushAttrib(GL.GL_TEXTURE_BIT);
gl.glActiveTexture(GL.GL_TEXTURE1);
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
gl.glEnable(GL.GL_TEXTURE_CUBE_MAP);
gl.glEnable(GL.GL_TEXTURE_GEN_S);
gl.glEnable(GL.GL_TEXTURE_GEN_T);
gl.glEnable(GL.GL_TEXTURE_GEN_R);
gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_REFLECTION_MAP);
gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_REFLECTION_MAP);
gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_REFLECTION_MAP);
this.cubeMapTex.bind();
this.cubeMapTex.enable();
}
/* (non-Javadoc)
* @see de.adventure.engine.effect.environmentmapping.EnvironmentMappingIface#release(javax.media.opengl.GL)
*/
public void release(GL gl)
{
gl.glActiveTexture(GL.GL_TEXTURE1);
this.cubeMapTex.disable();
gl.glDisable(GL.GL_TEXTURE_GEN_S);
gl.glDisable(GL.GL_TEXTURE_GEN_T);
gl.glDisable(GL.GL_TEXTURE_GEN_R);
gl.glDisable(GL.GL_TEXTURE_CUBE_MAP);
gl.glPopAttrib();
}
Well the error already occurs in the init() method which is called in the constructor.
The bind() and release() method just run along while using an empty cube map texture object, I guess.