Load a texture with PGraphics

edited January 2015 in GLSL / Shaders

I'm trying to load a texture inside a PGraphics:

PGraphics offscreen;

void setup()
        size(1200, 800, OPENGL);
        offscreen = createGraphics(600, 400, OPENGL);
        PGL pgl = offscreen.beginPGL();
        IntBuffer textureID = IntBuffer.allocate(1);
    ->  pgl.genTextures(1, textureID);

but I get a NullException error in the indicated line. Any suggestion?

Thanks in advance.

Sign In or Register to comment.