X11OpenGLWindow: create stencil buffer for shadows in OpenGL2 mode (OpenGL3 uses shadow maps)
Add 'createCollisionObjectGraphicsObject' API for CommonPhysicsSetup Add 'pthread' dependency as workaround for NVIDIA graphics driver issue (see //See https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642 )
This commit is contained in:
@@ -462,7 +462,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
{
|
||||
const int s=x>>4;
|
||||
const GLubyte b=180;
|
||||
GLubyte c=b+((s+t&1)&1)*(255-b);
|
||||
GLubyte c=b+((s+(t&1))&1)*(255-b);
|
||||
pi[0]=pi[1]=pi[2]=pi[3]=c;pi+=3;
|
||||
}
|
||||
}
|
||||
@@ -518,7 +518,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
|
||||
glColor3f(color.x(),color.y(), color.z());
|
||||
|
||||
bool useWireframeFallback = true;
|
||||
//bool useWireframeFallback = true;
|
||||
|
||||
if (!(debugMode & btIDebugDraw::DBG_DrawWireframe))
|
||||
{
|
||||
@@ -535,7 +535,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
const btSphereShape* sphereShape = static_cast<const btSphereShape*>(shape);
|
||||
float radius = sphereShape->getMargin();//radius doesn't include the margin, so draw with margin
|
||||
drawSphere(radius,10,10);
|
||||
useWireframeFallback = false;
|
||||
//useWireframeFallback = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -586,7 +586,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
glEnd();
|
||||
#endif
|
||||
|
||||
useWireframeFallback = false;
|
||||
//useWireframeFallback = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -617,7 +617,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
|
||||
glTranslatef(0.0, 0.0, -0.5*height);
|
||||
glutSolidCone(radius,height,10,10);
|
||||
useWireframeFallback = false;
|
||||
//useWireframeFallback = false;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
|
||||
|
||||
This software is provided 'as-is', without any express or implied warranty.
|
||||
In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it freely,
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it freely,
|
||||
subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
|
||||
@@ -17,6 +17,11 @@ subject to the following restrictions:
|
||||
|
||||
#include "DemoApplication.h"
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
//assume linux workaround
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
//glut is C code, this global gDemoApplication links glut to the C++ demo
|
||||
static DemoApplication* gDemoApplication = 0;
|
||||
|
||||
@@ -74,9 +79,17 @@ static void glutDisplayCallback(void)
|
||||
//#include <GL/glut.h>
|
||||
|
||||
int glutmain(int argc, char **argv,int width,int height,const char* title,DemoApplication* demoApp) {
|
||||
|
||||
|
||||
gDemoApplication = demoApp;
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
//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);
|
||||
#endif
|
||||
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);
|
||||
glutInitWindowPosition(width/2, height/2);
|
||||
@@ -112,7 +125,7 @@ CGLSetParameter(cgl_context, kCGLCPSwapInterval, &swap_interval);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
glutMainLoop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user