How to convert OpenGL Coordinates to Window?

I tried searching but most of the results are the opposite.

Any idea how to do this?

Check this out:

Search down to “Window Coordinates”.

Alternatively, look at the source for gluProject in Mesa3D.

Note that “OpenGL Coordinates” doesn’t specify a specific source coordinate system, as OpenGL uses several coordinate systems (and you can add any ones you want to that). Presumably you mean OpenGL NDC-space coordinates (normalized device coordinates). But only you know for sure.