MacMillan
MacMillan

Reputation: 593

glfwCreateWindow does not return null, yet new window does not show up

I'm trying to use ofxProjectorKinectV2Calibration to calibrate my Kinect v2 and projector. It's an add-on to openFrameworks, and the set-up is relatively complicated.

Anyway, ofxProjectorKinectV2Calibration uses another add-on, ofxSecondWindow, to create a second window to display a chessboard. My problem is I do not see this second window at all. It's not even shown on the taskbar.

Here is the code from ofxSecondWindow to create the second window:

void ofxSecondWindow::setup(const char *name, int xpos, int ypos, int width, int height, bool undecorated) {
    this->width = width;
    this->height = height;
    glfwWindowHint(GLFW_DECORATED, !undecorated);
    mainWindow = glfwGetCurrentContext();
    auxWindow = glfwCreateWindow(width, height, name, NULL, mainWindow);
    glfwSetWindowPos(auxWindow, xpos, ypos);

    /* enable alpha blending by default */
    glfwMakeContextCurrent(auxWindow);
    glEnable(GL_BLEND);
#ifndef TARGET_OPENGLES
    glBlendEquation(GL_FUNC_ADD);
#endif
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glfwMakeContextCurrent(mainWindow);

    hidden = false;
}

I am sure that width and height are correct, turning undecorated on or off does not change anything, and glfwCreateWindow does return some handle that is not null.

Environment: Windows 10 64-bit, Visual Studio 2015 32-bit build target, projector (1024x768) is display 1 and PC screen is display 2. openFrameworks version 0.9.3, add-ons:

Ideas?

Upvotes: 0

Views: 390

Answers (1)

MacMillan
MacMillan

Reputation: 593

Turns out I had to call show(), or in implementation, glfwShowWindow, on the newly created window.

Upvotes: 1

Related Questions