1

Is there a way to call a function with parameters from within glutMainLoop()? I have a simulation that with each step updates a vertex array...

Specifically, I was looking at glutIdleFunc() as a solution, but it doesn't seem to accept parameters. I could make my arrays global, but I really don't want to do that....

genpfault
  • 51,148
  • 11
  • 85
  • 139
user1459544
  • 117
  • 1
  • 6
  • 1
    Don't use glut, if it doesn't suit your needs. – derhass Mar 21 '14 at 20:05
  • You can hide glut callback api by wrapping it in your own api. glut is simple enough to do so. With C++ you can make a fully generic and type safe binding. Writing a message passing api is another solution. – a.lasram Mar 21 '14 at 20:15

1 Answers1

0

I think you stumbled over the dark side of 3d Programming :).

1st of all , glutIdleFunc() should be avoided , so don't go there to look for a solution.

You will need to research a bit about openGL and how it handles it's C functions. These 2 topics might be relevant.

opengl glutmainloop()

opengl: question about glutMainLoop()

Hope it helps clear some things out.

Community
  • 1
  • 1
MichaelCMS
  • 4,703
  • 2
  • 23
  • 29