viewport.3gl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. '\" e
  2. '\"! eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 24 September 1999
  6. .ds Re Release 1.2.1
  7. .ds Dp Jan 14 18:30
  8. .ds Dm 01 viewport.
  9. .ds Xs 35742 4 viewport.gl
  10. .TH GLVIEWPORT 3G
  11. .SH NAME
  12. .B "glViewport
  13. \- set the viewport
  14. .SH C SPECIFICATION
  15. void \f3glViewport\fP(
  16. GLint \fIx\fP,
  17. .nf
  18. .ta \w'\f3void \fPglViewport( 'u
  19. GLint \fIy\fP,
  20. GLsizei \fIwidth\fP,
  21. GLsizei \fIheight\fP )
  22. .fi
  23. .EQ
  24. delim $$
  25. .EN
  26. .SH PARAMETERS
  27. .TP \w'\f2x\fP\ \f2y\fP\ \ 'u
  28. \f2x\fP, \f2y\fP
  29. Specify the lower left corner of the viewport rectangle,
  30. in pixels. The initial value is (0,0).
  31. .TP
  32. \f2width\fP, \f2height\fP
  33. Specify the width and height
  34. of the viewport.
  35. When a GL context is first attached to a window,
  36. \f2width\fP and \f2height\fP are set to the dimensions of that window.
  37. .SH DESCRIPTION
  38. \%\f3glViewport\fP specifies the affine transformation of $x$ and $y$ from
  39. normalized device coordinates to window coordinates.
  40. Let ($x sub nd$, $y sub nd$) be normalized device coordinates.
  41. Then the window coordinates ($x sub w$, $y sub w$) are computed as follows:
  42. .sp
  43. .ce
  44. .EQ
  45. x sub w ~=~ ( x sub nd ~+~ 1 ) left ( "width" over 2 right ) ~+~ "x"
  46. .EN
  47. .sp
  48. .ce
  49. .EQ
  50. y sub w ~=~ ( y sub nd ~+~ 1 ) left ( "height" over 2 right ) ~+~ "y"
  51. .EN
  52. .RE
  53. .P
  54. Viewport width and height are silently clamped
  55. to a range that depends on the implementation.
  56. To query this range, call \%\f3glGet\fP with argument
  57. \%\f3GL_MAX_VIEWPORT_DIMS\fP.
  58. .SH ERRORS
  59. \%\f3GL_INVALID_VALUE\fP is generated if either \f2width\fP or \f2height\fP is negative.
  60. .P
  61. \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glViewport\fP
  62. is executed between the execution of \%\f3glBegin\fP
  63. and the corresponding execution of \%\f3glEnd\fP.
  64. .bp
  65. .SH ASSOCIATED GETS
  66. \%\f3glGet\fP with argument \%\f3GL_VIEWPORT\fP
  67. .br
  68. \%\f3glGet\fP with argument \%\f3GL_MAX_VIEWPORT_DIMS\fP
  69. .SH SEE ALSO
  70. \%\f3glDepthRange(3G)\fP