PDA

View Full Version : Problem with sending data into display function



suponlyzx
10-17-2005, 12:07 AM
In normal opengl program,we use glutDisplayFunc(display) to draw our pic,but now I want to use my input data,for example,mesh data, in display,how can i send the data into it?
noted:display function is a void(void) function which means we can not send data into it directly. :confused:

Overmind
10-17-2005, 05:14 AM
You can't give it a parameter.

You could use a global variable or the Singleton design pattern for getting data into the display function. Or you could just use some other windowing toolkit, like SDL, or use the native interface of your windowing system (wgl/glX). Then you can give the draw function any parameter you like ;)

suponlyzx
10-17-2005, 09:32 AM
thanks
:)