There is a trick in, I think, one of the Graphics Gems books: drawing an high-contrast overlay on any background by flipping the most significant bit of each colour component of the current frame buffer colour. (Yes, it could be done in OpenGL.1.0/2.0 without shaders.) Increasing or decreasing each colour component by half the maximum value provides more than enough contrast with adjacent unaltered pixels.
This technique might look bad with unpleasant frontiers between high and low values (slightly noisy backgrounds with components around half amplitude explode into spotted patterns) or simply because the overlay echoes the same texture as the background.
If you can afford to prepare graphics more carefully you might simply draw something normally, fully opaque, with a double outline: one dark and one light. The contrasting outlines can't both be confused with the background, and they form a high-contrast edge between them. A double outline can often be simplified to a dark outline with a light fill or vice versa, particularly in the case of text in solid colours.