glDisable(GL_TEXTURE_2D);
}
-static double transparency;
-
-/* start rendering scene */
-void opengl_transparency_set(double _transparency)
+/* set color and opacity */
+void opengl_render_color(double r, double g, double b, double a)
{
- if (transparency)
- glDisable(GL_BLEND);
-
- transparency = _transparency;
-
- /* for debugging use transparent rendering */
- if (transparency) {
+ if (a < 1.0) {
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- }
-}
-
-void opengl_render_color(double r, double g, double b)
-{
- if (transparency)
- glColor4d(r, g, b, 1.0 - transparency);
- else
+ glColor4d(r, g, b, a);
+ } else {
+ glDisable(GL_BLEND);
glColor3d(r, g, b);
+ }
}
/* render polygon */