Input to process.

Is there an “easy” way to provide input to a process using OpenGL from another process? I’m trying to find a wrapper class before I dive into the inter-process communication subject.

Nope. OpenGL != networking.

There are a number of ways of IPC… and not all of them is exactly rocket science. You could think about—for example, and it depends on which system you’re using—doing one of:

  • FIFOs (head-full-of-dead-insects easy)
  • shared memory (easy to get working, but has several tricks you have to be aware of)
  • sockets (reasonably straight forward)
  • and probably others which I can’t think of right now.

there’s a really cool unix network programming book around, but i can’t remember who wrote it. it has a white cover with blue writing, tho’, and it’s damned, DAMNED useful.

cjeers,
John

Thanks John,

I have a home webserver. I want to be able to take input from CGI programs and pass it to a continuously running process that uses OpenGL. This will modify a model, render an image, and save it to disk. The server will then send the image back to the client.
I’ll investigate all the methods you suggest, but if you have an idea of which one would be best in this case, I would very much appreciate the input (you could save me a couple of weeks of headaches.)

Thanks

Hi,

well, I know naught about ye CGI scripts, sadly. I’m GUESSING that CGI is some kind of interface for an underlying executable?? or something?

I’ll assume you have an OpenGL server program running, waiting for some input from another process (which, in turn, is somehow attached to your CGI front-end). Given that the client-stub between the CGI and the server might not be running all the time, then this kinda precludes shared memory and FIFO’s. Sockets, on the other hand, would be ideal. You could get the opengl program to listen to a particular port and wait for connections much easier than allocating a shared memory block for communications. (FIFOs are also fairly easy, but they’re based on file handles, so you’ll have to probe a file; but FIFOs won’t work across different machines)

Do a search for sockets, and you should be able to pull some skelton program up pretty quickly.

cheers,
John