Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

OpenGL / C++

Name: Anonymous 2009-08-17 10:56

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?

Name: Anonymous 2009-08-17 11:11

>>3
I mean how do I found out the WINDOW COORDINATES of where I drew it.

glBegin(GL_QUADS);
      glVertex3f(-2.5f, 1.0f, -6.0f);
        glVertex3f(-0.5f, 1.0f, -6.0f);
        glVertex3f(-0.5f, -1.0f, -6.0f);
        glVertex3f(-2.5f, -1.0f, -6.0f);
    glEnd();


This is how I drew it. But I need window coordinates for checking if the user clicks within the rectangle.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List