I'm currently creating a simulation in C#. I am using OpenGl-TaoFramework. I ve encountered some problem . I used Glut.glutMainLoop();
function in code but I learnt that this function never returns and the program stopped. If I click the button after change variables, it works as I want but the problem is that I dont want to use button. But other way I couldnt be succeed to recall Glut.glutMainLoop();
again. Any help would be much appreciated.
private void button1_Click(object sender, EventArgs e)
{
i = Convert.ToInt32(textBox1.Text);
j = Convert.ToInt32(textBox2.Text);
k = Convert.ToInt32(textBox3.Text);
l = Convert.ToInt32(textBox4.Text);
m = Convert.ToInt32(textBox5.Text);
Glut.glutMainLoop();
}
If I understand your question correctly you would like to trigger a function every time that a variable changes, for this you could use an eventhandler. Here is a code example for a very basic eventhandler
DoWhenEventTriggers
will run every time that the variableGlutint
changes, So you could do a similar setup that will allow your code to triggerGlut.glutMainLoop();
when a variable changes.