急!!!!关于读取OpenGL纹理贴图的问题

随心舒风 2006-05-14 09:49:08
最近做毕业设计,遇到纹理贴图的问题,在网上找了一个处理函数,写了一个简单的测试程序,但老出错,帮忙呀!!!!!!!!!!!!
#include <iostream.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glaux.h>
#include <windows.h>
#include <stidio.h>
AUX_RGBImageRec *LoadBMP(char *Filename) // 载入位图
{
FILE *File=NULL; // 文件句柄

if (!Filename) // 确认文件名已初始化
{
return NULL; // 没有返回 NULL
}

File=fopen(Filename,"r"); // 检查文件是否存在

if (File) // 存在么?
{
fclose(File); // 关闭文件句柄
return auxDIBImageLoad(Filename); // 载入位图并返回一个指针
}
return NULL; // 载入失败返回 NULL
}
void main()
{
AUX_RGBImageRec *pBitmap = NULL;
char[80] strFileName;
cout<<"请输入文件名:";
cin>>strFileName;
if(!strFileName) return;
pBitmap = LoadBMP(strFileName);

}
执行后老出错,我在link里面也加了glaux.lib,错误信息是:
f:\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2144: syntax error : missing ';' before type 'void'
f:\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2501: 'WINGDIAPI' : missing storage-class or type specifiers
f:\microsoft visual studio\vc98\include\gl\gl.h(1152) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.

...全文
166 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
syy64 2006-05-15
  • 打赏
  • 举报
回复
头文件,或路径,或库不对。
huzhuo 2006-05-14
  • 打赏
  • 举报
回复
头文件都加<gl/gl.h><gl/glu.h><gl/glaux.h><afxtempl.h>
link里加opengl32.lib glu32.lib glaux.lib

19,469

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧