astellato / ofxSyphon

An OF add-on for using the Syphon framework.
Other
193 stars 57 forks source link

using a FBO with ofxSyphon on 008 crashes openFrameworks #11

Closed JoshuaBatty closed 11 years ago

JoshuaBatty commented 11 years ago

Hi Astellato. I've been getting major headaches with this, I managed to get ofxSyphon basic example to compile against 008 but when I add

fbo.begin();
ofClear(0,0,0,0);
fbo.allocate(ofGetWidth(),ofGetHeight(),GL_RGBA);
fbo.end();

in my test app setup after declaring an ofFbo in my .h I get the following error. screen shot 2013-10-21 at 7 31 50 am

I have replicated this same error on 3 mac computers now all using oF008, 2 using Xcode 5 and 1 using Xcode4. Weirdly, if I just allocate the fbo in my setup code, leaving out the fbo.begin() and fbo.end() then it compiles fine....?

Any ideas on what is going on here?

Thanks, Josh

astellato commented 11 years ago

Hey Josh,

This is more a general OF question, but I see two things wrong with the code above. First you need to allocate your FBO before calling any of its other functions. Second, all OpenGL calls (FBOs included) need to be done from draw(), not setup().

If you still can't sort this out, I would file a bug on the OF git or post in the forums.

JoshuaBatty commented 11 years ago

Thanks Astellato, That did fix the problem, ive been allocating my fbo like that for years and never had any troubles until now, not sure how that happened. cheers for the help.