Flickering on windows, but not on mac

I’m trying to get an installation running on Windows. I made it in XCode and it works perfectly. You see multiply shapes and objects in 3D space and using potmeters you can change their appearance and rotate the camera around them. But when I run it on a windows computer (I used codeblocks and exact the same code) I get weird flickering. Some big lines with the same color as the background move through the screen and over the shapes. When I move the camera they speed up/down or stop moving. It looks to me as if it has something to do with the znear plane or something. But what can I do about it, since the exact same code does work in XCode?

(It’s this installation:

sorry if i’m stating the obvious but i assume it’s not tearing from needing to call ofSetVerticalSync(true) in setup()?

Unfortunately not. I already tried setting the vertical sync, but it didn’t work. Also, the movement and size of the lines change as I move the camera (glutCamera I believe) around and get closer / further away from the objects.

I don’t get why the windows version does this, while the Mac version doesn’t…