当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: a     10   m b     20   w c     30   m c     30   m b     20   w d     40   m e     50   w 求表b: a     10   m b     20   w c     30   m d     40   m e     50   w ......
    摘要: 在应用xp风格以后,(编辑了xp.manifest,加入了.rc),我的toolbar(parent=coolbar)上的ttoolbutton却工作不正常。 当鼠标放上去的时候,toolbutton可以浮起来,但是当鼠标点击的时候,toolbutton从效果上却不能按,并且将toolbutton->style=tbscheck时,无法相应事件?why? help! ......


OpenGL入门问题

按红宝书上的例子打了一段程序,发现执行不正常:  
  #include   <windows.h>  
  #include   <GL/gl.h>  
  #include   <GL/glu.h>  
  #include   <GL/glaux.h>  
   
  void   CALLBACK   display(void)  
  {  
  glClear(GL_COLOR_BUFFER_BIT);  
  glColor3f(1.0,   1.0,   1.0);  
  glBegin(GL_POLYGON);  
  glVertex3f(0.25,   0.25,   0.00);  
  glVertex3f(0.75,   0.25,   0.00);  
  glVertex3f(0.75,   0.75,   0.00);  
  glVertex3f(0.25,   0.75,   0.00);  
  glEnd();  
  glFlush();  
  }  
   
  void   init(void)  
  {  
  glClearColor(0.0,   0.0,   0.0,   0.0);  
  glMatrixMode(GL_PROJECTION);  
  glLoadIdentity();  
  glOrtho(0.0,   1.0,   0.0,   1.0,   -1.0,   1.0);  
  }  
   
  int   main(void)  
  {  
  auxInitDisplayMode(AUX_SINGLE|AUX_RGB);  
  auxInitPosition(100.0,   100.0,   250.0,   250.0);  
  auxInitWindow("OpenGL");  
  init();  
  auxMainLoop(display);  
   
  return   0;  
  }  
  结果发现屏幕上什么都没画,但是如果把display函数中的内容般到main中,显示正常,为什么?谢谢  
 

NO.1   作者: maplexp

这个问题确实比较奇怪,看不出哪里有问题,但是加上对auxReshapeFunc的调用后,即使resize不做什么都可以正确绘制,把代码改成下面这样就可以了  
   
  我想这个问题不必深究,应该是和aux库有关的,而aux现在基本已经被glut取代了  
   
  #include   <windows.h>  
  #include   <GL/gl.h>  
  #include   <GL/glu.h>  
  #include   <GL/glaux.h>  
   
  void   CALLBACK   display(void)  
  {  
  glClear(GL_COLOR_BUFFER_BIT);  
  glColor3f(1.0,   1.0,   1.0);  
  glBegin(GL_POLYGON);  
  glVertex3f(0.25,   0.25,   0.00);  
  glVertex3f(0.75,   0.25,   0.00);  
  glVertex3f(0.75,   0.75,   0.00);  
  glVertex3f(0.25,   0.75,   0.00);  
  glEnd();  
  glFlush();  
  }  
   
  void   init(void)  
  {  
  glClearColor(0.0,   0.0,   0.0,   0.0);  
  glMatrixMode(GL_PROJECTION);  
  glLoadIdentity();  
  glOrtho(0.0,   1,   0.0,   1,   -1.0,   1.0);  
  }  
   
  void   CALLBACK   resize(   GLsizei   w,   GLsizei   h   )  
  {  
  }  
   
  int   main(void)  
  {  
  auxInitDisplayMode(AUX_SINGLE|AUX_RGB);  
  auxInitPosition(100.0,   100.0,   250.0,   250.0);  
  auxInitWindow("OpenGL");  
  init();  
  auxReshapeFunc(   resize   );  
  auxMainLoop(display);  
   
  return   0;  
  }


    摘要: acess只能创建一个连接吗,并发连接不支持?那我的连接池启不派不上用场? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE