PDA

View Full Version : Multiple AGL context's on one window


LongJumper
2005.04.27, 02:43 PM
I want to set up two seperate AGLContext's on the same window. I'm not finding any kind of help on apple's website, mostly because I can't find anything on AGL, only CGL, which says it only supports full screen.

Is this possible? And is there a link for all this AGL crap, I dont' even know where I got it in the first place.

LongJumper
2005.04.27, 04:16 PM
This isn't working, but it may be a step in the right direction. I'm setting up my aglcontexts as offscreen to two different gworlds, which are then put on the window by CopyBits. I know that opengl and GWorldPtr's have inverted y coordinates with respect to eachother, but I don't think that is causing the massive distortion I'm seeing it right now. It's also running really really slow. There has got to be a better way of doing this. For the love of god, suggest something :)

ThemsAllTook
2005.04.27, 06:04 PM
Take a look at agl.h. I believe changing AGL_BUFFER_RECT allows you to specify the portion of the window into which you want your AGL context to draw. I haven't actually done it myself, though, and I remember hearing there's more to it than that, but hopefully that'll at least get you started.

Definitely don't use GWorlds and CopyBits. Last I heard, that won't even give you hardware acceleration.

- Alex Diener

LongJumper
2005.04.27, 11:55 PM
Thanks. That's definetly a better way to go, and I have it working except for one some problem: The buffer rect will distort it. I actually think it's just clipping it with that rect, so I need to figure out how to "unclip" it... if there's such a way, what is it?

OneSadCookie
2005.04.28, 12:06 AM
glViewport?

LongJumper
2005.04.28, 12:18 AM
Yeah, I was just in the midst of figuring that out when I read this. I got that fuzzy feeling, you know, the one when you see "by OneSadCookie" under your thread name.

Is there documentation on AGL I can find, similar to the Apple docs that have a "somelibrary Concepts" and "somelibrary Tasks"?

PowerMacX
2005.04.28, 03:08 AM
How about scissor testing?