added a test on existence of glPointParameterfv before its use in point-based mesh rendering to avoid crashes.

This commit is contained in:
mtarini 2009-04-20 16:30:35 +00:00
parent b399b4943f
commit 935b2e102b
1 changed files with 7 additions and 5 deletions

View File

@ -634,11 +634,13 @@ void DrawPoints()
{
glPointSize(GetHintParamf(HNPPointSize));
float camDist=CameraDistance();
float quadratic[] = { 0.0f, 0.0f, 1.0f/(camDist*camDist) };
if (glPointParameterfv) {
float camDist = CameraDistance();
float quadratic[] = { 0.0f, 0.0f, 1.0f/(camDist*camDist) , 0.0f };
glPointParameterfv( GL_POINT_DISTANCE_ATTENUATION, quadratic );
glPointParameterf( GL_POINT_SIZE_MAX, 16.0f );
glPointParameterf( GL_POINT_SIZE_MIN, 1.0f );
}
if(m->vn!=(int)m->vert.size())
{