# Direct3D 9/11 support for GLFW 3

**URL:** <https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247>\
**Category:** support\
**Created:** [February 21, 2012, 8:51am UTC](https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247 "2012-02-21T08:51:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [February 21, 2012, 8:51am UTC](https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247/1 "2012-02-21T08:51:24Z")

</div>

**[expandable](https://sourceforge.net/u/expandable/)** wrote on [Tuesday, February 21, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b8bc75d6/#45b7):

Hello everyone,

I am currently annoyed by the fact that there are no window frameworks such as  
GLFW that support both OpenGL and Direct3D (do you know of one?). I am  
therefore considering to add D3D9/11 support to GLFW. Would anyone be  
interested in that? I’d be happy to contribute the changes back to the GLFW  
team so that they can include the D3D support in the official releases.

Of course, D3D support would be Windows-only. My idea is to provide new window  
hints to choose between D3D9 and D3D11 (+ features levels in the latter  
case). On non-Windows OSes, specifying such a window hint would either  
generate an error or just get ignored. We would also need a new function  
(only available in Windows builds) that would return some D3D-objects  
(device, swap chain, …)

Let me know what you think!  
Axel

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [February 23, 2012, 12:58am UTC](https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247/2 "2012-02-23T00:58:26Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, February 23, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b8bc75d6/#0c4f):

Thank you for you offer.

The idea of GLFW is to provide a platform-independent API for OpenGL  
development. Adding support for Direct3D would make it neither platform-  
independent nor focused on OpenGL. As such, I believe this is a bad fit for  
GLFW.

However, please do use any part of GLFW you find useful for creating such a  
library.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [February 23, 2012, 1:38pm UTC](https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247/3 "2012-02-23T13:38:32Z")

</div>

**[marcel\_metz](https://sourceforge.net/u/marcel_metz/)** wrote on [Thursday, February 23, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b8bc75d6/#77a9):

Hello Axel,

I would like to point out that there is a library called DXUT that is part of  
the DirectX SDK and provides similar capabilities like GLFW or GLUT. Maybe  
this is a better fit for your requirements than adding a complete different  
rendering API to GLFW.

regards

Marcel

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [February 24, 2012, 8:44am UTC](https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247/4 "2012-02-24T08:44:45Z")

</div>

**[expandable](https://sourceforge.net/u/expandable/)** wrote on [Friday, February 24, 2012](https://sourceforge.net/p/glfw/discussion/247562/thread/b8bc75d6/#6ed3):

Thank you for your feedback.

I understand GLFW’s focus on OpenGL and platform-independence and while adding  
D3D support wouldn’t make it less cross-platform in general, it would add some  
Windows-only functionality. I am aware of DXUT, and as a matter of fact, I’ve  
been using it for quite some time, but the problem is that there is no  
consistent APIs for both libraries (i.e., input handling is different and so  
on).

Anyway, based on your feedback I’ll most likely write a small wrapper library  
around GLFW and DXUT. That should be fast do to and serve my needs perfectly.

Thanks for your great work on GLFW!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [June 26, 2013, 9:00pm UTC](https://discourse.glfw.org/t/direct3d-9-11-support-for-glfw-3/247/5 "2013-06-26T21:00:47Z")

</div>

**[sxtheone](https://sourceforge.net/u/sxtheone/)** wrote on [Wednesday, June 26, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/b8bc75d6/#6ed3/adfc):

Hi,

I’m searching exactly what you wanted to create! I want to use ORX game engine what uses GLFW and the publisher said that they REALLY prefer directX-based games… So, my question is that have you been succeeded in ‘merging’ the two APIs? I would be very much interested if you are willing to share your results.  
Thanks!
