I'm having some trouble understanding how I should conditionally render shapes. For example, say I want to render a 3d object based upon the push of a button - how am I suppose to handle that? I haven't really been able to find example code or tutorials for something like this, so I'm curious about what the best practices are for this.
Now, I've done a lot of searching online and I've found the use of timers to handle things, but I'm not sure if I should use a timer here. For example, I was thinking I should use a timer to call a method, say its named renderScene, that determines what to render based upon some booleans that are set by other methods called on button presses. So, basically when you push a button, you set a boolean to be true, and thats picked up by renderScene which is called through the use of a timer. renderScene then goes ahead and calls updateGL and the scene is updated.
Is that the way I should approach this, or is there a better way? I feel like that's probably not the correct solution, so I was reaching out.