summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_viewport.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-13 18:16:11 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-08-13 18:20:04 -0600
commit4698483f849ba8dfde20a5d649f1ea099291f241 (patch)
tree1074039d22618502b72b077182ce55aa2ba089f8 /src/mesa/state_tracker/st_atom_viewport.c
parentcd308dfa794a1be5d933a4b89539d53929537f88 (diff)
Added st_fb_orientation() function to determine the up/down orientation of the framebuffer.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_viewport.c')
-rw-r--r--src/mesa/state_tracker/st_atom_viewport.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/mesa/state_tracker/st_atom_viewport.c b/src/mesa/state_tracker/st_atom_viewport.c
index 1307cbb6d2..a70f4c7434 100644
--- a/src/mesa/state_tracker/st_atom_viewport.c
+++ b/src/mesa/state_tracker/st_atom_viewport.c
@@ -39,27 +39,19 @@
* - depthrange
* - window pos/size or FBO size
*/
-static void update_viewport( struct st_context *st )
+static void
+update_viewport( struct st_context *st )
{
GLcontext *ctx = st->ctx;
GLfloat yScale, yBias;
- /* Negate Y scale to flip image vertically.
- * The NDC Y coords prior to viewport transformation are in the range
- * [y=-1=bottom, y=1=top]
- * Hardware window coords are in the range [y=0=top, y=H-1=bottom] where H
- * is the window height.
- * Use the viewport transformation to invert Y.
- */
-
/* _NEW_BUFFERS
*/
- if (ctx->DrawBuffer) {
+ if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) {
yScale = -1;
yBias = ctx->DrawBuffer->Height ;
}
else {
- /* we won't be rendering anything */
yScale = 1.0;
yBias = 0.0;
}