# How is it that the GLFW OpenGL ES example works on Windows? (I thought Windows didn't natively support OpenGL ES.)

**URL:** <https://discourse.glfw.org/t/how-is-it-that-the-glfw-opengl-es-example-works-on-windows-i-thought-windows-didnt-natively-support-opengl-es/2425>\
**Category:** support\
**Created:** [August 1, 2023, 3:46am UTC](https://discourse.glfw.org/t/how-is-it-that-the-glfw-opengl-es-example-works-on-windows-i-thought-windows-didnt-natively-support-opengl-es/2425 "2023-08-01T03:46:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennisferron](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dennisferron/32/799_2.png) [@dennisferron](https://discourse.glfw.org/u/dennisferron)\
**Post date:** [August 1, 2023, 3:46am UTC](https://discourse.glfw.org/t/how-is-it-that-the-glfw-opengl-es-example-works-on-windows-i-thought-windows-didnt-natively-support-opengl-es/2425/1 "2023-08-01T03:46:08Z")

</div>

I’m working on a game engine to support Emscripten, Windows desktop, and (possibly in the future) Android. I got some basics working using SDL, but I decided I want to use shaders instead and go straight to OpenGL. Since WebGL is modeled after OpenGL ES, I thought I’d program to the “ES” subset of the API even on desktop, and then I could be sure my shaders and API use would work for all platforms.

Unfortunately upon further research (and explaining why I couldn’t find one example that cross-compiles between Emscripten and desktop for using OpenGL with an SDL context), I discovered Windows never added native OpenGL ES support, and also I’d have to slightly change my shader code. I discovered the existence of the ANGLE project, but it seemed more heavyweight than I need.

So I was quite surprised when I compiled GLFW, and not only the native OpenGL example but also the OpenGL ES example both work on my Windows laptop. How is it that this is working, given that I read elsewhere that OpenGL ES doesn’t work on Windows?

Edit: by the way I’m using Msys2/MinGW64, gcc, and CMake. I downloaded the ANGLE source code, but I didn’t install it. I found online a reference to a mingw-w64-angleproject, but I can’t find that package (either installed or available) on my actual MSys2 install. So I’m confused whether GLFW is finding and using a copy of ANGLE I didn’t know I had, or if it doesn’t need ANGLE to support OpenGL ES on Windows, or if GLFW (or GLAD) is able to translate both the API and the GLSL to something else?

---

<div class="post-metadata">

**Author:** ![mmozeiko](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/mmozeiko/32/29_2.png) [@mmozeiko](https://discourse.glfw.org/u/mmozeiko)\
**Post date:** [August 1, 2023, 5:20am UTC](https://discourse.glfw.org/t/how-is-it-that-the-glfw-opengl-es-example-works-on-windows-i-thought-windows-didnt-natively-support-opengl-es/2425/2 "2023-08-01T05:20:20Z")

</div>

OpenGL context is created with WGL Windows API, and WGL has extension to create GLES capable context: [https://registry.khronos.org/OpenGL/extensions/EXT/WGL\_EXT\_create\_context\_es2\_profile.txt](https://registry.khronos.org/OpenGL/extensions/EXT/WGL_EXT_create_context_es2_profile.txt)

Whether your GPU supports it or not depends on your GPU driver, not all of them do. You can see list of drivers/GPU’s that support or not support here: [OpenGL Hardware Database by Sascha Willems](http://opengl.gpuinfo.org/listextensions.php) (search for extension name). SDL knows how to use this extension.

if this GL extension is not supported, you can use ANGLE - as I believe that will work on any D3D11 capable GPU/driver (or older version on D3D9). If you want to use ANGLE with `mingw-w64-angleproject` package in msys2, then you need to install it with pacman: `pacman -S mingw-w64-angleproject` Then run .exe from msys2 terminal (so mingw dll files are in PATH). Otherwise you can build ANGLE project yourself, or use build that somebody else did. For example, I have ANGLE builds available on my github: [https://github.com/mmozeiko/build-angle](https://github.com/mmozeiko/build-angle) (download .zip file from Releases).
