   Button in OpenGL
I have a button struct that has a bool for button up or down a texture Id a rect to know where the button is and how big and a mouse hit test function.    The texture is top half button up, bottom half button down.    Now for my problem, I render, I hit test the button, I set the button to down and do some function, set the button to up (as I have finished what ever the button is supposed to do), I render.   As you can see the button doesn''t get drawn in the down possition at all. and I can''t see an easy way to draw it then do the function.    Any ideas? I don''t want to do a full gui system, if I can help it. 
  Have a texture for when it's in its normal state, and when it's in its down state. if(buttondown){  glBindTexture(GL_TEXTURE_2D, downtex);  buttonfunction();}else  glBindTexture(GL_TEXTURE_2D, normaltex); My Website | Everything you need to know about 3D Graphics | Google | Search the Forums [edited by - Luke Philpot on March 24, 2004 1:06:24 AM];  What most UI toolkits do:Make the button "down" when the user clicks down on it.If the mouse moves out with button down, make the button go "up" without activating.If the mouse button goes "down" while user still inside button, make button go up, and activate.If you''re really a stickler, you support the case of dragging the mouse back in while still holding the button down, and re-down-ing the button.The important part is activate-on-mouse-up, and rendering the button each frame based on its down state (which is state), not activation (which is transition).;Well that was easy, Thank you hplus0603, I wonder why I didn''t think about that. I just have to mouse test on mouse button up and if the buttondown is already true then do my function. Thanks again. ;  Actually when making a GUI, it''s easy to just look at how these controls behave in windows itself. 