case Texture.RTT_SOURCE_RGB: source = GL11.GL_RGB; break; case Texture.RTT_SOURCE_ALPHA: source = GL11.GL_ALPHA; break; case Texture.RTT_SOURCE_DEPTH: source = GL11.GL_DEPTH_COMPONENT; break; case Texture.RTT_SOURCE_INTENSITY: source = GL11.GL_INTENSITY; break; case Texture.RTT_SOURCE_LUMINANCE: source = GL11.GL_LUMINANCE; break; case Texture.RTT_SOURCE_LUMINANCE_ALPHA: source = GL11.GL_LUMINANCE_ALPHA; break;
case Texture.RTT_SOURCE_RGBA: break; case Texture.RTT_SOURCE_RGB: source = GL11.GL_RGB; break; case Texture.RTT_SOURCE_ALPHA: source = GL11.GL_ALPHA; break; case Texture.RTT_SOURCE_DEPTH: source = GL11.GL_DEPTH_COMPONENT; break; case Texture.RTT_SOURCE_INTENSITY: source = GL11.GL_INTENSITY; break; case Texture.RTT_SOURCE_LUMINANCE: source = GL11.GL_LUMINANCE; break; case Texture.RTT_SOURCE_LUMINANCE_ALPHA: source = GL11.GL_LUMINANCE_ALPHA; break;
    public void copyBufferToTexture(Texture tex, int width, int height, int buffer) {        GL11.glReadBuffer(GL11.GL_BACK);        GL11.glBindTexture(GL11.GL_TEXTURE_2D, tex.getTextureId());        int source = GL11.GL_RGBA;        switch (tex.getRTTSource()) {        case Texture.RTT_SOURCE_RGB: source = GL11.GL_RGB; break;        case Texture.RTT_SOURCE_ALPHA: source = GL11.GL_ALPHA; break;        case Texture.RTT_SOURCE_DEPTH: source = GL11.GL_DEPTH_COMPONENT; break;        case Texture.RTT_SOURCE_INTENSITY: source = GL11.GL_INTENSITY; break;        case Texture.RTT_SOURCE_LUMINANCE: source = GL11.GL_LUMINANCE; break;        case Texture.RTT_SOURCE_LUMINANCE_ALPHA: source = GL11.GL_LUMINANCE_ALPHA; break;        }        GL11.glCopyTexImage2D(GL11.GL_TEXTURE_2D, 0, source, 0, 0, width, height, 0);    }