Hello, I'm wondering if anyone has/knows of any examples of networking code integrated with OpenGL.
Basically, I need to send position coordinates of something over a network to my OpenGL display... which would then draw the object at the correct position.
The problem I'm having is integrating my UDP code with the game. I basically have a loop which constantly updates/draws. I originally thought that I could have the UDP code in a separate thread and just update the shared coordinates. However, if my draw functions read position before the network code is done writing the new position then I have a race condition and invalid data... however I can't make the Update or Draw loops block...
I'm not sure if I should be using Synchronous or Asynchronous networking code here.
So, any tips on how I can solve this problem? Thanks