Hi! I am very new to OpenGL but I need to draw some 3-dimensional looking lines so I’m learning. I have a child component that needs to draw some Axis ticks and some 3D junk over the parent. The problem is that I can’t seem to get the child to draw with a transparent background to just overlay it’s GL graphics on top of the parent’s graphics JUCE paint()-based graphics. With this code, I still get a black background on the child component
OpenGLHelpers::clear (Colour (Colours::black.withAlpha(0.0f)));
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
OpenGLHelpers::prepareFor2D (getContextWidth(), getContextHeight()); OpenGLHelpers::setPerspective (45.0, getContextWidth() / (double) getContextHeight(), 0.1, 100.0); glTranslatef (0.0f, 0.0f, -3.0f);
//…draw a bunch of junk
All I can think to do is set the Alpha of the “clear” colour in the first line of the renderer or try to find some OpenGL flag to allow for a transparent background. I am pretty new to all this so I hope I’m not overlooking something obvious. Thoughts oh-great-JUCE-community-of-geniusness?