首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >glfwCreateWindow不返回null,但新窗口不显示。

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

Stack Overflow用户
提问于 2016-05-31 08:00:45
回答 1查看 321关注 0票数 0

我正在尝试使用ofxProjectorKinectV2Calibration来校准我的Kinect v2和投影仪。这是对openFrameworks的一个附加,而且设置相对比较复杂。

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

下面是来自ofxSecondWindow的代码,用于创建第二个窗口:

代码语言:javascript
复制
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 2015 32位构建目标,投影仪(1024x768)显示1,PC屏幕显示2。openFrameworks版本0.9.3,插件:

  • ofxOpenCv
  • ofxXmlSettings
  • ofxCv
  • ofxKinect2ProjectorCalibration
  • ofxKinectV2
  • ofxSecondWindow
  • ofxUI

想法?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-31 08:28:41

结果,我不得不在新创建的窗口上调用show(),或者在实现中调用glfwShowWindow

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37540095

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档