0
votes

I'm using vertex and fragment shaders, GLSL version 130. Ubuntu 12.04 LTS. The shaders work OK. Lighting is disabled.

Text is drawn OK by glutBitmapCharacter(), but in an unpredictable color. When I tweak the palette used by the shaders and recompile, the color changes.

glColor4f() has no effect of course, as the shaders override fixed pipeline behavior. So how can I set the "raster color" that glutBitmapCharacter() will render in? (Or should each frame use shaders and then fixed pipeline? Yuck.)

1

1 Answers

1
votes

Please speak with me: I will not mix OpenGL raster operations with the programmable pipeline. As you found out the result are quite, err, annoying.

Also raster operations have been removed entirely from modern OpenGL (i.e. everything above, including OpenGL-3.0). Trying to use them together with shaders is pure masochism. And it even hurts to watch other people trying to do it. So please don't.

Or should each frame use shaders and then fixed pipeline?

You can switch between fixed function and shaders at any time. Use glUseProgram(0) to switch to fixed function when you need it. Which would be when using raster operations. But you're of course limited to OpenGL-2.1 when using raster ops.