Okay, tested it with glDepthMask(); but that did not do the trick 
Maybe I schould explain with code what Iâm doing.
So I have an image which will be drawn by Slick2D the code their does this:
texture.bind();
glTranslatef(x, y, 0);
glBegin(SGL.GL_QUADS);
glTexCoord2f(textureOffsetX, textureOffsetY);
glVertex3f(x, y, 0);
glTexCoord2f(textureOffsetX, textureOffsetY + textureHeight);
glVertex3f(x, y + height, 0);
glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY + textureHeight);
glVertex3f(x + width, y + height, 0);
glTexCoord2f(textureOffsetX + textureWidth, textureOffsetY);
glVertex3f(x + width, y, 0);
glEnd();
glTranslatef(-x, -y, 0);
So I canât see any problems here. Itâs does draw the image at a position. Now Iâm using this code to enter the depth buffer:
public static void enterDepthTest() {
if(!inDepth) {
lastDepth = 0;
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glAlphaFunc(GL11.GL_GEQUAL, 1f);
GL11.glDepthFunc(GL11.GL_LEQUAL);
inDepth = true;
}
}
then I use this to set the depth:
public static void setDepth(float depth) {
GL11.glTranslatef(0, 0, -lastDepth);
lastDepth = depth;
GL11.glTranslatef(0, 0, lastDepth);
}
I draw the first image at setDepth(-0.1f);and the second at the same postion and the same depth, so the last one will be drawn over the first one. For the second one I also included this line:
glColor4f(1, 1, 1, scale);
Where scale tells me how much of the second image should be seen (Or am I wrong here?).
And finally I leave the depth buffer with this code:
public static void leaveDepthTest() {
if(inDepth) {
lastDepth = 0;
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(SGL.GL_BLEND);
GL11.glColorMask(true, true, true, true);
GL11.glBlendFunc(SGL.GL_SRC_ALPHA, SGL.GL_ONE_MINUS_SRC_ALPHA);
inDepth = false;
}
}
If and I donât use the enter- and leaveDeothTest code then everything works as plant, but as said I canât draw stuff between layer then 