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)