-
Notifications
You must be signed in to change notification settings - Fork 82
Threaded graphics
This branch I'm doing work on removing the OpenGL render calls from the main thread into a new separate thread.
The reason to do this is to make so that the network, input and game can update without waiting for the vsync:ed flip. This will reduce the latency in the network and input.
All graphics commands are put into a (CCommandBuffer) that is later pushed to a separate thread (CCommandProcessorHandler) that executes that buffer. The buffer is pushed during the IGraphics::Swap call.
The whole implementation lives in https://github.com/matricks/teeworlds/blob/threadedflip/src/engine/client/graphics_threaded.h and https://github.com/matricks/teeworlds/blob/threadedflip/src/engine/client/graphics_threaded.cpp. No changes is done to the graphics interface as of yet but a smaller change will be needed to finalize it.
- The CCommandBuffer should perhaps be a ring buffer.