Force render frame after hot code reload.
This commit is contained in:
parent
2f6c88f435
commit
60c77b2777
@ -248,6 +248,7 @@ int main()
|
|||||||
|
|
||||||
bool FirstFrame = true;
|
bool FirstFrame = true;
|
||||||
uint32_t LastRenderedTime = 0;
|
uint32_t LastRenderedTime = 0;
|
||||||
|
bool ForceRenderFrame = false;
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
while (Running)
|
while (Running)
|
||||||
@ -260,6 +261,7 @@ int main()
|
|||||||
{
|
{
|
||||||
SDLUnloadPluginCode(&Plugin);
|
SDLUnloadPluginCode(&Plugin);
|
||||||
Plugin = SDLLoadPluginCode(PluginLibraryFilename);
|
Plugin = SDLLoadPluginCode(PluginLibraryFilename);
|
||||||
|
ForceRenderFrame = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Event Event;
|
SDL_Event Event;
|
||||||
@ -287,10 +289,11 @@ int main()
|
|||||||
Buffer.Height = GlobalBackbuffer.Height;
|
Buffer.Height = GlobalBackbuffer.Height;
|
||||||
Buffer.Pitch = GlobalBackbuffer.Pitch;
|
Buffer.Pitch = GlobalBackbuffer.Pitch;
|
||||||
|
|
||||||
if (FirstFrame || Input.MouseDown)
|
if (FirstFrame || ForceRenderFrame || Input.MouseDown)
|
||||||
{
|
{
|
||||||
LastRenderedTime = SDL_GetTicks();
|
LastRenderedTime = SDL_GetTicks();
|
||||||
Plugin.UpdateAndRender(&Buffer, &Input);
|
Plugin.UpdateAndRender(&Buffer, &Input);
|
||||||
|
ForceRenderFrame = false;
|
||||||
}
|
}
|
||||||
FirstFrame = false;
|
FirstFrame = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user