auxDIBImageLoad only for files on hdd?
hello,
i want to load a file into memory (to modify it) and then i want to use the command auxDIBImageLoad. but something goes wrong.
a error message comes up: "Failed to open DIB file BM6". (without copying into memory, everything works fine).
Here is the part of the code:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
ifstream file;
file.open(filename,ios_base::binary);
// to get the file size
file.seekg(0, ios_base::end);
ifstream::streamoff size = file.tellg();
file.seekg(0, ios_base::beg);
char *dat=(char*)malloc(size*sizeof(char));
int ganze=size/1024;
for (int i=0;i<ganze;i++)
file.read(dat+i*1024,1024);
if (size-ganze*1024>0)
file.read(dat+ganze*1024,size-ganze*1024);
file.close();
_AUX_RGBImageRec *Image;
// this doesnt work:
Image = auxDIBImageLoadA ( (const char*) dat );
Thanks for help.
smartbyte
i want to load a file into memory (to modify it) and then i want to use the command auxDIBImageLoad. but something goes wrong.
a error message comes up: "Failed to open DIB file BM6". (without copying into memory, everything works fine).
Here is the part of the code:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
ifstream file;
file.open(filename,ios_base::binary);
// to get the file size
file.seekg(0, ios_base::end);
ifstream::streamoff size = file.tellg();
file.seekg(0, ios_base::beg);
char *dat=(char*)malloc(size*sizeof(char));
int ganze=size/1024;
for (int i=0;i<ganze;i++)
file.read(dat+i*1024,1024);
if (size-ganze*1024>0)
file.read(dat+ganze*1024,size-ganze*1024);
file.close();
_AUX_RGBImageRec *Image;
// this doesnt work:
Image = auxDIBImageLoadA ( (const char*) dat );
Thanks for help.
smartbyte
This is a Macintosh programming forum. As such, you're unlikely to find an answer here. (It also has nothing to do with OpenGL or 3D).
I suggest the GameDev.net or Flipcode forums as better places to ask your question
I suggest the GameDev.net or Flipcode forums as better places to ask your question
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| OpenAL - Ogg files vs Caf files | Fred9000 | 8 | 11,774 |
Aug 23, 2011 08:01 PM Last Post: ipeku |
|

