I’m trying to use glut and MySQL (on C++) for a multiplayer video game, I already optimized the SELECT and managed to update players without losing performance but the part that keeps slowing down the game It’s:
"UPDATE Players_ingame SET Pos_X = " + std::to_string(px) + ",Pos_Y = " + std::to_string(py) + ",Pos_Z = " + std::to_string(pz) + ",Rot_P = " + std::to_string(angle) + " WHERE Username = '" + tmp_username + "';"
I already tried using this on ASYNC function with std::async and inside a thread using std::thread but still running slow and everytime the query slows down glut stops rendering (so I know it’s not using the async at all)
how could I run this separately from the rendering to fix the game?
(it’s running inside an object inside a glut timer)
Source: Windows Questions C++