From ba3a60523be2e4feeeee8256344a837723e8916f Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 6 Feb 2012 16:27:56 +0100 Subject: [PATCH] Added context state copying to sharing test. --- tests/sharing.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/sharing.c b/tests/sharing.c index 8be0e30b..02b852ef 100644 --- a/tests/sharing.c +++ b/tests/sharing.c @@ -92,8 +92,6 @@ static void draw_quad(GLuint texture) glBindTexture(GL_TEXTURE_2D, texture); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glColor3f(0.6f, 0.f, 0.6f); - glBegin(GL_QUADS); glTexCoord2f(0.f, 0.f); @@ -142,6 +140,11 @@ int main(int argc, char** argv) 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 glfwGetWindowPos(windows[0], &x, &y); glfwSetWindowPos(windows[1], x + WIDTH + 50, y);