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

**URL:** <https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048>\
**Category:** General JUCE discussion\
**Created:** [September 5, 2017, 2:16am UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048 "2017-09-05T02:16:49Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bschiett](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bschiett](https://forum.juce.com/u/bschiett)\
**Post date:** [September 5, 2017, 2:16am UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/1 "2017-09-05T02:16:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 5, 2017, 8:16am UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/2 "2017-09-05T08:16:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bschiett](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bschiett](https://forum.juce.com/u/bschiett)\
**Post date:** [September 5, 2017, 2:27pm UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/3 "2017-09-05T14:27:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [September 5, 2017, 2:29pm UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/4 "2017-09-05T14:29:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gbevin](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/gbevin/32/258_2.png) [@gbevin](https://forum.juce.com/u/gbevin)\
**Post date:** [December 20, 2017, 7:48pm UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/5 "2017-12-20T19:48:40Z")

</div>

Hey Bert,

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

Thanks,

Geert

---

<div class="post-metadata">

**Author:** ![yfede](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yfede/32/506_2.png) [@yfede](https://forum.juce.com/u/yfede)\
**Post date:** [December 22, 2017, 11:43am UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/6 "2017-12-22T11:43:54Z")

</div>

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

> [@Headless plugin clients](https://forum.juce.com/t/headless-plugin-clients/25067):
>
> Hi all, I’m working on an embedded Linux project where a headless system can host VsT plugins. The host doesn’t use JUCE, but we had to support a plugin written with it. At the moment, it’s possible to build headless standalone Linux apps in JUCE, but X11 & friends are still a dependency for audio plugin clients. I experimented a little and it turned out that hacking the codebase to remove that dependency was much easier than I thought. Disclaimer: I’m not a JUCE expert at all, so any feedbac…

---

<div class="post-metadata">

**Author:** ![bschiett](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bschiett](https://forum.juce.com/u/bschiett)\
**Post date:** [December 24, 2017, 10:15am UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/7 "2017-12-24T10:15:53Z")

</div>

Hi Geert

Can you shoot me an email to discuss?

Thanks and happy holidays!  
B

---

<div class="post-metadata">

**Author:** ![johnplanetz](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/johnplanetz/32/2801_2.png) [@johnplanetz](https://forum.juce.com/u/johnplanetz)\
**Post date:** [January 25, 2018, 12:22am UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/8 "2018-01-25T00:22:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mlantia](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@mlantia](https://forum.juce.com/u/mlantia)\
**Post date:** [January 17, 2024, 7:17pm UTC](https://forum.juce.com/t/removing-x-dependency-and-just-use-opengles-framebuffer-graphics-on-linux/24048/9 "2024-01-17T19:17:01Z")

</div>

Hi

I’ve the similar request. Anything you can share or help with?

M
