Is it possible to create multiple windows with glut?

#1

Syphon, for example, requires an ofAppGlutWindow window instance instead of ofAppBaseWindow. I can get multiple windows going with ofAppBaseWindow well enough, but not with glut.

I’ve tried something like the following:

shared_ptr<ofAppGlutWindow> mainWindow = ofCreateWindow(settings);

But I get this error: No viable conversion from ‘shared_ptr’ to ‘shared_ptr’ which seems weird because ofAppGlutWindow extends ofAppBaseWindow, right?

#2

no it’s not possible, glut is not even officially maintained anymore. if you need multiple windows you need to use a GLFW window which is what ofCreateWindow returns

#3

Thanks for your reply. So in short Syphon is incompatible with multiple windows, right? Maybe the solution is to build separate apps entirely and have a script launch them both at the same time, then use syphon/osc to pass data between the two.

#4

i don’t know why syphon depends on glut but i imagine it should be easy to change so it uses glfw instead

#5

I’m getting some pretty funky behavior when not using glut, maybe someone has insight into why this happens?

I should say that the little diagonal strand there appears to be correct. As in, it’s not a sync issue (I believe) but rather two black triangles obscuring the view.

It draws just fine in my window. The upper left image is the fbo I’m attempting to pass thru syphon via .getTexture()

ofApp.h

ofxSyphonServer syphonTexture;
ofFbo fbo;

ofApp.cpp

syphonTexture.setName("texture");
fbo.allocate(1280, 720, GL_RGBA);

draw

fbo.begin();
altered.draw(0,0);
fbo.end();
fbo.draw(0,0,100,100);
syphonTexture.publishTexture(&fbo.getTexture());

To be certain, it does seem as though those triangles take on the color of whatever the first rendered and sent syphon frame were. Below is from a published screen that started as the default OF grey. You can see the correct webcam image peeking through that diagonal slit and at the top.

#6

ofxSyphon does not require GLUT. Can you provide a complete but minimal project which reproduces your issue?

#7

You can try changin the GLVersion