Avoid copying by passing matrices by reference to RenderDevice Use fasttrig from GZDoom for faster cos/sin Don't set matrices unless they changed. Even though the memcmp prevents it from being pushed to OpenGL it is still a waste.