How to get point attenuation to work in OpenGL ES?

I am producing a mobile screensaver which simulates the stars in galaxies. The stars are point sprites and the stars which are far away should look smaller than those closer to the viewer. That is why I need point attenuation. I have tried to include everything to get point attenuation to work, but the points still have the same size. Why doesn’t the point attenuation have any effect? This is my code:

glPointSize( 4 );
GLfloat min=0.1f;
glPointParameterf(GL_POINT_SIZE_MIN, min);
GLfloat max=4f;
glPointParameterf(GL_POINT_SIZE_MAX, max);
//the coordinates for calcluting point atenuation
iPointSizeCoords[0] = 0f;
iPointSizeCoords[1] = 0.5f;
iPointSizeCoords[2] = 0.5f;
glPointParameterf(GL_POINT_DISTANCE_ATTENUATION,*iPointSizeCoords);
glPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE,5.f);

Not sure exactly what the problem is, but I think this line:

glPointParameterf(GL_POINT_DISTANCE_ATTENUATION,*iPointSizeCoords);

should be:

glPointParameterf(GL_POINT_DISTANCE_ATTENUATION, iPointSizeCoords);

I tried your idea,but I got “function call does not match”, so it can’t be that.

Sorry, it should be:

glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, iPointSizeCoords);

Notice the extra ‘v’, which is necessary since you are passing an array.

Thanks, it worked without errors. But I still do not see any point attenuation. You can see my current code below. I have tried a lot of values for the attentuation coordinates (iPointSizeCoords) but I never see any results. Do I need to add more code? Or should I remove glPointSize( 4 ) or
glPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE,5.f) or do I need to enable something more?

glPointSize( 4 );
glPointParameterf(GL_POINT_SIZE_MIN, 0.1f);
glPointParameterf(GL_POINT_SIZE_MAX,4.0f);
iPointSizeCoords[0] = 0.0f;
iPointSizeCoords[1] = 5.0f;
iPointSizeCoords[2] = 5.0f;
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, iPointSizeCoords);
glPointParameterf(GL_POINT_FADE_THRESHOLD_SIZE,5.f);

I got it to work now. The problem is that the S60 3d edition FP1 emulator can not simulate point attenuation. When I run the same program on a mobile device as on the emulator, the point attenuation works on the mobile but not on the emulator. So if you only try it on the emulator, you think that the code is wrong, eventhough it isn’t. You can see my working code below:

glPointSize(8);
glPointParameterf(GL_POINT_SIZE_MIN, 0.1f);
glPointParameterf(GL_POINT_SIZE_MAX,8.0f);
//the coordinates for calcluting point atenuation:
iPointSizeCoords[0] = 1.0f;
iPointSizeCoords[1] = 0.055f;
iPointSizeCoords[2] = 0.0f;
glPointParameterfv(GL_POINT_DISTANCE_ATTENUATION, iPointSizeCoords);

Thanks for sharing your solution.