fix color picking

This commit is contained in:
2017-08-02 23:06:46 +01:00
parent 235862c9d1
commit 95c00701f7
3 changed files with 17 additions and 15 deletions

View File

@@ -286,7 +286,7 @@ int main()
while (running)
{
// If there any message in the queue process it
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
if (!App::I.redraw && PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
{
running = !(msg.message == WM_QUIT/* || gl.keys[VK_ESCAPE]*/);
DispatchMessage(&msg);
@@ -298,10 +298,13 @@ int main()
float dt = (float)(t1 - t0) / 1000.0f;
if (dt > 1.0f / 60.0f)
{
App::I.clear();
App::I.update((float)(t1 - t0) / 1000.0f);
t0 = t1;
SwapBuffers(hDC);
if (App::I.redraw)
{
App::I.clear();
App::I.update((float)(t1 - t0) / 1000.0f);
SwapBuffers(hDC);
}
}
else
{
@@ -329,6 +332,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
case WM_SIZE:
App::I.resize((float)LOWORD(lp), (float)HIWORD(lp));
App::I.clear();
App::I.redraw = true;
App::I.update(0.f);
SwapBuffers(hDC);
break;