You don't need a separate context for this, you just need a framebuffer object rendering to a texture.
On a relatively modern video card, you should be able to create a 16k*16k texture and render it via framebuffer. On Tue, Sep 1, 2015 at 02:10, DavidA <david.antl...@gmail.com> wrote: > I'm developing a simple application that allows the user to edit an array > of "tiles" (think floor tiles), which are represented as a number of > sprites. The application opens a window and allows the user to move the > "tiles" around until they are happy with the design. The overall "floor" is > quite large, so the application may only show part of the floor at any one > time. > > What I'd like to do is, upon a request by the user, render the *entire* > "floor" to a file. > > I have a method using pyglet.image.get_buffer_manager().get_color_buffer() > for saving the framebuffer to a file, so that's working well. However what > I'd like to do is render the "floor" to a second GL context, of the full > floor size (which is large, say, 10,000 x 5,000 pixels). I have something > working using this: > > screen = > pyglet.window.get_platform().get_default_display().get_default_screen() > template = pyglet.gl.Config(double_buffer=True, sample_buffers=1, > samples=4) > config = self.screen.get_best_config(template) > context = self.config.create_context(None) > window = pyglet.window.Window(context=context, visible=False) > > This gives me a "window" that I can draw to and save, however it is > separate from my main application window, so it does not have the "tile" > graphic resources loaded. > > I'm open to suggestions for alternative ways to do this, but until then I > think what I want to do is somehow create a second context that shares GL > resources with my main window+context. However I don't understand how this > is handled, because it's not obvious to me how a particular context is > chosen as a drawing target. > > Is it feasible for one subclassed window class to have these two contexts, > and share resources between them? > > > > -- > You received this message because you are subscribed to the Google Groups > "pyglet-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pyglet-users+unsubscr...@googlegroups.com. > To post to this group, send email to pyglet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/pyglet-users. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscr...@googlegroups.com. To post to this group, send email to pyglet-users@googlegroups.com. Visit this group at http://groups.google.com/group/pyglet-users. For more options, visit https://groups.google.com/d/optout.