GLFW in a Nutshell
  • About GLFW
  • Preparation
    • Project Setup
    • Library Setup
  • Windows
    • Window Basics
    • Properties
    • Actions
    • Creation Hints
    • Attributes
    • (Windowed) Fullscreen
    • Callbacks
    • Icons
  • Contexts
    • Context Basics
    • OpenGL (ES)
    • Vulkan
  • Input
    • Keyboard
    • Mouse
    • Joystick/Gamepad
    • Other
  • Monitors
    • Monitor Basics
    • Video Modes
    • Multiple Monitors
  • Appendix
    • Credits
    • Licensing
    • Glossary
Powered by GitBook
On this page
  • Context Objects
  • Creation Hints
  • Context Sharing

Was this helpful?

  1. Contexts

Context Basics

Basics you need to know about GLFW contexts

PreviousIconsNextOpenGL (ES)

Last updated 5 years ago

Was this helpful?

Context Objects

When working with OpenGL or OpenGL ES, a GLFW window object encapsulates an OpenGL or OpenGL ES context. This context object is created when a and is destroyed when a or GLFW is . More information about working with OpenGL and OpenGL ES context can be found .

Vulkan does not require such a context object. More information about working with Vulkan can be found .

Creation Hints

There are a couple of that affect context objects, for example the version or profile of OpenGL to use.

Context Sharing

An OpenGL (ES) context object can be shared between windows. This is useful when working with multithreading, as it makes the resources created in one context available to the context on a different thread. When , instead of using NULL, the last parameter share of glfwCreateWindow should be a pointer to the window, which's context you want the new window's context to be shared with. This means, to employ multithreading, a second window has to be created. This window can be made invisible by using the GLFW_VISIBLE .

window is created
window is destroyed
terminated
here
here
context-related window creation hints
creating a window
creation hint