diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-12-19 13:45:00 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-12-19 13:45:00 -0700 |
commit | c664302c3e34a29b4bbb02fd3789dd3f7d92849c (patch) | |
tree | b691a49e42d79be672a6f699962327eb6fcba837 /src/mesa/pipe | |
parent | 1575763a6f57d1f13c707b709f188b0617c8955a (diff) |
Fix problem with initial viewport/scissor size.
If an app never called glViewport, the viewport size was always 0 by 0 pixels.
Now pass initial size to st_create_framebuffer() and initialize the viewport
and scissor bounds in st_make_current().
This could also be fixed by ensuring the gl_framebuffers passed to
_mesa_make_current() were initialized to the right size. But that involves
allocating the renderbuffers/pipe_surfaces earlier and that runs into some
other issues ATM.
Also remove obsolete createRenderbuffers param to st_create_framebuffer().
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r-- | src/mesa/pipe/xlib/xm_api.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/pipe/xlib/xm_api.c b/src/mesa/pipe/xlib/xm_api.c index 186a712b52..ebf4c21eaf 100644 --- a/src/mesa/pipe/xlib/xm_api.c +++ b/src/mesa/pipe/xlib/xm_api.c @@ -207,7 +207,7 @@ static GLboolean window_exists( XMesaDisplay *dpy, Window win ) } static Status -get_drawable_size( XMesaDisplay *dpy, Drawable d, GLuint *width, GLuint *height ) +get_drawable_size( XMesaDisplay *dpy, Drawable d, uint *width, uint *height ) { Window root; Status stat; @@ -323,6 +323,7 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, XMesaBuffer b; GLframebuffer *fb; enum pipe_format colorFormat, depthFormat, stencilFormat; + uint width, height; ASSERT(type == WINDOW || type == PIXMAP || type == PBUFFER); @@ -359,11 +360,14 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, } + get_drawable_size(vis->display, d, &width, &height); + /* * Create framebuffer, but we'll plug in our own renderbuffers below. */ - b->stfb = st_create_framebuffer(&vis->mesa_visual, GL_TRUE, + b->stfb = st_create_framebuffer(&vis->mesa_visual, colorFormat, depthFormat, stencilFormat, + width, height, (void *) b); fb = &b->stfb->Base; |