Hello all,
I am using 2D & 3D graphics combined in my audio plugin by using OpenGLRenderer and Graphics components together. In my draw routine, I firstly draw my GL components, and then call this code block to draw 2D graphics (basically for drawing texts):
ScopedPointer<LowLevelGraphicsContext> glRenderer (createOpenGLGraphicsContext (openGLContext, getWidth(), getHeight()));
if(glRenderer)
{
Graphics g(glRenderer);
for(int i=0; i<drawables.size(); ++i)
{
drawables[i]->draw2D(g);
}
}
However, as expected, all the 2D graphics are drawn onto the GL components, which is undesirable, i.e. it fails when I try to mask some part of the canvas with a transparent colour so on and so forth, since this code block creates another gl context over my entire gl routine - if I did not misunderstand. So, my question is; is there a way to somehow blend or combine the two contexts in order to put the 2D graphics behind the 3D graphics? Otherwise, as I am using Graphics for almost only for drawing texts, I would also appreciate if anyone suggests a convenient way to draw Strings in OpenGL draw routine. I am not really familiar with how this LowLevelGraphicsContext structure works, sorry if it does not makes sense at all. Thank you.