Sharing textures in AGL contexts?

Oldtimer
Posts: 834
Joined: 2002.09
Post: #1
Is there any way to share textures and display lists over two AGL contexts? (I'm trying to let the player switch from fullscreen to window mode on-the-fly)

I remember hearing something about this a long time ago... :/
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Yep. When you create a context, there's an extra parameter to pass a "share context". The new context will share the textures, lists, vertex programs, VAOs, &c with the old one, so any object created in either will be available in the other.

The two contexts have to have compatible pixel formats. That means same renderer (probably have to restrict to a single screen), same bit depth, probably both need "no recovery" in the pixel format, &c.
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #3
Interesting, I'll delve into it tomorrow. By the way, do you have any idea about the size of your brain? Grin
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #4
Be careful with this feature, I kernel panic if I try to shift a GL namespace from my AGP R7500 to a PCI card (Rage 128 for sure, haven't tried it with the Radeon).
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
It will never work across different accelerator cards, and could not be expected to.

It's bad that it panics, though. Have you submitted a bug to Apple?
Quote this message in a reply
Member
Posts: 177
Joined: 2002.08
Post: #6
I don't think that note about different accelerator cards is in the docs.

Don't you need a high-level (i.e. costly) ADC account to send Apple bugs?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
Nope. Online is fine. Sign up for free at http://connect.apple.com/ (you have to be 18 or over).

Just go to http://bugreporter.apple.com/ to submit bugs.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #8
Quote:Originally posted by Mark Levin
I don't think that note about different accelerator cards is in the docs.

The docs say that you need compatible pixel formats, and you can never get compatible pixel formats for different accelerator cards (even if they're the same make & model), so even if it's not explicitly there, it's there.
Quote this message in a reply
isgoed
Unregistered
 
Post: #9
Fenris Wrote:Is there any way to share textures and display lists over two AGL contexts? (I'm trying to let the player switch from fullscreen to window mode on-the-fly)

I remember hearing something about this a long time ago... :/

Hi Fenris,

I have made some code that can actually do this. It's working, but I am not quite pleased with it. I started a new thread to see if I could get some more feedback on the fullscreen/window problem. It is located at: http://www.idevgames.com/forum/showthrea...#post69509

BTW: OneSadCookie, thanks for the aglCreateContext tip. I did everything right except that part Smile
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  NSOpenGLContext sharing question TomorrowPlusX 4 4,458 Oct 19, 2006 09:33 AM
Last Post: akb825
  Sharing multiple contexts with NSGL maaaaark 1 1,976 Apr 27, 2006 05:10 PM
Last Post: akb825
  Context Sharing and Hardware Matrix 3 2,842 May 5, 2005 07:23 PM
Last Post: Matrix
  Sharing textures in SDL's OpenGL surfaces PowerMacX 4 4,253 Oct 11, 2004 01:34 PM
Last Post: OneSadCookie
  Sharing textures in AGL contexts? Part II isgoed 3 3,164 Oct 6, 2004 12:06 AM
Last Post: isgoed