diff options
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index bc8db1dd97..553507bc0c 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1652,8 +1652,6 @@ const S32 max_format = (S32)num_formats - 1; return FALSE; } - LL_PROFILER_GPU_CONTEXT - if (!gGLManager.initGL()) { OSMessageBox(mCallbacks->translateString("MBVideoDrvErr"), mCallbacks->translateString("MBError"), OSMB_OK); @@ -1685,6 +1683,8 @@ const S32 max_format = (S32)num_formats - 1; swapBuffers(); } + LL_PROFILER_GPU_CONTEXT; + return TRUE; } @@ -1838,6 +1838,7 @@ void* LLWindowWin32::createSharedContext() void LLWindowWin32::makeContextCurrent(void* contextPtr) { wglMakeCurrent(mhDC, (HGLRC) contextPtr); + LL_PROFILER_GPU_CONTEXT; } void LLWindowWin32::destroySharedContext(void* contextPtr) @@ -3086,8 +3087,20 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ if (raw->header.dwType == RIM_TYPEMOUSE) { LLMutexLock lock(&window_imp->mRawMouseMutex); - window_imp->mRawMouseDelta.mX += raw->data.mouse.lLastX; - window_imp->mRawMouseDelta.mY -= raw->data.mouse.lLastY; + + S32 speed; + const S32 DEFAULT_SPEED(10); + SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); + if (speed == DEFAULT_SPEED) + { + window_imp->mRawMouseDelta.mX += raw->data.mouse.lLastX; + window_imp->mRawMouseDelta.mY -= raw->data.mouse.lLastY; + } + else + { + window_imp->mRawMouseDelta.mX += round((F32)raw->data.mouse.lLastX * (F32)speed / DEFAULT_SPEED); + window_imp->mRawMouseDelta.mY -= round((F32)raw->data.mouse.lLastY * (F32)speed / DEFAULT_SPEED); + } } } } @@ -3603,10 +3616,13 @@ void LLWindowWin32::swapBuffers() { LL_PROFILE_ZONE_SCOPED_CATEGORY_WIN32; ASSERT_MAIN_THREAD(); - glFlush(); //superstitious flush for maybe frame stall removal? + { + LL_PROFILE_GPU_ZONE("flush"); + glFlush(); //superstitious flush for maybe frame stall removal? + } SwapBuffers(mhDC); - LL_PROFILER_GPU_COLLECT + LL_PROFILER_GPU_COLLECT; } |