Hello, I'm essentially a c++ novice, so bare with me. I'm currently learning OpenGL on linux and would like to stream data to and from Pd. I'm aware of GEM, but would like to have the possibility of collaborating with those OpenGL programmers whom have no intention of learning Pd. There's also the possibility of incorporating it into a 3D Cave project being conducted by the media studies department here.
I'm trying to utilize this class which I found (libtcp++) in order to provide tcp client capabilities to my GL code: http://www.sashanet.com/internet/download.html
For now, I'm mainly determined to get the OpenGL-to-Pd connection working. So far, I've succeeded in creating the libtcp build, importing and instantiating a tcp_client object, and establishing a connection with Pd (netreceive outputs "1" upon execution of the graphic app). But I haven't figured out how to format the data in order for it to be received.
The tcp_client send fuction is as follows:
int TcpClient::send(char* data, int num_bytes) { return write(socket_fd, data, num_bytes); }
My call to 'send' is:
net->send(data, sizeof(data)); //net is my instantiated tcp object
based on this, I had to convert number data from the GL code to string before passing it. I tried both passing the data string alone (e.g. "49") as well as concatenating it with a name to be recognized by a Pd receive object (e.g. "foo 49").
What has to be reformatted in order for this to work?
Thanks, Dan