   The Andre Lamoths...
  Hey, I having a problem. I''m reading andre lamoths book and got to loading the bitmap section. _lread and _lseek, etc. are obsolete. IS there any other way/tutorial anyone know that can show me a better and faster way of doing this? I''ve tried usiong the VC++ i/o stream way but havn''t gotten anywhere. Maybe you can''t do it that way? I''m so confused.... And I got Tricks of the 3D Game programmiugn Gurus. Should I continue readin Tricks of the windows game programming gurus(2nd edition)? Or can I go forward, I''m still on ch 7 of the 2nd edition. Thanks in advance for your time. I knmow you''ve got a milliolnn other things you''d probably rather be doing then listening to me ramble. So thanks again! 
  Using iostreams is the current way of handling files in C++, and it is certainly possible to use them for reading a bitmap file... There's an article here at Gamedev on it. You'll want to check out the binary i/o section, as a bitmap is binary data. The article doesn't mention it, but I believe the member function seekg() provides the functionality of _lseek, though the syntax may be different.I don't believe using iostreams would make it significantly faster at runtime. But it's better to learn the modern/current functions and libraries, to stay up to date...As to your other question, I'm not sure of what the remaining chapters of TOTWGPG cover... But essentially it's about 2d programming with the now discontinued DirectDraw library... I haven't read the other book, so I don't know what previous knowledge in C(++?) is assumed... You could check it out... see if you can follow what it says... Otherwise, TOTWGPG might make a good introduction to the C language... You can also check out Bruce Eckel's free online C++ books/KseroEdit: messed up a link   [edited by - Ksero on February 14, 2004 9:16:03 PM];  ok, thanks for your help. Just wondering though...wil this owrk with the way Andre Lamoth does his structures and so forth?For example he reads into the BITMAPINFOHEADER and BITMAPFILEHEADER like this:   typedef struct BITMAP_FILE_TAG   {   BITMAPFILEHEADER bitmapfileheader;  // this contains the bitmapfile header   BITMAPINFOHEADER bitmapinfoheader;  // this is all the info including the palette   PALETTEENTRYpalette[256]; // we will store the palette here   UCHAR  *buffer; // this is a pointer to the data   } BITMAP_FILE, *BITMAP_FILE_PTR;So then he reads into the structure like this:   int Load_Bitmap_File(BITMAP_FILE_PTR bitmap, char *filename){// this function opens a bitmap file and loads the data into bitmapint file_handle,  // the file handle    index;   // looping indexUCHAR   *temp_buffer = NULL; // used to convert 24 bit images to 16 bitOFSTRUCT file_data;// the file data information// open the file if it existsif ((file_handle = OpenFile(filename,&file_data,OF_READ))==-1)   return(0);// now load the bitmap file header_lread(file_handle, &bitmap->bitmapfileheader,sizeof(BITMAPFILEHEADER));// test if this is a bitmap fileif (bitmap->bitmapfileheader.bfType!=BITMAP_ID)   {   // close the file   _lclose(file_handle);   // return error   return(0);   } // end if// now we know this is a bitmap, so read in all the sections// first the bitmap infoheader// now load the bitmap file header_lread(file_handle, &bitmap->bitmapinfoheader,sizeof(BITMAPINFOHEADER));// now load the color palette if there is oneif (bitmap->bitmapinfoheader.biBitCount == 8)   {   _lread(file_handle, &bitmap->palette,MAX_COLORS_PALETTE*sizeof(PALETTEENTRY));   // now set all the flags in the palette correctly and fix the reversed    // BGR RGBQUAD data format   for (index=0; index < MAX_COLORS_PALETTE; index++)  {  // reverse the red and green fields  int temp_color = bitmap->palette[index].peRed;  bitmap->palette[index].peRed  = bitmap->palette[index].peBlue;  bitmap->palette[index].peBlue = temp_color;    // always set the flags word to this  bitmap->palette[index].peFlags = PC_NOCOLLAPSE;  } // end for index    } // end if// finally the image data itself_lseek(file_handle,-(int)(bitmap->bitmapinfoheader.biSizeImage),SEEK_END);// now read in the image, if the image is 8 or 16 bit then simply read it// but if its 24 bit then read it into a temporary area and then convert// it to a 16 bit imageif (bitmap->bitmapinfoheader.biBitCount==8 || bitmap->bitmapinfoheader.biBitCount==16 ||bitmap->bitmapinfoheader.biBitCount==24)   {   // delete the last image if there was one   if (bitmap->buffer)  free(bitmap->buffer);   // allocate the memory for the image   if (!(bitmap->buffer = (UCHAR *)malloc(bitmap->bitmapinfoheader.biSizeImage))) { // close the file _lclose(file_handle); // return error return(0); } // end if   // now read it in   _lread(file_handle,bitmap->buffer,bitmap->bitmapinfoheader.biSizeImage);   } // end ifelse   {   // serious problem   return(0);   } // end else#if 0// write the file info out printf("\nfilename:%s \nsize=%d \nwidth=%d \nheight=%d \nbitsperpixel=%d \ncolors=%d \nimpcolors=%d",   filename,   bitmap->bitmapinfoheader.biSizeImage,   bitmap->bitmapinfoheader.biWidth,   bitmap->bitmapinfoheader.biHeight,bitmap->bitmapinfoheader.biBitCount,   bitmap->bitmapinfoheader.biClrUsed,   bitmap->bitmapinfoheader.biClrImportant);#endif// close the file_lclose(file_handle);// flip the bitmapFlip_Bitmap(bitmap->buffer,   bitmap->bitmapinfoheader.biWidth*(bitmap->bitmapinfoheader.biBitCount/8),   bitmap->bitmapinfoheader.biHeight);// return successreturn(1);} // end Load_Bitmap_File So we''ll I be able to do the same thing woth that example? Thanks again! ;  Nvm, I realize what you''re saying now, sorry to ask again. Thanks! 