Hi,
I have an application where I have a wxWidget GUI with a wxglcanvas. I connected this application to the OF and ‘render’ everything inside this wxglcanvas insted of in normal OF opengl window.
the only think which still doesnt work is ofImage. The code which use ofImage is correct for sure, as I use it in a normal OF application. But in my GUIenabled app there is only white rectangle /rectangle, where a command:
texColor.draw(scenePosX, scenePosY, sx2, sy2);
should draw a texture.
My question is, does anybody know what GLUT settings shoul I use? so far I have this:
void BasicGLPane::prepare2DViewport(int topleft_x, int topleft_y, int bottomrigth_x, int bottomrigth_y)
{
/*
* Inits the OpenGL viewport for drawing in 2D
*/
for (int i = 0; i < 100; i++) {
for (int j = 0; j < 100; j++) {
colorIndex = (j*100+i)*3;
colorPixels[colorIndex + 0] = i; // r
colorPixels[colorIndex + 1] = j; // g
colorPixels[colorIndex + 2] = (unsigned char)(ofRandomuf() * 255); // b
}
}
texColor.update();
texColor.draw(0, 0, 100, 100);
so I think I have a proper texture. And also as I said, this code works in my regular OF app.
I also tried your error function and get this:
glError: invalid operation caught at D:\_openFrameworks\apps\examples\glCanvas1\BasicGLPane.cpp:308
but I do not know what that error means. you?