Render Text using Juce in native OpenGLContext


#1

We have an offscreen OpenGL context (not a Juce one) which i would like use to render text using Juce.
We want this because i would like to use Juce to render text, i'm not a fan of FreeType and because Juce can render text using OpenGL it makes sense to do it this way. We'll be rendering the text to a Texture using a Frame buffer.


Can i create an OpenGL LowLevelGraphicsContext using a handle to a native context in a way?

 


#2

Btw, the Rest of our UI is using Juce as well of course :-)


#3

Sorry, I don't quite understand what you're asking?

You can either draw to a component using the GL renderer (like in the demo app). Or you can create an image using OpenGLImageType, and then use a normal Graphics to draw to it using GL.


#4

If you want to create an Image with type 'OpenGLImageType ' i would need to create it through an OpenGLFrameBufferImage first right?
This OpenGLFrameBufferImage needs to be constructed with an OpenGLContext, but if i don't have an  Juce OpenGLContext can i use my own native context (for example NSOpenglContext) ?
So what i in fact need is to let Juce render in my own Opengl contex which hasn't been created with Juce, is this possible?
 

 


#5

Bit tricky, as internally everything relies on the juce OpenGLContext class. Nearest function we have would be createOpenGLGraphicsContext()


#6

 

Bit tricky, as internally everything relies on the juce OpenGLContext class. Nearest function we have would be createOpenGLGraphicsContext()

Hmm.... but all the createOpenGLGraphicsContext methods need a valid OpenGLContext object. Pity would have been nice to use Juce rendering directly in my own OpenGL context.

p.s by the way your last post about this 'silenceInProducesSilenceOut() ' was probably not meant for me ;-)