我不会MFC希望最好能用glut库的做一个要求不多 希望能有2个窗口 每个显示的不一样
解决方案 »
- MDI里的非浮动的CControlBar怎么去掉标题栏和边框?
- 怎么用程序启动服务?
- 我的connect异步偶尔会弹出错误,请问不断的向服务器联接的程序应该 怎么写?
- 进度条问题??
- vc ado新增字段为汉字数据表为汉字出错,改成英文就正确了
- 如何在MFC多线程程序中安全的将一个对话框的指针传给另一个对话框?
- 100分求解一个宏定义
- vc++在簡體win98下編譯的xxx.rc在繁體win98下為什么打不開?如要打開,應怎樣修改?
- enter键消息重载 在win7 64位下面
- 求程序,请高手帮忙看看?给分!!!
- 为何控件变量的Value值会自动改变
- 一群用户评价多个多属性个体,数据应该采用怎样的格式存储?当加入新的数据时,怎样替换利用率低的信息?
glutCreateSubWindow
GLuint mainw, subw1, subw2, subw3;
void init(void)
{
glClearColor(0.0,0.0,0.0,0.0);
glutSetWindow(subw1);
glClearColor(1.0,0.0,0.0,0.0);
glutSetWindow(subw2);
glClearColor(0.0,1.0,0.0,0.0);
glutSetWindow(subw3);
glClearColor(0.0,0.0,1.0,0.0);
}
void mreshape(int width, int height)
{
}
void mdisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
void s1reshape(int width, int height)
{
}
void s1display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
void s2reshape(int width, int height)
{
}
void s2display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
void s3reshape(int width, int height)
{
}
void s3display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
}
int main(int argc, char** argv)
{
glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE);
glutInitWindowSize(700, 700);
glutInitWindowPosition(200, 200);
glutInit(&argc, argv);
mainw = glutCreateWindow("test");
glutReshapeFunc(mreshape);
glutDisplayFunc(mdisplay);
subw1 = glutCreateSubWindow(mainw,30,30,300,300);
glutReshapeFunc(s1reshape);
glutDisplayFunc(s1display);
subw2 = glutCreateSubWindow(mainw, 350,30,300,300);
glutReshapeFunc(s2reshape);
glutDisplayFunc(s2display);
subw3 = glutCreateSubWindow(mainw, 350,380,300,300);
glutReshapeFunc(s3reshape);
glutDisplayFunc(s3display); init(); glutMainLoop(); return 0;
}