Drawing a particle cloud with glfw or glut

Hi all,
i was playing around with an example of a particle cloud.
when I tried recreating the example in a new project, I realised that the points where somewhat larger. not particularly larger, but the cloud had lost the lightweight impression that it initially left.

Searching through the code I realised the only difference was that the example was calling from main() a glut window, rather than a glfw…

ofAppGlutWindow window;
ofSetupOpenGL(&window, 1920,1080,OF_FULLSCREEN);	

instead of

ofSetupOpenGL(1920,1080,OF_FULLSCREEN);	

so switching to glut resolved this problem. of particle size.

Unfortunately I have reasons to believe that on some executions of my application, glut behaves erratically (namely some png images may not appear). If I kill and restart the application the png will load fine again.

Is what I observed true at all? Is there any problem with glut or have I not looked deep enough in my application?

Is there a chance I can swtch back to glfw but keep the small particle size?

The way I run the code is the following:
in draw() I call:

glPointSize(0.001);

and the particles array is sent to the vbo, and then sent for processing and prjection with:

vbo.setVertexData(&points[0], numPoints, GL_DYNAMIC_DRAW);
vbo.draw(GL_POINTS, 0, (int)numPoints);

I seriously doon’t understand why the pointsize will be reduced in glfw, as it is in glut

Thank you for your help.

try

ofAppGLFWWindow window;
window.setNumSamples(0);
ofSetupOpenGL(&window, 1920,1080,OF_FULLSCREEN);

of in your setup function:
call:
ofDisableAntiAliasing

hope that helps!

1 Like

Hi Theo,
why yes it did help!
it fixed the point size problems so I’m back to using GLFW.
However, the documentation entry is empty on setNumSamples, could you provide some explanation as to what we just did?

thank you!

We just turned anti-aliasing off.
In ofAppGLUTWindow AA is off by default, in ofAppGLFWWindow we have it turned on ( set to either 2 or 4 samples ).
Setting it to 0 samples basically turns it off.

Hope that helps!!
Theo