OpenGL Preview Window

From Cycling '74 Wiki
Revision as of 21:05, 12 September 2013 by (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 object. You can then display this captured texture on the preview window, and the main window using

below is a patch illustrating these steps. make sure you set @shared 1 on your jit.pwindow and jit.window, to enable texture sharing between these two contexts.

-- Pasted Max Patch, click to expand. --


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 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 gl.node to the preview context instead of the main context, but still output a texture at the proper resolution.

-- Pasted Max Patch, click to expand. --