From 19cb364afe83774c87dfce90c08f3cd5f9b757bd Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Fri, 17 Sep 2010 16:46:35 +0000 Subject: [PATCH] New try to fix the ATI & OpenGL contexts bug git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1570 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/Window/GlContext.cpp | 5 +++-- src/SFML/Window/Linux/GlxContext.cpp | 9 +-------- src/SFML/Window/Win32/WglContext.cpp | 9 +-------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/SFML/Window/GlContext.cpp b/src/SFML/Window/GlContext.cpp index 3ec2214c..8539083c 100644 --- a/src/SFML/Window/GlContext.cpp +++ b/src/SFML/Window/GlContext.cpp @@ -123,8 +123,9 @@ bool GlContext::SetActive(bool active) if (MakeCurrent()) { // If this is the first context to be activated on this thread, make - // it the reference context for the whole thread - if (!threadContext) + // it the reference context for the whole thread. + // referenceContext must *not* be the threadContext of the main thread + if (!threadContext && (this != &referenceContext)) threadContext = this; return true; diff --git a/src/SFML/Window/Linux/GlxContext.cpp b/src/SFML/Window/Linux/GlxContext.cpp index 44c72412..28d24d02 100644 --- a/src/SFML/Window/Linux/GlxContext.cpp +++ b/src/SFML/Window/Linux/GlxContext.cpp @@ -62,14 +62,7 @@ myOwnsWindow(true) CreateContext(shared, VideoMode::GetDesktopMode().BitsPerPixel, ContextSettings(0, 0, 0)); // Activate the context - if (shared) - SetActive(true); - - // -- Warning -- - // The "if (shared)" condition fixes this bug: - // http://www.sfml-dev.org/forum/viewtopic.php?p=20767#20767 - // However, it was already there before and removed at revision 1236, - // but without any comment... so it might cause other problems in the future + SetActive(true); } diff --git a/src/SFML/Window/Win32/WglContext.cpp b/src/SFML/Window/Win32/WglContext.cpp index c5164580..5f2da071 100644 --- a/src/SFML/Window/Win32/WglContext.cpp +++ b/src/SFML/Window/Win32/WglContext.cpp @@ -59,14 +59,7 @@ myOwnsWindow (true) CreateContext(shared, VideoMode::GetDesktopMode().BitsPerPixel, ContextSettings(0, 0, 0)); // Activate the context - if (shared) - SetActive(true); - - // -- Warning -- - // The "if (shared)" condition fixes this bug: - // http://www.sfml-dev.org/forum/viewtopic.php?p=20767#20767 - // However, it was already there before and removed at revision 1236, - // but without any comment... so it might cause other problems in the future + SetActive(true); }