# How to add a new backend?

**URL:** <https://discourse.glfw.org/t/how-to-add-a-new-backend/1878>\
**Category:** dev\
**Created:** [June 19, 2021, 5:01am UTC](https://discourse.glfw.org/t/how-to-add-a-new-backend/1878 "2021-06-19T05:01:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![onlytruethomas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/onlytruethomas/32/536_2.png) [@onlytruethomas](https://discourse.glfw.org/u/onlytruethomas)\
**Post date:** [June 19, 2021, 5:01am UTC](https://discourse.glfw.org/t/how-to-add-a-new-backend/1878/1 "2021-06-19T05:01:10Z")

</div>

Hi there. I’ve been thinking of adding a backend for the Haiku OS to see if I could get Minecraft to run; in theory this shouldn’t be that difficult. However, I can’t seem to find any official documentation for what should be in a backend or how to implement one. I had tried taking some inspiration from the X11 backend, which in theory should be the closest to the Haiku API. But there are so many data structures needed there that it isn’t clear to me what is strictly necessary. It also raises another question, how many functions of the GLFW API need to be implemented?

Any sort of insight into this would be much appreciated.  
Thank you.

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [June 19, 2021, 10:49am UTC](https://discourse.glfw.org/t/how-to-add-a-new-backend/1878/2 "2021-06-19T10:49:42Z")

</div>

Hi @onlytruethomas, welcome to the GLFW forums!

The null\_\* backend implementations might be a good place to start.

It looks like Haiku is supported by [EGL with Mesa 3D](https://docs.mesa3d.org/egl.html), so you might be able to use the egl\_context directly, or at least with only a little modification to add Haiku support if needed.

FYI There is an old issue requesting a Haiku backend which was closed as no one has taken this up:

> <https://github.com/glfw/glfw/issues/348>
>
> "Haiku is a new open-source operating system that specifically targets personal …computing. Inspired by the BeOS, Haiku is fast, simple to use, easy to learn and yet very powerful." says http://haiku-os.org
> 
> It has OpenGL support and Mesa drivers but applications can't use X11 or Wayland. There are other libraries ported to Haiku like SDL. So porting GLFW to Haiku using the Native Context creation (OpenGLKit) would be great for the OS.
