Max and OpenGL: OpenGL Preview Window
Creating an OpenGL scene preview window is very easy to do with Max 6. You simply need to create two shared contexts (jit.window and jit.pwindow) and capture the contents of your scene to a texture with the jit.gl.node object. You can then display this captured texture on the preview window, and the main window using jit.gl.videoplane.
Download the Max patches used in this tutorial.
Below is a patch illustrating these steps. Make sure you set @shared 1
on your jit.window and jit.pwindow to enable texture sharing between these two contexts.
(see patch "OpenGLPreviewWindow_1.maxpat")
UI Objects
Using the UI objects with our scene preview, instead of the main window, requires some more work. Basically, we must know ahead of time what the size of our main window will be, and tell our jit.gl.node to render a texture at those dimensions (instead of the default dimensions of the main window). This will allow us to add our jit.gl.node to the preview context instead of the main context, but still output a texture at the proper resolution.
(see patch "OpenGLPreviewWindow_2.maxpat")
by Rob Ramirez on September 13, 2013