mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Added context state copying to sharing test.
This commit is contained in:
parent
f6dfaf50ad
commit
ba3a60523b
@ -92,8 +92,6 @@ static void draw_quad(GLuint texture)
|
|||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||||
|
|
||||||
glColor3f(0.6f, 0.f, 0.6f);
|
|
||||||
|
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
|
||||||
glTexCoord2f(0.f, 0.f);
|
glTexCoord2f(0.f, 0.f);
|
||||||
@ -142,6 +140,11 @@ int main(int argc, char** argv)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set drawing color for the first context and copy it to the second
|
||||||
|
glfwMakeContextCurrent(windows[0]);
|
||||||
|
glColor3f(0.6f, 0.f, 0.6f);
|
||||||
|
glfwCopyContext(windows[0], windows[1], GL_CURRENT_BIT);
|
||||||
|
|
||||||
// Put the second window to the right of the first one
|
// Put the second window to the right of the first one
|
||||||
glfwGetWindowPos(windows[0], &x, &y);
|
glfwGetWindowPos(windows[0], &x, &y);
|
||||||
glfwSetWindowPos(windows[1], x + WIDTH + 50, y);
|
glfwSetWindowPos(windows[1], x + WIDTH + 50, y);
|
||||||
|
Loading…
Reference in New Issue
Block a user