Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Any way to get AGL_FULLSCREEN to work on a tiBook 800?



For full screen you should always specify the device (so GL knows what device to build the full screen context on). I suspect GL sees two hardware devices in your PB (hardware mirroring) thus it needs the screen device specifically called out.

The agl Docs say:

AGL_FULLSCREEN:
If present, only renderers that are capable of rendering to a full-screen
graphics device are considered. Furthermore, gdev and ndev must be set to
a valid gDevice, which will be the target device for rendering, when
AGL_FULLSCREEN is present. After receiving a valid pixel format, an
application can call aglSetFullScreen to switch resolutions and enable
full screen rendering. Note, in this mode buffer swaps are likely made on
hardware using page flipping.

So it is a reasonable side effect that it normally works but you should not count on it.

At 12:59 PM -0700 12/7/02, Alexander Repenning wrote:
thanks, this helped. I previously used aglChoosePixelFormat(NULL,
0, attrib) which turned out to be the problem. Once I switched to
aglChoosePixelFormat(&display, 1, attrib) things worked like a charm.

Still, the confusing bit is that aglChoosePixelFormat(NULL, 0,
attrib) worked on ALL the Macs I tested except my TiBook 800. Also,
AGL_reference does not shed much light on this:

"If gdev and ndev are set to NULL and zero, respectively,
aglChoosePixelFormat will return a pixel format that is supported by
all graphics devices on the system."

Since I was testing on a TiBook with no 2nd screen attached I assumed
I was dealing with a single device and that actually specifying
&display should not make a difference. Could it be that in OS X on a
TiBook (with mobility radeon) running in single screen mode
aglChoosePixelFormat(NULL, 0, attrib) still tries to account for two
devices?

Thank you for the feedback.

Alex

At 11:43 AM -0800 12/4/02, Geoff Stahl wrote:
Hmmm, the simple answer would be that AGL_FULLSREEN is spelled
wrong. Assuming that is a typing issue and not one in the code...
This pixel format/code works on my 800Mhz PB:

(you could be trying to does full screen without specify the display)

AGLContext SetupAGLFullScreen (GDHandle display, short * pDepth,
short * pWidth, short * pHeight)
{
GLint attrib[64];
AGLPixelFormat fmt;
AGLContext ctx;

short i = 0;
attrib [i++] = AGL_RGBA; // red green blue and alpha
attrib [i++] = AGL_DOUBLEBUFFER; // double buffered
attrib [i++] = AGL_FULLSCREEN;
attrib [i++] = AGL_PIXEL_SIZE;
attrib [i++] = *pDepth;
attrib [i++] = AGL_DEPTH_SIZE;
attrib [i++] = 32;
attrib [i++] = AGL_NONE;

fmt = aglChoosePixelFormat(&display, 1, attrib); // this may fail if
looking for accelerated across multiple monitors
if (NULL == fmt) {
// optional error reporting
// ReportError("Could not find valid pixel format");
// aglDebugStr ();
return NULL;
}

ctx = aglCreateContext (fmt, NULL); // Create an AGL context
aglDestroyPixelFormat(fmt); // pixel format is no longer needed
if (NULL == ctx) {
// optional error reporting
// ReportError ("Could not create context");
// aglDebugStr ();
return NULL;
}

#ifdef kDebug
aglEnable (ctx, AGL_FS_CAPTURE_SINGLE);
#endif

if (!aglSetFullScreen (ctx, *pWidth, *pHeight, 0, 0)) {
// optional error reporting
// ReportError ("SetFullScreen failed");
// aglDebugStr ();
return NULL;
}

if (!aglSetCurrentContext (ctx)) { // make the context the current context
// optional error reporting
// ReportError ("SetCurrentContext failed");
// aglDebugStr ();
aglSetDrawable (ctx, NULL); // turn off full screen
return NULL;
}

return ctx;
}

OS X (10.1.5 and 10.2.2):

Some full screen code that works happily on a 400 Mhz G4 tower with
AGP 2x Mac Edition Radeon (a 3rd party board) refuses to work on a
800 Mhz G4 tiBook (mobility radeon).

after:

fmt = aglChoosePixelFormat(NULL, 0, attrib);

where attrib =
{AGL_RGBA,
AGL_DOUBLEBUFER,
AGL_FULLSREEN,
AGL_DEPTH_SIZE, 32,
AGL_NONE}

I get and AGL error: AGL Error 10006: invalid display pixel format

I tried some of the obvious things such as different versions of OS
X, screen depths, sizes, ...

I am trying to follow the AGL_FULLSCREEN discussion. Seems that
things are pretty complex here. Is there anything specific about
800 Mhz tiBooks? If so, are there any workarounds for Carbon
programming without the need for sprockets etc? I am really puzzled
by the fact that full screen worked right away of a 3rd party video
board but not on off the shelve machine.

any pointers appreciated

--
Geoff Stahl
OpenGL Engineer
Apple


--
Dr. Alexander Repenning
President and CEO
AgentSheets. Inc.
6560 Gunpark Drive
Boulder, CO 80301
________________________________________________________________
mailto:email@hidden phone: (303) 530-1773
http://www.agentsheets.com/ fax: (303) 530-3018


--
Geoff Stahl
OpenGL Engineer
Apple
_______________________________________________
mac-opengl mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/mac-opengl
Do not post admin requests to the list. They will be ignored.

References: 
 >Any way to get AGL_FULLSCREEN to work on a tiBook 800? (From: Alexander Repenning <email@hidden>)
 >Re: Any way to get AGL_FULLSCREEN to work on a tiBook 800? (From: Geoff Stahl <email@hidden>)
 >Re: Any way to get AGL_FULLSCREEN to work on a tiBook 800? (From: Alexander Repenning <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.