What I want is to be able to change the value of a variable through the window with the graphics, not from the code. It’s ok if there are several fixed values and there is a choice only between them. Can you please give me some ideas?
I was thinking of something like this:
|–|–|–|–|–|, where each vertical line repesents a value and when you click the line, the value is changed, but it’s a bit difficult for me to implement this. Any simpler ideas
Here’s a quick keyboard-based solution (I’m assuming C++):
Let’s assume your values are all in an array called
values:Keep track of the selected value:
Make a function to handle key presses:
Finally, in your initialization, link
keyPressedtoglutKeyboardFunc: