CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
山寨机中的战斗机! 程序优化工程师到底对IT界有没有贡献
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  C++ Builder >  基础类

borland c++ builderX 中如何设置OpenGL?

楼主topowu10301021()2005-03-01 00:34:00 在 C++ Builder / 基础类 提问

在下一编译就报告ERROR:"gl.h":   E2141   Declaration   syntax   error   at   line   1153  
   
  gl.h的那一行是WINGDIAPI   void   APIENTRY   glAccum   (GLenum   op,   GLfloat   value);  
   
  此后连续多行同样的错误。偶搞不懂的说,哪位大哥指点一下配置问题。  
   
  /*   gasket.c       */  
   
  /*   E.   Angel,   Interactive   Computer   Graphics   */  
  /*   A   Top-Down   Approach   with   OpenGL,   Third   Edition   */  
  /*   Addison-Wesley   Longman,   2003   */  
   
  /*   Two-Dimensional   Sierpinski   Gasket                     */  
  /*   Generated   Using   Randomly   Selected   Vertices   */  
  /*   And   Bisection                                                             */  
   
  #include   <GL/glut.h>  
   
  void   myinit(void)  
  {  
     
  /*   attributes   */  
   
              glClearColor(1.0,   1.0,   1.0,   1.0);   /*   white   background   */  
              glColor3f(1.0,   0.0,   0.0);   /*   draw   in   red   */  
   
  /*   set   up   viewing   */  
  /*   500   x   500   window   with   origin   lower   left   */  
   
              glMatrixMode(GL_PROJECTION);  
              glLoadIdentity();  
              gluOrtho2D(0.0,   500.0,   0.0,   500.0);  
              glMatrixMode(GL_MODELVIEW);  
  }  
   
  void   display(   void   )  
  {  
   
  /*   define   a   point   data   type   */  
   
          typedef   GLfloat   point2[2];            
   
          point2   vertices[3]={{0.0,0.0},{250.0,500.0},{500.0,0.0}};   /*   A   triangle   */  
   
          int   i,   j,   k;  
          int   rand();               /*   standard   random   number   generator   */  
          point2   p   ={75.0,50.0};     /*   An   arbitrary   initial   point   inside   traingle   */  
   
          glClear(GL_COLOR_BUFFER_BIT);     /*clear   the   window   */  
   
   
  /*   compute   and   plots   5000   new   points   */  
   
          for(   k=0;   k<5000;   k++)  
          {  
                    j=rand()%3;   /*   pick   a   vertex   at   random   */  
   
   
            /*   Compute   point   halfway   between   selected   vertex   and   old   point   */  
   
                    p[0]   =   (p[0]+vertices[j][0])/2.0;    
                    p[1]   =   (p[1]+vertices[j][1])/2.0;  
         
            /*   plot   new   point   */  
   
                      glBegin(GL_POINTS);  
                                glVertex2fv(p);    
                      glEnd();  
         
            }  
            glFlush();   /*   clear   buffers   */  
    }  
   
  void   main(int   argc,   char**   argv)  
  {  
   
  /*   Standard   GLUT   initialization   */  
   
          glutInit(&argc,argv);  
          glutInitDisplayMode   (GLUT_SINGLE   |   GLUT_RGB);   /*   default,   not   needed   */  
          glutInitWindowSize(500,500);   /*   500   x   500   pixel   window   */  
          glutInitWindowPosition(0,0);   /*   place   window   top   left   on   display   */  
          glutCreateWindow("Sierpinski   Gasket");   /*   window   title   */  
          glutDisplayFunc(display);   /*   display   callback   invoked   when   window   opened   */  
   
          myinit();   /*   set   attributes   */  
   
          glutMainLoop();   /*   enter   event   loop   */  
  }  
   
  问题点数:0、回复次数:1Top

1 楼lother(阿艺)回复于 2005-03-01 20:34:08 得分 0

在  
  #include   <GL/glut.h>  
  前  
  加入  
  #include   <gl.h>  
  #include   <glu.h>  
   
  说详细点  
  你的glut包是否有问题Top

相关问题

  • 有如流星般的Borland C++ BuilderX
  • Borland公司很久前推出了windows和linux双平台的C++Builder版本:C++BuilderX,有人用吗?
  • c++builderX的链接问题
  • 谁有C++BuilderX的keygen.exe啊
  • C++BuilderX的显示问题~
  • borland c/c++ 的图形库?
  • 寻求borland c++5.02
  • 寻找borland c++ 5.02
  • 关于Borland C++4.0.
  • 求borland c++ builder 5.0

关键词

  • gl
  • points
  • include

得分解答快速导航

  • 帖主:topowu10301021

相关链接

  • CSDN Blog
  • 技术文档
  • 代码下载
  • 第二书店
  • 读书频道

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo