CLH blog AI CV Algorithm

OpenGL Tutorials

2017-06-09
CLH

OpenGL Open Graphics Library#


OpenGL 参考文档

OpenGL 教程


VS2010(Win7 32位系统)配置OpenGL方法:

  1. glut下载
  2. glut库配置:

  • glut.h ——————-> C:\Program Files(x86)\Microsoft SDKs\Windows\v7.0A\Include\gl
  • glut.dll,glut32.dll ——> C:\Windows\System32(x86) /C:\Windows\System64(x64)
  • glut.lib,glut32.lib —- -> ***Microsoft Visual Studio 10.0\VC\lib

  • 测试代码:

    #include <gl\glut.h>
    void myDisplay(void)
    {
    glClear(GL_COLOR_BUFFER_BIT);
    glRectf(-0.5f, -0.5f, 0.5f, 0.5f);
    glFlush();
    }
    int main(int argc, char *argv[])
    {
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);
    glutInitWindowPosition(100, 100);
    glutInitWindowSize(400, 400);
    glutCreateWindow(“Hello,OpenGL!”);
    glutDisplayFunc(&myDisplay);
    glutMainLoop();
    return 0;
    }

  • 结果:


上一篇 OpenCL Tutorials

下一篇 爬虫-Scrapy

Comments

Content