unknown dib file format
来源:互联网 发布:淘宝男装店铺推荐日系 编辑:程序博客网 时间:2024/06/05 06:31
写了一个贴图的程序,程序运行后出现错误 :unknown dib file format
问题解决了,是DIB问题,我采用位图位数不统一,有8位,也有24位,把8位改为24位后又能贴
AUX_RGBImageRec *LoadBMP(char *Filename) // Loads A Bitmap Image{ FILE *File=NULL; // File Handle
if (!Filename) // Make Sure A Filename Was Given { return NULL; // If Not Return NULL }
File=fopen(Filename,"r"); // Check To See If The File Exists
if (File) // Does The File Exist? { fclose(File); // Close The Handle return auxDIBImageLoad(Filename); // Load The Bitmap And Return A Pointer }
return NULL; // If Load Failed Return NULL}
int LoadGLTextures() // Load Bitmaps And Convert To Textures{ int Status=FALSE; // Status Indicator
AUX_RGBImageRec *TextureImage[1]; // Create Storage Space For The Texture
memset(TextureImage,0,sizeof(void *)*1); // Set The Pointer To NULL
// Load The Bitmap, Check For Errors, If Bitmap's Not Found Quit if (TextureImage[0]=LoadBMP("Data/Ne.bmp")) { Status=TRUE; // Set The Status To TRUE
glGenTextures(1, &texture[0]); // Create The Texture
我把Nehe第六课的代码中的图片换成了自己的头像,然后出现了这个问题。
问了别人,才知道我直接把jpg的格式改为bmp格式就加载上去是好傻的事情。
应该使用画图板打开png或者jpg,然后另存为bmp(24位)。
来自于;http://blog.csdn.net/j123kaishichufa/article/details/7413102
- unknown dib file format
- 写了一个贴图的程序,程序运行后出现错误 :unknown dib file format
- NeHe's Opengl 06:纹理映射 initialization failed和Unknown DIB file format
- Win32 Series - The DIB File Format
- file format
- Writing a DIB to a JPEG file
- Write a DIB to a JPEG File
- DIB
- DIB
- DIB
- dib
- DIB
- openoffice使用总结001---版本匹配问题unknown document format for file: E:\apache-tomcat-8.5.23\webapps\ZcnsDms\
- unknown variable 'default-file
- 各种 file format
- avi file format(转载)
- PE file format LUEVELSMEYER
- all File Format
- WLAN AP模块WizFi630—无线联网利器!
- .net在repeater里面自定义格式
- 小游戏系列算法之三连连看算法及原理
- hive reduce任务太多问题
- 武汉科技大学计算机学院菜鸟杯:The sum problem (杭电2058)
- unknown dib file format
- I/O模型
- 五款ASP.NET图表控件优缺分析(下):Nevron,XtraCharts和.netCHARTING
- php oci8.dll 插入数据到oracle数据库 php操作oracle数据库 亲测 ORA-00911 无效字符错误解决方法
- 使用DataList实现 加入购物车,编辑,删除,更新,取消功能。要求连一个产品表。
- android仿iphone滑动解锁
- linux下cp命令详解
- Complexity is The Enemy
- Nokia落寞身影下 三星成为全球最大手机厂商