Direct3D Z order question

Stefan Dösinger stefandoesinger at
Mon Feb 13 05:15:06 CST 2006

> Seems to me that the call to glOrtho should be replaced by a call to
> glViewport(x,y,width,height) and glDepthRange(near,far).  Since your
> vertices are already in viewport coordinates, according to the comment in
> the code, how does something like the following work for you:

>             glViewport(X, Y, width, height);
>             checkGLcall("glViewport");
>             /* depth ranges will be clamped to [0, 1] */
>             glDepthRange(minZ, maxZ);
>             checkGLcall("glDepthRange");
That code breaks half-life. The hl console is only dark brown rectangle in the 
top right quarter, the in-game graphics isn't drawn.

What's the difference between glOrtho and glViewport/glDepthRange? I've 
expected the code to be equal to the glOrtho call.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the wine-devel mailing list