Two Canvases - 1 vbo

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Two Canvases - 1 vbo

SwitchMan92
Hello,

I'm trying to get one openGL resource used by both canvases.

I looked throught context sharing demo in jogl repo that uses display lists, but the problem is that display lists seem to duplicate/copy resources.

Reply | Threaded
Open this post in threaded view
|

Re: Two Canvases - 1 vbo

gouessej
Administrator
Hi

What's your problem? Just use vertex buffer objects instead of display lists.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Two Canvases - 1 vbo

SwitchMan92

So the steps would be  :

load canvas1 with new context

load openGL dependent resources (textures, vbos...) in canvas1 GLEventListener initialize method.

load canvas2 with canvas1 context.

add new GLEventListener to canvas2  that has a different initialization code.

use resources in canvas2 GLEventListener from canvas1 GLEventListener since they should be binded to the canvas2 gl object from canvas1 GLEventListener initialization ?
Reply | Threaded
Open this post in threaded view
|

Re: Two Canvases - 1 vbo

gouessej
Administrator
Yes it should work.
Julien Gouesse | Personal blog | Website