Problem with shared context

Started by Evil-Devil, December 28, 2005, 17:37:29

Previous topic - Next topic

Evil-Devil

In my editor i have 4 AWTGLCanvas implemented. Everything is displayed propably, except of the textures. Only in the first context the textures are shown. THe other 3 does not have textures on the modeldata etc.

How is this be and how can I solve this?

Evil

darkprophet

creating 4 awtcontext's creates 4 OpenGL contexts (PBuffer contexts) and texture data isn't shared across contexts.

Thats the source of your problems, as to how you go about sharing the data without buffering the same texture 4 times and juggling 4 different texture ID's, i dont know.

DP

elias

Quote from: "darkprophet"creating 4 awtcontext's creates 4 OpenGL contexts (PBuffer contexts) and texture data isn't shared across contexts.

Thats the source of your problems, as to how you go about sharing the data without buffering the same texture 4 times and juggling 4 different texture ID's, i dont know.

DP

Not quite. The AWTGLCanvas contexts are not Pbuffer contexts, and they render directly to the canvas. Secondly, texture data is not shared by default, but you can enable sharing with the

AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable)


constructor. Create the first canvas as usual and pass it in as the drawable for the three other canvases.

- elias

darkprophet


Evil-Devil

Quote from: "elias"
Not quite. The AWTGLCanvas contexts are not Pbuffer contexts, and they render directly to the canvas. Secondly, texture data is not shared by default, but you can enable sharing with the

AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable)


constructor. Create the first canvas as usual and pass it in as the drawable for the three other canvases.

- elias
Yea, because of that AWTGLCanvas behavior i wrote that they are shared.
@Drawable canvas: I will try it and add an implentation to my canvas class too :) I will post a pic from the working one.