@Override
public void display(GLAutoDrawable glad) {
GL2 gl = (GL2)glad.getGL();
gl.glBlendFunc(GL_SRC_ALPHA, blends[iBlend]);
gl.glMatrixMode(GL2.GL_PROJECTION);
gl.glLoadIdentity();
new GLU().gluOrtho2D(-width / 2 - 1, width / 2 + 1, -height/2 - 1, height/2 + 1);
gl.glMatrixMode(GL2.GL_MODELVIEW);
gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[0]);
if (useOpenGLContext) {
queue.finish();
} else {
interleavedColorAndPositionsMem.read(queue, interleavedColorAndPositionsTemp, true);
gl.glBufferSubData(GL_ARRAY_BUFFER, 0, (int)interleavedColorAndPositionsTemp.getValidBytes(), interleavedColorAndPositionsTemp.getByteBuffer());
}
gl.glClear(GL_COLOR_BUFFER_BIT);
gl.glColor3f(1.0f, 1.0f, 1.0f);
gl.glInterleavedArrays(GL2.GL_C4UB_V2F, elementSize, 0);
gl.glDrawArrays(GL_POINTS, 0, particlesCount);
gl.glBindBuffer(GL_ARRAY_BUFFER, 0);
if (!paused)
updateKernelArgs();
}