5

In OpenGL I implicitly create a graphics context with something like GLUT when I create a window. Suppose I drag my window into a monitor driven by a different video card (e.g. Intel embedded graphics on one and NVidia on another). Who renders the window? I.e. which device runs the graphics pipeline for each of the cases below.

The glGetString(GL_RENDERER) seems to always return the primary display (where the GLUT window was created) even if I drag the window fully into one window or the other. (I am guessing it all gets done by the primary...) Can someone help me understand this?

enter image description here

Note, using Windows 10, GLUT, OpenGL, but I ask the questions in general if it matters.

Tim
  • 2,708
  • 1
  • 18
  • 32
  • Are you talking about the general case where Nvidia's [Optimus](https://en.wikipedia.org/wiki/Nvidia_Optimus) is *not* in effect? – genpfault Aug 19 '17 at 02:03
  • Related [here](https://stackoverflow.com/questions/7540194/opengl-and-multiple-gpus-general-possibility) – Ripi2 Aug 19 '17 at 16:26

1 Answers1

0

GL knows nothing about windows, only about contexts. GL renders to the framebuffer in the current context.

You may code a way of asking the OS about where a window is, and use two context, and set as current the proper one depending on OS answer.

Ripi2
  • 7,031
  • 1
  • 17
  • 33
  • Yes, I assume each Window has a context or there is global one (GLUT). What confuses me is that each Window might have a different resolution etc... So somehow any graphics context must be able to draw on any of the monitors (devices). Is that right? – Tim Aug 19 '17 at 00:16
  • You create a context on a display device. Its driver manages presentation behind the scenes. – Robinson Aug 19 '17 at 02:30