2 render contexts, 1 window?


    Sep 16 2007 | 11:48 pm
    Here's a patch that shows a top and perspective view of a gridshape displayed in two separate jitter windows. You can click in the top view on the gridshape and move it around and it will correspondingly move in the perspective window. My question is: is there some way to display both render contexts in the same window, similar to Wes' patch in the thread below?
    I've found a few posts regarding displaying one render context in two windows, but haven't found anything on the opposite. Any advice would be great. Thanks.
    Here's the patch:

    • Sep 17 2007 | 1:07 am
      Not two contexts, but two viewports in one window, yes. You can use sketch and gluperspective, and glviewport to do this.
      glmatrixmode projection, glloadidentity, gluperspective whatever whatever., glviewport whatver whatever, then render your shiz.
      etc etc.
      search the list , I think I posted a patch with it working.
    • Sep 17 2007 | 3:34 am
      however opengl does allow two contexts to share one drawable(ie. window) so...
      i would also like to know if this is possible with jitter. i think probably not. seems like the it's setup to be 1 context per window.
      maybe with the increasingly popular lua?
    • Sep 17 2007 | 4:34 am
      Just posted to the wrong thread by mistake - was at least able to erase the message below. Sorry. Here it is in the right place:
      Ok, thanks Vade. I'm getting there with it. Sending the following to gl.sketch:
      reset, glenable scissor_test, glmatrixmode modelview, glviewport 0 0 200 200, glscissor 0 0 200 200, glloadidentity, glscale 1. 0.5 1., glrotate 0. 0. 0. 0., moveto 0 0 -5, glclear GL_COLOR_BUFFER_BIT, drawobject object 0, glviewport 200 0 200 200, glscissor 200 0 200 200, glloadidentity, glscale 1. 0.5 1., moveto 0 0 -5, glrotate 0. 0. 0. 0., glclear GL_COLOR_BUFFER_BIT, drawobject object2 0, glflush
      I still can't figure out how to change my camera location so that each viewport is looking at the object from a different angle. Any suggestions?
      Here's the patch (modified from elsewhere):
    • Sep 17 2007 | 4:47 am
      maybe this?
      reset, glenable scissor_test, glmatrixmode modelview, glviewport 0 0 200 200, glscissor 0 0 200 200, glloadidentity, glscale 1. 0.5 1., glrotate 0. 0. 0. 0., moveto 0 0 -5, glclear GL_COLOR_BUFFER_BIT, drawobject object 0, glviewport 200 0 200 200, glscissor 200 0 200 200, glloadidentity, glscale 1. 0.5 1., moveto 3 0 -3, glrotate 45. 0. 1. 0., glclear GL_COLOR_BUFFER_BIT, drawobject object 0, glflush
    • Sep 18 2007 | 2:55 am
      Yeah, I ended up doing something similar to that. Here it is, although if you compare it with the first patch I posted, you'll notice that the mouse control is not right yet. Haven't had time to fool around with it.