这是我在spacesimulator上下载的导入3ds文件的程序,但是我把程序作为一个单独的函数加入到我的工程后,就一直无法打开文件。
调用时的写法是:object.id_texture=LoadBitmap("spaceshiptexture.bmp");
并且在messagebox弹窗显示的也确实是spaceshiptexture.bmp,望高人指点迷津!
char Load3DS (obj_type_ptr p_object, const char *p_filename)
{
int i; //Index variable
/* handle file stream */
FILE *l_file; //File pointer
unsigned short l_chunk_id; //Chunk identifier
unsigned int l_chunk_lenght; //Chunk lenght
unsigned char l_char; //Char variable
unsigned short l_qty; //Number of elements in each chunk
unsigned short l_face_flags; //Flag that stores some face information
/* fopen() "rb" means open a binary files & only read it */
if ((l_file=fopen (p_filename, "rb"))== NULL)
{
MessageBox(NULL,"model open failed", "Zetadeck",MB_OK | MB_ICONERROR);
return 0; //Open the file
}
...
}
繁花如伊