From b9e1411660d80612ec9706c443eacb0f46caefad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Jun 2003 17:18:09 +0000 Subject: comments regarding window sizing --- src/mesa/main/matrix.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/mesa/main/matrix.c') diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 83d2ff425e..244b04ca40 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -414,9 +414,13 @@ _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) } -/* - * Define a new viewport and reallocate auxillary buffers if the size of - * the window (color buffer) has changed. +/** + * Set new viewport parameters and update derived state (the _WindowMap + * matrix). Usually called from _mesa_Viewport(). + * \note We also call _mesa_ResizeBuffersMESA() because this is a good + * time to check if the window has been resized. Many device drivers + * can't get direct notification from the window system of size changes + * so this is an ad-hoc solution to that problem. */ void _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, @@ -458,7 +462,10 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, ctx->NewState |= _NEW_VIEWPORT; /* Check if window/buffer has been resized and if so, reallocate the - * ancillary buffers. + * ancillary buffers. This is an ad-hoc solution to detecting window + * size changes. 99% of all GL apps call glViewport when a window is + * resized so this is a good time to check for new window dims and + * reallocate color buffers and ancilliary buffers. */ _mesa_ResizeBuffersMESA(); -- cgit v1.2.3