Tuio causing openGL error

Currently, I am working on a project that uses MultiTouch. When a button is pressed, we have a class that creates an openGL Display List. When testing with a mouse, everything worked fine. When a onMultiTouchDown event triggered the instantiation of the class, however, the Display List was not being created. Come to find out, there is an openGL INVALID_OPERATION error that occurs when there is multi-touch events. This error was preventing any openGL display list calls from working(glGenLists and glNew List). Using glGetError, we were able to track the error all the way back to the “ProcessPacket” function in the class “TuioClient.cpp.” Stripping all of our code, the error fires with every Multi touch event. Only before there is a multi touch action and after there is no multi-touch cursors in the system do the openGL errors go away. We are now having trouble tracking past TuioClient for the sequence of events and tracking down where this error is being initiated. Any help or ideas, would be great.

To see what I mean, you can put the following line of code in any touchDown (onMultiTouchDown) event when using tuio:
int error = glGetError();if (error != GL_NO_ERROR) { std::cout << "Tuio Client: An OpenGL error has occured: " << gluErrorString(error) << std::endl;}

i think the problem is tuio is using it’s own thread to run and you cannot access opengl from a different thread. the solution is to store new fingers in a vector when they arrive and do your opengl calls from update. also this is not thread safe so you’re going to need a mutex to access the info in the vector from both threads.

in the new OF version there will be a new mutex class but right now youll need to inherit from ofxThread and enclose your accesses to the vector in between calls to lock and unlock