zoukankan      html  css  js  c++  java
  • OpenGL + VS2015 + Windows10配置

    官网下载OpenGL:https://www.opengl.org/resources/libraries/glut/

    解压后得到5个文件:glut.h,glut.dll,glut32.dll,glut.lib,glut32.lib。

    打开VS2015安装目录,在【VC/include/】下新建一个文件夹,名为GL,把gl.h文件复制其中;

    找到【VC/lib】,把glut.lib,glut32.lib复制其中;

    复制glut.dll和glut32.dll到系统的dll目录下:C:Windowssystem32文件夹内(32位系统)或‪C:WindowsSysWOW64(64位系统)。

    配置完成,接下来程序测试。

    #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("第一个OpenGL程序");
        glutDisplayFunc(&myDisplay);
        glutMainLoop();
        return 0;
    }

    运行如下:

  • 相关阅读:
    SonarQube
    Gerrit
    Jenkins
    Jenkins
    GitLab
    GitLab
    GitLab
    centos7配置国内yum源
    CentOS7 ping: unknown host www.baidu.com
    VirtualBox下安装CentOS7系统
  • 原文地址:https://www.cnblogs.com/MagicAsa/p/9243534.html
Copyright © 2011-2022 走看看