libepoxy: epoxy/gl.h File Reference

libepoxy 1.4.1

Functions
gl.h File Reference

Provides an implementation of a GL dispatch layer using either global function pointers or a hidden vtable. More...

`#include "epoxy/common.h"`
`#include "epoxy/gl_generated.h"`

## Functions
bool | epoxy_has_gl_extension (const char *extension)
| Returns true if the given GL extension is supported in the current context. More...
bool | epoxy_is_desktop_gl (void)
| Checks whether we're using OpenGL or OpenGL ES. More...
int | epoxy_gl_version (void)
| Returns the version of OpenGL we are using. More...

## Detailed Description

Provides an implementation of a GL dispatch layer using either global function pointers or a hidden vtable.

You should include `<epoxy/gl.h>` instead of `<GL/gl.h>` and `<GL/glext.h>`.

## Function Documentation

## ◆ epoxy_gl_version()

int epoxy_gl_version | ( | void |  | ) |

Returns the version of OpenGL we are using.

The version is encoded as:

version = major * 10 + minor

So it can be easily used for version comparisons.

Returns
  The encoded version of OpenGL we are using

## ◆ epoxy_has_gl_extension()

bool epoxy_has_gl_extension | ( | const char * | ext | ) |

Returns true if the given GL extension is supported in the current context.

Parameters

  ext | The name of the GL extension

Returns
  `true` if the extension is available

Note
  that this function can't be called from within `glBegin()` and `glEnd()`.

See also
  epoxy_has_egl_extension()
  epoxy_has_glx_extension()

## ◆ epoxy_is_desktop_gl()

bool epoxy_is_desktop_gl | ( | void |  | ) |

Checks whether we're using OpenGL or OpenGL ES.

Returns
  `true` if we're using OpenGL