Removing X dependency and just use OpenGLES/framebuffer graphics on linux

opengl

#1

Hi all

We’ve been using JUCE on our embedded ARM platform running linux and
it’s going well. One thing we still would like to do is get rid of the X server.

There are framebuffer drivers for the Mali GPU we have on board, so in
theory we could do 100% openGLES graphics without needing X.

What do we have to do in JUCE, to just use openGLES graphics, and get
rid of the X dependency? Is it just a matter of making all components
we are using use a GL context/renderer (basically attach one to every
component)? Or would the dependency still be there even in that case?

In short, we want to figure out how to remove the X dependency of the JUCE framework.

Thanks!
B


#2

Good question. It’s certainly easy enough to replace the window painting with GL. The bit that would be more fiddly would be to capture all the mouse and keyboard input, and make sure the message loop runs.

The way the underlying window system works is via the ComponentPeer class - as long as you create a subclass of ComponentPeer which wrapped a framebuffer instead of X, then using it would be pretty easy to wire into the system. There’d be a few other bits and pieces that might need to be tweaked or disabled, but that’s the general idea.


#3

Hi Jules

Thanks. We don’t need to capture keyboard or mouse input. We also don’t
need to draw menu bars or maximize/minimize buttons. Just one top level
component with child components is enough. So besides changing
ComponentPeer what else do we need to look at?
Thanks
B


#4

Oh, probably not much else for you to do then.

Note that you wouldn’t have to change ComponentPeer, you’d need to create your own subclass of it that draws to your display.


#5

Hey Bert,

Wondering if you made any progress on this? Is there any code you could share?

Thanks,

Geert


#6

For the part regarding the removal of dependency upon X, you can perhaps ger some hints from this:


#7

Hi Geert

Can you shoot me an email to discuss?

Thanks and happy holidays!
B


#8

Hi there- I’m also curious about running a Juce UI on arm/linux without requiring an X server.
Bert & Geert- do you have anything you can share?
Thanks,
John