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: [Newbie] getting started questions...



On Tuesday, December 3, 2002, at 10:54 AM, Tom Davie wrote:

[SNIP]
Simply, what I need to do is to display an image on a flat polygon, and
some
text over the top (someone suggested I might want to try FLTK so I can use
fonts other than those specified in GLUT), and then adjust the alpha of
all
that to 0, while raising the alpha of another polygon and some text up to
full (so as you get a nice fade between the slides).

Quite simply, this is what Quartz Extreme is designed to do. Essentially
you want to display a background (be it OpenGL or not) and composite text
over the top of it. If you want someone here to tell you how to do the GL
to controll the stuff your talking about you're in for a long wait, but you
might go look at the NeHe (There's a google moment for you) tutorials
online. Using FLTK (whatever that is) or GLUT would be silly when you can
get QE to do the text compositing for you. A good example to look at is in
/Developer/Examples/OpenGL/CocoaGL/Composite (I can't remember the exact
path, but that's close enough to make it obvious)

You might also check out the UnderlaySurface example in the developer tools. In short, you configure your OpenGL view like this:

long negativeOne = -1;
[[self openGLContext] setValues:&negativeOne forParameter:NSOpenGLCPSurfaceOrder];
[[self window] setOpaque:NO];
[[self window] setAlphaValue:1.0]; // or maybe 0.999?

Then you can draw into the OpenGL view as if it were any NSView. The NSView drawing is laid over the OpenGL drawing. In an NSView, you draw text in the form of an NSAttributedString. If the text needs to be formatted into multiple lines, your view needs to override isFlipped to return YES, and you need to assemble a text system. See "Assembling the Text System by Hand" in the developer docs. If you want to see actual code, consult the SMKDrawingManager class in my SMea Kit: http://www.math.wisc.edu/~jdavis/software/smeakit/manual/index.html.

HTH,

Joshua Davis email@hidden http://www.math.wisc.edu/~jdavis/
_______________________________________________
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: 
 >Re: [Newbie] getting started questions... (From: "Tom Davie" <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.