From 65a66f5bc37383c00423c21baf8ba9d6771e0259 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 27 Nov 2004 22:47:59 +0000 Subject: Remove _mesa_ResizeBuffersMESA() call from _mesa_set_viewport(). Now, the driver's Viewport routine should call _mesa_ResizeBuffersMESA() if necessary. Cleaned up code related to GLframebuffer width/height initialization. Set initial viewport/scissor params in _mesa_make_current2(), instead of in the drivers' MakeCurrent functions. --- src/mesa/drivers/beos/GLView.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa/drivers/beos') diff --git a/src/mesa/drivers/beos/GLView.cpp b/src/mesa/drivers/beos/GLView.cpp index 43aa13e701..45473a8ef2 100644 --- a/src/mesa/drivers/beos/GLView.cpp +++ b/src/mesa/drivers/beos/GLView.cpp @@ -153,6 +153,7 @@ private: GLuint *height); static void Error(GLcontext *ctx); static const GLubyte * GetString(GLcontext *ctx, GLenum name); + static void Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); // Front-buffer functions static void WriteRGBASpanFront(const GLcontext *ctx, GLuint n, @@ -317,6 +318,7 @@ BGLView::BGLView(BRect rect, char *name, functions.ClearIndex = md->ClearIndex; functions.ClearColor = md->ClearColor; functions.Error = md->Error; + functions.Viewport = md->Viewport; // create core context GLcontext *ctx = _mesa_create_context(visual, NULL, &functions, md); @@ -1028,6 +1030,13 @@ void MesaDriver::GetBufferSize(GLframebuffer * framebuffer, GLuint *width, } +void MesaDriver::Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h) +{ + /* poll for window size change and realloc software Z/stencil/etc if needed */ + _mesa_ResizeBuffersMESA(); +} + + const GLubyte *MesaDriver::GetString(GLcontext *ctx, GLenum name) { switch (name) { -- cgit v1.2.3