cplusplus issue

Hi,
first of all thanks very much for the addition of the cplusplus node. It’s exactly what I was hoping you would add to it.

I got a basic setup working moving variables back and forth, and rendering into Touch.

But I’ve run into a bit of an issue, I’ve been trying to build a super simple FBO class to draw to.
this is where I’m running into problems. basically as soon as I load the DLL it crashes. I believe it has to do with some reserved memory issue.

Basically I’m wondering if this is something I can actually fix, or if I should just let the FBO thing go. I tried changing the layer for the FBO, but as soon if I do nothing but inititialize it, not draw to it or anything Touch crashes out.

If there’s something you can suggest as to how this might need to be specially setup for the DLL I’d appreciate it. Or if it’s just not going to work, so I can stop tearing my hair out.

I’ve attached the dmp file and here’s the code I’m using to initialize the FBO, I threw it into a quick Cinder build and it works fine.

[code]void FBO::init(int width, int height)
{
W = width;
H = height;

glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);


glGenFramebuffersEXT(1,&fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);

glGenRenderbuffersEXT(1, &depthBuffer);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuffer);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, W, H);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer);

glGenTextures(1, &img);
glBindTexture(GL_TEXTURE_2D, img);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, W, H, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glBindTexture(GL_TEXTURE_2D, 0);





glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, img, 0);


GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if(status != GL_FRAMEBUFFER_COMPLETE_EXT)
    bool fboUsed = false;

glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);

glDisable(GL_TEXTURE_2D);
glDisable(GL_DEPTH_TEST);

}[/code]

thanks
Kegan
TouchCrashFTE077.7940.11.dmp (113 KB)

Hey, Touch already has a FBO bound and setup for you in the CPlusPlus TOP. Can you just render to that instead?
The .dmp file indicates the crash is occurring in your .dll somewhere. You can attach visual studio to the touchdesigner.exe process that’s running and you’ll be able to see where it’s crashing in your code.

Thanks,
The final is getting rendered to that FBO, but I’m thinking more in the duplicating uses.
So draw to the FBO, and then render multiples of those to the final FBO.

I’ll try debugging more, or just use one dll as the Top input for a second.

I was more trying to figure out if there would some overlapping that would happen.

Kegan

How are you rebinding my FBO for the final output? Using push/pop attrib?
I think I’ll add a value in execute that tells you the FBO index of my FBO so it’s easier for you to bind it for the final output.

If possible let me know how this all turns out.

Sorry for the delay, been kind of spread out.
Did a quick test with the new FBOindex access, didn’t work at first , but switched from a glew to glee and at least have a very preliminary test working.
This is just a quick rebinding of the FBO in the index. I’ll let you know when I get the chance to get to the full test.

Thanks very much for the help
Kegan