Quote: Original post by PaulAtreusQuote: Original post by mfawcett
On mouse down, store the mouse position, on mouse up, calculate the center of the selection box, and pass the width and height params to opengl. Remember, selection usually occurs on mouse up, not in real-time as you drag the mouse.
Actually, you can make a flag that gets toggled to on when the mouse button is pressed and off when it is depressed and have the value of x,y stored upon the initial click. Then, inside your mouse-move event, you have a check for if the flag is toggled on. If it is, then you make your selection box's dimensions be from the initial x,y value to your current x,y value and you can do selection as you are dragging the selection box.
Absolutely, I was just trying to help him understand how he could go about implementing it. It's been a while since I played any RTS games. Is that how the selection action normally works?