opengl小程序在vc下和codeblocks下运行的区别,求大神帮忙看看
codeblocks吧
全部回复
仅看楼主
level 1
tarenaalong 楼主
代码如下:
#include <windows.h>
#include <gl/gl.h>
#include <gl/glaux.h>
#include <math.h>
const GLdouble Pi = 3.1415926536;
void myDisplay(void)
{
int i;
for(i = 0; i < 8; ++i)
auxSetOneColor(i, (float)(i & 0x04), (float)(i & 0x02), (float)(i & 0x01));
glShadeModel(GL_FLAT);
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLE_FAN);
glVertex2f(0.0f, 0.0f);
for(i = 0; i < 8; ++i)
{
glIndexi(i);
glVertex2f(cos(i * Pi/4), sin(i * Pi/4));
}
glEnd();
glFlush();
}
int main(void)
{
auxInitDisplayMode(AUX_SINGLE | AUX_INDEX);
auxInitPosition(0, 0, 400, 400);
auxInitWindow("OpenGl");
myDisplay();
Sleep(10 * 1000);
return 0;
}
在codeblocks中编译没问题,但是运行的时候弹出如下对话框
在vc6下的运行结果如下图:
哪位大神能指点迷津
2014年06月12日 08点06分 1
level 9
2014年06月12日 08点06分 2
你把代码贴到你的codeblock工具下,能运行出来效果吗? 这个网站上的东西我之前已经配置过了,跟这个没啥关系呀。
2014年06月12日 08点06分
level 9
你把那些 dll 文件扔到编译后的执行文件目录里试试看?
2014年06月12日 09点06分 3
还是没有用。你那可以运行出来结果吗?
2014年06月12日 11点06分
level 9
sorry,我现在的机器正在使用,不是很适合倒腾。
2014年06月12日 13点06分 4
没事,还是谢谢你。等着慢慢解决,在网上看到过一个说可能是glaux.dll太旧啦。但是在vc下能正常用,郁闷啦
2014年06月13日 06点06分
1