Skip to content

Commit

Permalink
Fix issue: when launching in sender mode, first shader send ask for r…
Browse files Browse the repository at this point in the history
…ecompilation so already connected grabbers update immediately
  • Loading branch information
nusan committed Jul 12, 2021
1 parent fdf9ac3 commit d5a203d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ int main(int argc, const char *argv[])
bool bGrabberFollowCaret = true;
bool bShowGui = true;
Timer::Start();
bool shaderFirstNetworkSend = true;
float shaderTimeOffset = 0;
float fNextTick = 0.1f;
float fLastTimeMS = Timer::GetTime();
Expand All @@ -543,7 +544,8 @@ int main(int argc, const char *argv[])
mShaderEditor.GetText(szShader, 65535);
Network::ShaderMessage NewMessage;
NewMessage.Code = std::string(szShader);
NewMessage.NeedRecompile = false;
NewMessage.NeedRecompile = shaderFirstNetworkSend; // only force recompile on the first send
shaderFirstNetworkSend = false;
NewMessage.CaretPosition = mShaderEditor.WndProc(SCI_GETCURRENTPOS, 0, 0);
NewMessage.AnchorPosition = mShaderEditor.WndProc(SCI_GETANCHOR, 0, 0);
int TopLine = mShaderEditor.WndProc(SCI_GETFIRSTVISIBLELINE, 0, 0);
Expand Down

0 comments on commit d5a203d

Please sign in to comment.