Hej,
I try to render a particle system with a vertex array offscreen. I use glgraphics:
Code:off = new GLGraphicsOffScreen(this, 800, 600, true, 4);
And then somewhere else in the code my particle renderer:
Code:
PGraphicsOpenGL pgl = (PGraphicsOpenGL) g;
GL gl = pgl.beginGL();
gl.glEnable( GL.GL_BLEND );
gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
gl.glEnable(GL.GL_POINT_SMOOTH);
gl.glPointSize(esize);
gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
gl.glVertexPointer(3, GL.GL_FLOAT, 0, posarray);
gl.glEnableClientState(GL.GL_COLOR_ARRAY);
gl.glColorPointer(3, GL.GL_FLOAT, 0, colarray);
gl.glDrawArrays(GL.GL_POINTS, 0, pmax);
gl.glDisable(GL.GL_BLEND);
pgl.endGL();
I tried some ideas ... but I do not have enough insights to make this right.
I started to add "off.beginDraw();" and "off." before some lines but it would not work. Then I tried something like this, because I figured that GLGraphicsOffScreen could be a PGraphicsOpenGL:
Code: PGraphicsOpenGL pgl = (PGraphicsOpenGL) off;
But that was not working either. It was just rendering to the screen directly.
Any ideas?
Thanks.