Use glScissor to define a rectangular area to draw to (you must also enable GL_SCISSOR_TEST).
On Tue, Nov 18, 2008 at 3:05 PM, Steve <[EMAIL PROTECTED]> wrote: > > I want to limit drawing to a rectangular area of the screen, so that > if you draw an oval or something halfway in it, only half of the oval > gets drawn. What is the easiest way to do this? > > > My current solution is something like this: > pyglet.gl.glViewport(x1,y1,x2,y2) > pyglet.gl.glMatrixMode(pyglet.gl.GL_PROJECTION) > pyglet.gl.glLoadIdentity() > pyglet.gl.glOrtho(0, x2, 0, y2, -1, 1) > pyglet.gl.glMatrixMode(pyglet.gl.GL_PROJECTION) > > It seems to work, except that it seems to be messing with other code > in a way that is difficult to explain. Also, I don't really know why > it works. Tips? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en -~----------~----~----~----~------~----~------~--~---
