AntTweakBar键输入和GLFW 3

时间:2016-11-21 04:01:54

标签: c++ user-interface opengl graphics 3d

AntTweakBar尽管不被支持"现在仍然广泛使用或至少但是,我无法接受GLFW 3.2键盘的输入。当我使用

创建一个简单的GUI面板和一个调整栏
TwBar *myBar;
myBar = TwNewBar("NameOfMyTweakBar");
double speed = .3;
TwAddVarRW(myBar, "speed", TW_TYPE_DOUBLE, &speed, "label='Rot Speed' min=0 max=2 step=0.01 keyIncr=s keyDecr=S help='Rotation speed (turns/second)' ");

然后尝试让它接受键输入它返回0.我已经尝试了char回调,但没有运气。这个图书馆是否已经过时了? 还有哪些类似的库可供选择?

void glfwKeyCallback(GLFWwindow *myWin, int key, int scancode, int action, int mods)
{
    cout << "TwEventKeyGLFW = " << TwEventKeyGLFW(key, action) << endl;
}

1 个答案:

答案 0 :(得分:0)

github上有GLFW3的工作版本,例如AntTweakBarGLFW3