Sup /prog/
I'm currently trying my way around OpenGL. I've drawn a simple Rectangle and I also know how to determine the current mouse position, when the left mouse button is clicked.
Now how can I found out the window coordinates of my rectangle so I can check if the user does a left click inside the rectangle?
>>1
I've never used OpenGl, but wouldn't you need one corner and a size (or two corners) to draw a rectangle? If you can't work out it out from those you have no business programming.
Name:
Anonymous2009-08-17 11:22
>>4
If you're doing 2d, you can adjust the scale to work in window pixels. Otherwise, do some math.
Yeah just found out I can do it via gluProject. Just need to find a way to generalize the function call so that it works on any given rectangle (or object for that matter). Thanks though.