glfwCreateWindow不返回null,但新窗口不会显示



我正在尝试使用xProjectorKinectV2Calibration来校准我的Kinect v2和投影仪。它是openFrameworks的附加组件,设置相对复杂。

无论如何,ofxProjectorKinectV2Calibration使用另一个插件ofxSecondWindow来创建第二个显示棋盘的窗口。我的问题是我根本看不到第二个窗口。它甚至没有显示在任务栏上。

以下是ofxSecondWindow中创建第二个窗口的代码:

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;
}

我确信widthheight是正确的,打开或关闭undecorated不会改变任何事情,glfwCreateWindow确实返回了一些不为null的句柄。

环境:Windows 10 64位,Visual Studio 2015 32位构建目标,投影仪(1024x768)为显示器1,PC屏幕为显示器2。openFrameworks 0.9.3版本,附加组件:

xOpenCv 的
  • ofxXmlSettings

  • ofxCv

  • xKinect2投影仪校准

  • ofxKinectV2

  • ofxSecondWindow

  • ofxUI

想法?

原来我必须在新创建的窗口上调用show(),或者在实现中调用glfwShowWindow

最新更新