<p>The "all" extensions option means exactly what it says: all extensions. If it exists, then its in the generated header. But this doesn't mean that the code will fail to execute on an implementation that doesn't provide every extension. The extensions you select are merely what the generated files make available to you.</p>

<p>But of course, the whole point of selecting specific extensions is that you don't have stuff you don't use cluttering up your header. If you're going to select everything, you may as well be using GLEW.</p>

CC BY-SA 3.0
2017-11-09T09:04:13.073Z
So, the only reason not to include all extensions, is that you have a smaller header file generated from glad?
Startec
CC BY-SA 3.0
2017-11-09T14:25:06.013Z
@Startec: It's not *just* a smaller header. It means that you can't *accidentally* use extensions that you don't want to. It also means that you get better IntelliSense, since you're only going to see functions and enums that you want to be able to use.
Nicol Bolas
CC BY-SA 3.0
2017-07-19T14:58:01.647Z
2017-07-19T14:58:01.647Z
Nicol Bolas
<p>In this <a href="https://github.com/Dav1dde/glad/issues/97" rel="nofollow noreferrer">github issue</a> the GLAD author offers the following way to correctly check if there is an extension is available at runtime:</p>

<blockquote>
  <p>The defines just allow you to check at compile time which extensions
  (and opengl versions) are potentially available. After
  loading/initilaizing glad you can check with GLAD_
  if the extension is available at runtime (= supported by the driver
  and loaded).</p>

<pre><code>// [initialize glad] // ...
if (!GLAD_GL_EXT_memory_object) {
    die("GL_EXT_memory_object not supported!"); 
}
</code></pre>
</blockquote>

CC BY-SA 4.0
2017-07-19T18:35:45.040Z
2018-11-07T04:30:57.190Z
2018-11-07T04:30:57.190Z
Startec
<p>When using the <a href="http://glad.dav1d.de/" rel="nofollow noreferrer">GLAD</a> web service, I am allowed to pick any version of OpenGL and any extensions I want.</p>

<p>If I pick the latest version of OpenGL and "all extensions", will the header file returned by the Web Service <code>#define</code> extensions on my machine that I do not actually have or does it just define those that exist?</p>

<p>In other words, if I include the <code>GL_ARB_SHADER_CLOCK</code> extension, on GLAD, does it get defined even if not available on the machine I use?</p>

<p>I don't see how it could be selectively defining extensions because the script is generated on a server ahead of time but I want to make sure that I am not trying to use unsupported extensions.</p>

<opengl>
How do I include all extensions my system supports using GLAD?
Startec
# How do I include all extensions my system supports using GLAD?

(Asked by: username_0 on 2017-07-18)

When using the [GLAD](http://glad.dav1d.de/) web service, I am allowed to pick any version of OpenGL and any extensions I want.

If I pick the latest version of OpenGL and "all extensions", will the header file returned by the Web Service `#define` extensions on my machine that I do not actually have or does it just define those that exist?

In other words, if I include the `GL_ARB_SHADER_CLOCK` extension, on GLAD, does it get defined even if not available on the machine I use?

I don't see how it could be selectively defining extensions because the script is generated on a server ahead of time but I want to make sure that I am not trying to use unsupported extensions.

**Tags:** opengl


---

## 2 answers

### Answer by username_0 on 2017-07-19. Score: 7 | Accepted answer

In this [github issue](https://github.com/Dav1dde/glad/issues/97) the GLAD author offers the following way to correctly check if there is an extension is available at runtime:

> The defines just allow you to check at compile time which extensions
> (and opengl versions) are potentially available. After
> loading/initilaizing glad you can check with GLAD\_
> if the extension is available at runtime (= supported by the driver
> and loaded).
>
> ```
> // [initialize glad] // ...
> if (!GLAD_GL_EXT_memory_object) {
>     die("GL_EXT_memory_object not supported!"); 
> }
>
> ```


---

### Answer by username_1 on 2017-07-19. Score: 1

The "all" extensions option means exactly what it says: all extensions. If it exists, then its in the generated header. But this doesn't mean that the code will fail to execute on an implementation that doesn't provide every extension. The extensions you select are merely what the generated files make available to you.

But of course, the whole point of selecting specific extensions is that you don't have stuff you don't use cluttering up your header. If you're going to select everything, you may as well be using GLEW.

> **Comments:**
> **username_0**: So, the only reason not to include all extensions, is that you have a smaller header file generated from glad?  
> **username_1**: @username_0: It's not *just* a smaller header. It means that you can't *accidentally* use extensions that you don't want to. It also means that you get better IntelliSense, since you're only going to see functions and enums that you want to be able to use.  

---

