I am currently coding a game. I have a render engine using OpenGL to paint the scene, and I have a collision detection module.
Since I assume using hardware acceleration in collision detection (matrix calculation) should be faster, I tried to use mutex and single lock on OpenGL so that the render engien and collision module will only use it one after one.
However, when debugging I found the render engine access the OpenGL correctly, while the collision module always cause invalid operation by operating the model view matrix. I explicitely examined the glBegin() and glEnd() pair, and found that the render engine did release the OpenGL after finished the painting.
Is it that I can only use single thread on OpenGL in a process? Or I simply have some problem in threading coordination?
Besides, is my assumption right that using hardware (say, GeForce 2) to compute the transforma matrix will be much faster?
Thank you for your help!