// Make sure the ByteBuffer is rewound
pixel_buffer.rewind();
// Create a texture id
IntBuffer tex_buffer = ByteBuffer.allocateDirect(4).order(
ByteOrder.nativeOrder()).asIntBuffer();
GL11.glGenTextures(tex_buffer);
texture_id = tex_buffer.get(0);
// Create a MipMapped texture
GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture_id);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S,
GL11.GL_REPEAT);