SHORT VERSION:
From the docs
NOTE: The Pbuffer will have its own context that shares display lists and textures with the Display context (if it is created).
How can I share textures and display lists between PBuffers without creating a Display() ?
LONG VERSION:
I’m going on with my SGL (Simple Graphics Library) which is more or less a simple lwjgl based Java2D replacement.
It already draws polys and animated images (textured quads) with affinetransforms, alpha compositing etc. It will handle java2d shapes soon. SGL makes wide use of PBuffers.
The speed is fantastic and the API is really simple. Here’s a sample:
            SGLBitmap sb0 = new SGLBitmap(512,256,0);
            SGLBitmap sb1 = new SGLBitmap(220,200,0);
            SGLImage si = new SGLImage(bufferedimage);
            
            
            int loops = 1000;
            sb0.startTimer();
            for (int i=0; i<loops; i++)
            {
                  sb0.setTransform(AffineTransform.getRotateInstance(-i/10f,100,50));
                  sb0.setColor(new Color(220,11,11,10));
                  sb0.fillRect(0,0,180,120);
                  sb0.setColor(Color.white);
                  sb0.drawRect(0,0,190,130);
                  sb0.setColor(new Color(220,240,150,12));
                  sb0.fillRect(20,20,110,120);
                  sb0.drawImage(si,30,10);
                  
                  sb1.setColor(Color.blue);
                  sb1.fillRect(0,0,80,20);
                  sb1.setColor(Color.yellow);
                  sb1.drawRect(0,0,90,30);
                  sb1.drawImage(si,0,0);
            }
            float t = sb0.endTimer();
Now I discovered that the PBuffers constructed without a Display do not share textures and display lists and that’s a problem as they must be shared between SGLBitmaps (each SGLBitmap holds a PBuffer).
From the docs
NOTE: The Pbuffer will have its own context that shares display lists and textures with the Display context (if it is created).
As SGL will work both onscreen and offscreen, I would need to share display lists and textures without creating a Display().
Maybe the LWJGL Pbuffers constructor would need a boolean switch in order to allow the sharing of display lists and textures.
      
    