Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to share lists between two contexts on Mac OS but despite my research I couldn't come up with an answer so far. I've found that NSOpenGLContext was able to initialize a context with a shared context but not to set it afterward.

What's the equivalent of wglShareLists on Mac OS?

share|improve this question
add comment

1 Answer

Here is Apple's documentation on the subject.

Essentially, you can either create an NSOpenGLContext (and in doing so, specify the original context you want to share using initWithFormat:shareContext: or use CGGLCreateContext's share parameter. I don't believe it is possible to share resources after initialization.

This will allow you to create a second context that shares all resources with the first context (the one you passed to one of the above functions). You have to make sure both contexts utilize the same GL profile.

There isn't a way to construct an NSOpenGLView (which you are probably using) with a shared context. Instead you'll probably have to swap the existing context out, or use that context as the main one from which you create the shared context.

share|improve this answer
    
I'm only working on the OpenGL layer and I do not use any NSOpenGLView. I really must initiate this share context after creating it since both contexts aren't created by myself. Seems like I'll have no choice but to re-create this texture by myself although it's not very good performance speaking. –  user14170 Jun 28 '13 at 15:28
    
I looked around, and all Apple's documentation I could find discusses sharing only at initialization time. –  Josh Petrie Jun 28 '13 at 15:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.