MCPcopy Create free account
hub / github.com/ddnet/ddnet / SetVSync

Method SetVSync

src/engine/client/graphics_threaded.cpp:2815–2835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2813}
2814
2815bool CGraphics_Threaded::SetVSync(bool State)
2816{
2817 if(!m_pCommandBuffer)
2818 return true;
2819
2820 const bool OldState = State;
2821
2822 // add vsync command
2823 bool RetOk = false;
2824 CCommandBuffer::SCommand_VSync Cmd;
2825 Cmd.m_VSync = State ? 1 : 0;
2826 Cmd.m_pRetOk = &RetOk;
2827 AddCmd(Cmd);
2828
2829 // kick the command buffer
2830 KickCommandBuffer();
2831 WaitForIdle();
2832
2833 g_Config.m_GfxVsync = RetOk ? State : OldState;
2834 return RetOk;
2835}
2836
2837bool CGraphics_Threaded::SetMultiSampling(uint32_t ReqMultiSamplingCount, uint32_t &MultiSamplingCountBackend)
2838{

Callers 2

ConchainWindowVSyncMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected