From b3a04b4ea7a3fafa2a748289ed95e941e187ca99 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 12 Apr 2011 14:31:59 +0000 Subject: Fix crash for Intel G45 video cards This video card need a bit different approach to buffer swapping. Patch provided by nico_ga from IRC. --- intern/ghost/intern/GHOST_WindowWin32.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern') diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 629338e70d8..5d21edb758d 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -609,7 +609,12 @@ GHOST_TSuccess GHOST_WindowWin32::setOrder(GHOST_TWindowOrder order) GHOST_TSuccess GHOST_WindowWin32::swapBuffers() { - return ::SwapBuffers(m_hDC) == TRUE ? GHOST_kSuccess : GHOST_kFailure; + HDC hDC = m_hDC; + + if (is_crappy_intel_card()) + hDC = ::wglGetCurrentDC(); + + return ::SwapBuffers(hDC) == TRUE ? GHOST_kSuccess : GHOST_kFailure; } -- cgit v1.2.3