LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Evil-Devil on December 28, 2005, 17:37:29

Title: Problem with shared context
Post by: Evil-Devil on December 28, 2005, 17:37:29
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
Title: Problem with shared context
Post by: darkprophet on December 29, 2005, 02:33:29
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
Title: Problem with shared context
Post by: elias on December 29, 2005, 22:07:44
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
Title: Problem with shared context
Post by: darkprophet on December 30, 2005, 01:39:04
Aha, doubly awsome!
Title: Problem with shared context
Post by: Evil-Devil on January 02, 2006, 17:10:03
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.