Login  Register

Re: How to initializing a GLPBuffer in JOGL2

Posted by Martin on Aug 28, 2012; 12:06pm
URL: https://forum.jogamp.org/How-to-initializing-a-GLPBuffer-in-JOGL2-tp4025881p4025920.html

Sven Gothel wrote
However, just do as the exception says .. use a valid size > 0x0.
That was already done.

Very surprised to see that following code is working:

protected void initGLPBuffer(int width, int height) {
        GLCapabilities caps = org.jzy3d.global.Settings.getInstance().getGLCapabilities();
        caps.setDoubleBuffered(false);
        if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer(null))
            throw new RuntimeException("No pbuffer support");

        glpBuffer = GLDrawableFactory.getFactory(caps.getGLProfile()).createGLPbuffer(null, caps, null, width, height, null);
        glpBuffer.addGLEventListener(renderer);
    }

Don't know what I missed before :)