PDA

View Full Version : wglUseFontOutline and text color bug?



V-man
05-02-2002, 12:10 PM
I'm not sure if this is considered a bug or not, but when I do

glListBase(1000);
glColor4fv(&TextColor[4]);
glCallLists(strlen((char *)pstring), GL_UNSIGNED_BYTE, pstring);

in my rendering function, the text color doesn't come out right. I have to call this function one more time for the text color to appear OK. During the next refresh of the screen, the color is still not right and it must be called once again for the text color to come out right. Maybe that's because Im rendering other stuff too.

That was the result on the nvidia driver 23.11 (I will update later)

I tested in software mode and I think the effect was the same (not sure because I cant call the multitexture portion of my code)

Anyway, as a plus, I discovered that glScissor isnt perfect in software mode.

glScissor(value_a, value_b, ....);
is executed as
glScissor(value_a, value_b+1, ....);

in some cases.

Anybody can tell me what's up with my text color issue?

V-man

Relic
05-02-2002, 11:10 PM
Never seen.
I assume the font is using glBitmap?
When do you call glRasterPos? This picks up the current color used for the glBitmap.

(edit) Nah, just read the title again. Forget abouth the bitmap question. http://www.opengl.org/discussion_boards/ubb/smile.gif

Maybe it's lighting? FontOutlines don't contain normals so lighting will be wrong.
Well, glColor won't effect lighting unless color material is enabled anyway.

Or texturing?

Set plain simple flat shading without lighting, texturing, and other fancy stuff.

Out of ideas now...

[This message has been edited by Relic (edited 05-03-2002).]

V-man
05-03-2002, 11:38 AM
Originally posted by Relic:
(edit) Nah, just read the title again. Forget abouth the bitmap question. http://www.opengl.org/discussion_boards/ubb/smile.gif


[This message has been edited by Relic (edited 05-03-2002).]

Well, actually that seems to be it, since this function uses glBitmap.

glColor must be called before glRasterPos for it to pick up the color? Why is that?

Weird....

V-man

Bob
05-04-2002, 05:54 AM
The current raster position includes the color, and is only updated when you call glRasterPos. So changing the primary color won't change the color used by glBitmap, since the color in the raster position haven't been updated. So if you want to change the color used by glBitmap, you must call glRasterPos again.

For more info, read the spec.

V-man
05-04-2002, 08:24 AM
I just read it and that is correct.

I guess opengl keeps a separate memeory area for raster color.

A little unexpected for me, but ok, no problem! Any reason for doing things like this?

V-man