diff --git a/Demos3/AllBullet2Demos/premake4.lua b/Demos3/AllBullet2Demos/premake4.lua index eeac13583..436e1fa8d 100644 --- a/Demos3/AllBullet2Demos/premake4.lua +++ b/Demos3/AllBullet2Demos/premake4.lua @@ -48,7 +48,7 @@ "../GpuDemos/gwenUserInterface.h" } -if os.is("Linux") then links{"X11"} end +if os.is("Linux") then links{"X11","pthread"} end if os.is("MacOSX") then links{"Cocoa.framework"} end diff --git a/Demos3/GpuDemos/premake4.lua b/Demos3/GpuDemos/premake4.lua index 24ca2eaf2..77e2f7119 100644 --- a/Demos3/GpuDemos/premake4.lua +++ b/Demos3/GpuDemos/premake4.lua @@ -91,7 +91,7 @@ function createProject(vendor) } end if os.is("Linux") then - links{"X11"} + links{"X11","pthread"} files { "../../btgui/OpenGLWindow/X11OpenGLWindow.cpp", "../../btgui/OpenGLWindow/X11OpenGLWindows.h" diff --git a/Demos3/GpuGuiInitialize/premake4.lua b/Demos3/GpuGuiInitialize/premake4.lua index 696235966..b36da7dd5 100644 --- a/Demos3/GpuGuiInitialize/premake4.lua +++ b/Demos3/GpuGuiInitialize/premake4.lua @@ -68,7 +68,7 @@ function createProject(vendor) } end if os.is("Linux") then - links {"X11"} + links {"X11","pthread"} files { "../../btgui/OpenGLWindow/X11OpenGLWindow.cpp", "../../btgui/OpenGLWindow/X11OpenGLWindows.h" diff --git a/Demos3/ImplicitCloth/premake4.lua b/Demos3/ImplicitCloth/premake4.lua index 8eea82ce3..beb20168d 100644 --- a/Demos3/ImplicitCloth/premake4.lua +++ b/Demos3/ImplicitCloth/premake4.lua @@ -61,6 +61,7 @@ if os.is("Windows") then "../../btgui/OpenGLWindow/X11OpenGLWindow.h", "../../btgui/OpenGLWindow/X11OpenGLWindow.cpp" } + links{"pthread"} end if os.is("MacOSX") then links{"Cocoa.framework"} diff --git a/Demos3/SimpleOpenGL3/premake4.lua b/Demos3/SimpleOpenGL3/premake4.lua index 2ab575f07..57a2a04f7 100644 --- a/Demos3/SimpleOpenGL3/premake4.lua +++ b/Demos3/SimpleOpenGL3/premake4.lua @@ -27,7 +27,7 @@ } -if os.is("Linux") then links {"X11"} end +if os.is("Linux") then links {"X11","pthread"} end if os.is("MacOSX") then links{"Cocoa.framework"} diff --git a/btgui/GwenOpenGLTest/premake4.lua b/btgui/GwenOpenGLTest/premake4.lua index fb39dcbfe..1bca96bc8 100644 --- a/btgui/GwenOpenGLTest/premake4.lua +++ b/btgui/GwenOpenGLTest/premake4.lua @@ -55,6 +55,7 @@ "../OpenGLWindow/X11OpenGLWindow.h", "../OpenGLWindow/X11OpenGLWindow.cpp" } + links{"pthread"} end if os.is("MacOSX") then links{"Cocoa.framework"} diff --git a/btgui/OpenGLWindow/X11OpenGLWindow.cpp b/btgui/OpenGLWindow/X11OpenGLWindow.cpp index 0a525b081..6b5bcb39d 100644 --- a/btgui/OpenGLWindow/X11OpenGLWindow.cpp +++ b/btgui/OpenGLWindow/X11OpenGLWindow.cpp @@ -11,6 +11,8 @@ #include +#include + GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None }; @@ -82,6 +84,13 @@ void X11OpenGLWindow::enableOpenGL() printf("GL_VERSION=%s\n", ver); const GLubyte* sl = glGetString(GL_SHADING_LANGUAGE_VERSION); printf("GL_SHADING_LANGUAGE_VERSION=%s\n", sl); + +//Access pthreads as a workaround for a bug in Linux/Ubuntu +//See https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642 + + int i=pthread_getconcurrency(); + printf("pthread_getconcurrency()=%d\n",i); + // const GLubyte* ext = glGetString(GL_EXTENSIONS); // printf("GL_EXTENSIONS=%s\n", ext); } diff --git a/btgui/OpenGLWindow/premake4.lua b/btgui/OpenGLWindow/premake4.lua index be45bbe0d..b6c869646 100644 --- a/btgui/OpenGLWindow/premake4.lua +++ b/btgui/OpenGLWindow/premake4.lua @@ -30,7 +30,9 @@ "Win32Window.h", } end - if not os.is("Linux") then + if os.is("Linux") then + links {"pthread"} + else excludes { "X11OpenGLWindow.cpp", "X11OpenGLWindows.h"