# OpenGL (ES)

## Context Creation

After window creation, the created OpenGL context object needs to be made the current context by calling `glfwMakeContextCurrent(window)`. This binds the context object to the current thread. In situations where multithreading is required, a [shared context](https://app.gitbook.com/@desertcookie/s/glfw-in-a-nutshell/contexts/context-basics#context-sharing) has to bee created. The current context can be retrieved with `glfwGetCurrentContext`, which returns the window containing the [context object](https://app.gitbook.com/@desertcookie/s/glfw-in-a-nutshell/contexts/context-basics#context-objects).\
The first step of working with OpenGL would now be to create the OpenGL capabilities by calling `glCreateCapabilities`.

## Extensions

TODO (see [here](https://glfw.org/docs/latest/context_guide.html#context_glext) for now)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://desertcookie.gitbook.io/glfw-in-a-nutshell/contexts/opengl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
