Matt Sealey wrote:

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Ian Romanick
Sent: Wednesday, June 04, 2003 4:49 PM
To: DRI developer's list
Subject: [Dri-devel] Re: [Mesa3d-dev] Not confused so much anymore,
but.. (pointers to colour buffers again..)


Marcelo E. Magallon wrote:


On Wed, Jun 04, 2003 at 08:27:06AM +0100, Matt Sealey wrote:

> > By "resize" you mean, e.g., "color buffer resize"? That doesn't work.
> > From the documentation:
> > > > glViewport specifies the affine transformation of x and y from
> > normalized device coordinates to window coordinates.
> > Sure but if the window coordinates are width 300, height 300, then the
> maximum size of the buffer is really 300x300 in window coordinates.
> > There's not any point allocating or keeping a larger colour buffer than
> you are going to have physical display pixels :)


Uhm...

[example cut]



Did I miss you point?

The point is that people *almost always* call glViewport when they get a window resize event. That gives the driver a chance to ask the system what the window size is.


Aiiee.. I already said I don't know what the window size is at all. There
is no point where Mesa CAN be told what the window size is. It never talks
to find out either. Back to Square One!

Read the X11 driver. From get_buffer_size(), simplified for email:




/*
 * Return the size (width, height) of the X window for the given
 * GLframebuffer.
 * Output:  width - width of buffer in pixels.
 *          height - height of buffer in pixels.
 */
static void
get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
{
   /* We can do this cast because the first field in the XMesaBuffer
    * struct is a GLframebuffer struct.  If this weren't true, we'd
    * need a pointer from the GLframebuffer to the XMesaBuffer.
    */
   const XMesaBuffer xmBuffer = (XMesaBuffer) buffer;
   unsigned int winwidth, winheight;

   Window root;
   int winx, winy;
   unsigned int bw, d;

   XGetGeometry( xmBuffer->xm_visual->display, xmBuffer->frontbuffer, &root,
                 &winx, &winy, &winwidth, &winheight, &bw, &d );


*width = winwidth; *height = winheight; }



Can you see what this function does? This is GetBufferSize for the X11 driver. You'll have to do something similar for yours.



If the size is different than the last time, it can resize its internal
buffers.  It doesn't just use the values supplied by glViewport.


So what values DOES it use?

The ones you tell it when it asks you by calling the 'GetBufferSize' callback. That callback is there because mesa doesn't know and isn't able to tell the buffer size.




Keith



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to