我正在尝试编译和运行这个 c++ 代码
#include <GL/glut.h>
void displayMe(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.5, 0.0, 0.0);
glVertex3f(0.5, 0.5, 0.0);
glVertex3f(0.0, 0.5, 0.0);
glEnd();
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutInitWindowSize(300, 300);
glutInitWindowPosition(100, 100);
glutCreateWindow("Hello world :D");
glutDisplayFunc(displayMe);
glutMainLoop();
return 0;
}
这是我在网上找到的“opengl's hello world”。我这样做是为了测试我大学的 NVIDIA Tegra X1,TX1 开发套件始终开启并连接到大学的网络。我通过 ssh 连接到 TX1(使用 -X 标志)。编译很顺利,但是当我尝试运行程序时,出现了这个错误:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 29
Current serial number in output stream: 30
我没有在网上找到任何东西,我不知道发生了什么。
PS:我首先通过 ssh(使用 -X)连接到我大学的网络,然后我执行另一个 ssh 连接到 TX1。