glutDisplayFunc Issue

I know this should probably go in the specific glut section of the forum but I see a few people are online in this one. So I apologize.
I’m trying to create a program that will read coordinates from a file and draw polylines from the data.
I’m to replace an existing myDisplay --> glutDisplayFunc(myDisplay)
with a new function drawPolyLineFile(char * fileName) but I can’t just replace myDisplay with that call because I get a message that tells me: error c2664 : ‘glutDisplayFunc’ cannot convert parameter 1 from void to void (__cdecl*)(void)’

Not sure if this is making sense… but the drawPolyLineFile() is compiling just fine as long as I don’t place it in the glutDisplayFunc.

hey sunwise, when you give glut a function, you’re saying, “call this function when this event happens”. so in the case of drawPolyLineFile(char * fileName), this doesn’t make much sense, since glut has no idea what the file name is, and the display(void) function doesn’t take any arguments anyway.

i suggest rearranging your program to load stuff from file elsewhere, maybe once during initialization, then draw normally with the display(void) function.

hope this helps!