Posted by James W. Walker on April 06, 2004 at 19:34:45:
Since I just checked in a change to GLDrawContext.c for the second
time in one day, I thought I should write some background on what
I've been up to.The problem I have been trying to solve is rendering large images
offscreen. The OpenGL software renderer on the Mac is limited to
2048 pixels in each dimension (as returned by glGet with
GL_MAX_VIEWPORT_DIMS). So I tried to tile the image into smaller
pieces, each picked out by a draw context pane and a corresponding
camera viewport rectangle. That wasn't working right, and I tracked
the problem down to gldrawcontext_mac_new. In the offscreen case,
AGL_BUFFER_RECT did nothing, and consequently it was not appropriate
to call glViewPort with the first two parameters being zero. OK,
that was the first fix I checked in, and it sufficed to tile an
offscreen image into small tiles in my tests.However, that fix did not actually solve my original problem; I still
got a black image beyond the 2048 limit. I guess that all of the
parameters of glViewport must be smaller than 2048, not just the
width and height. So I came up with a different approach, where I
set up aglSetOffScreen with just the part of the image selected by
the draw context pane, and then glViewport could go back to having
zero for the offset parameters.
--
James W. Walker, ScriptPerfection Enterprises, Inc.