• VS2010下配置使用OpenGL的glut库


    我已在我机上测试成功,机装VS2010!

    在win7(windows7 ultimate SP1)下成功安装VS2010(Visual Studio 2010 ultimate x86)。

      下载glut:http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip

      (参见:http://www.opengl.org/resources/libraries/glut/glut_downloads.php)

      原文讲:If you want just the GLUT header file, the .LIB, and .DLL files all pre-compiled for Intel platforms, you can simply download the glutdlls37beta.zip file (149 kilobytes).

      这个zip文件中有5个文件:

    VS2010下配置使用OpenGL的glut库  

      分别把这5个文件放到如下文件夹中:

      glut.h ---> C:Program Files (x86)Microsoft SDKsWindowsv7.0AIncludegl

      glut.dll,glut32.dll ---> C:WindowsSysWOW64 (windows7 64位操作系统)

      ---> C:WindowsSystem32 (windows7 32位操作系统)

      glut.lib,glut32.lib ---> ...你安装的目录Microsoft Visual Studio 10.0VClib

      编写代码时,加入头文件#include <glglut.h>即可。

      配置完成。

      测试代码:

    #include <glglut.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;
    }
  • 相关阅读:
    css实现右侧三角
    css 应用 给头像添加标签
    css中伪选择器使用
    服务器上的项目不能对外发送请求
    视频只能播放一两帧,PDF文件60k以上加载失败的问题,静态访问也一样
    spring集成mybatis 打印sql语句
    新浪股票代码
    linux 设置mysql密码
    linux启动mysql服务报错
    配置eclipseJVM虚拟机内存大小
  • 原文地址:https://www.cnblogs.com/zCoderJoy/p/3506329.html
Copyright © 2020-2023  润新知