type declaration

Discussion in 'C++' started by Michael Sgier, Sep 14, 2005.

  1. Hello
    two questions here. What is declaring the line:
    BITMAPINFOHEADER texInfo; // BMP header
    then secondly in LoadBMPTexture the LoadBitmapFile function is called
    which returns an error: type specifier omitted for parameter
    `BITMAPINFOHEADER'
    Humm what kind of type is BITMAPINFOHEADER here :-/
    Well that's all new for me and haven't seen that before in VB.NET. So
    THANKS for your help.
    Regards Michael

    // // LoadBMPTexture()
    // // desc: loads a texture of the BMP format
    void CTexture::LoadBMPTexture(char *filename)
    {
    BITMAPINFOHEADER texInfo; // BMP header

    // store BMP data in texture
    data = LoadBitmapFile(filename, &texInfo);
    if (data == NULL)
    {
    free(data);
    }

    // store texture information
    width = texInfo.biWidth;
    height = texInfo.biHeight;
    palette = NULL;
    scaledHeight = 0;
    scaledWidth = 0;
    textureType = BMP;
    }

    // LoadBitmapFile
    // desc: Returns a pointer to the bitmap image of the bitmap specified
    // by filename. Also returns the bitmap header information.
    // No support for 8-bit bitmaps.
    unsigned char *CTexture::LoadBitmapFile(char *filename, BITMAPINFOHEADER
    *bitmapInfoHeader)
    // in the line above i get the error: error: type specifier omitted for
    parameter `BITMAPINFOHEADER'
    {
    FILE *filePtr; // the file pointer
    BITMAPFILEHEADER bitmapFileHeader; // bitmap file header
    unsigned char *bitmapImage; // bitmap image data
    int imageIdx = 0; // image index counter
    unsigned char tempRGB; // swap variable
    ....
     
    Michael Sgier, Sep 14, 2005
    #1
    1. Advertising

  2. Michael Sgier

    Howard Guest

    "Michael Sgier" <> wrote in message
    news:43287743$0$1152$...
    > Hello
    > two questions here. What is declaring the line:
    > BITMAPINFOHEADER texInfo; // BMP header
    > then secondly in LoadBMPTexture the LoadBitmapFile function is called
    > which returns an error: type specifier omitted for parameter
    > `BITMAPINFOHEADER'
    > Humm what kind of type is BITMAPINFOHEADER here :-/
    > Well that's all new for me and haven't seen that before in VB.NET. So
    > THANKS for your help.
    > Regards Michael
    >
    > // // LoadBMPTexture()
    > // // desc: loads a texture of the BMP format
    > void CTexture::LoadBMPTexture(char *filename)
    > {
    > BITMAPINFOHEADER texInfo; // BMP header
    >
    > // store BMP data in texture
    > data = LoadBitmapFile(filename, &texInfo);
    > if (data == NULL)
    > {
    > free(data);
    > }
    >
    > // store texture information
    > width = texInfo.biWidth;
    > height = texInfo.biHeight;
    > palette = NULL;
    > scaledHeight = 0;
    > scaledWidth = 0;
    > textureType = BMP;
    > }
    >
    > // LoadBitmapFile
    > // desc: Returns a pointer to the bitmap image of the bitmap specified
    > // by filename. Also returns the bitmap header information.
    > // No support for 8-bit bitmaps.
    > unsigned char *CTexture::LoadBitmapFile(char *filename, BITMAPINFOHEADER
    > *bitmapInfoHeader)
    > // in the line above i get the error: error: type specifier omitted for
    > parameter `BITMAPINFOHEADER'
    > {
    > FILE *filePtr; // the file pointer
    > BITMAPFILEHEADER bitmapFileHeader; // bitmap file header
    > unsigned char *bitmapImage; // bitmap image data
    > int imageIdx = 0; // image index counter
    > unsigned char tempRGB; // swap variable
    > ...


    Looks to me as if BITMAPINFOHEADER is not declared. You probably just need
    to include the file where it's defined. (Perhaps <windows.h>?)

    -Howard
     
    Howard, Sep 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Noah
    Replies:
    5
    Views:
    960
  2. Alex Vinokur
    Replies:
    4
    Views:
    593
    Jonathan Turkanis
    Apr 5, 2004
  3. Ovidesvideo
    Replies:
    4
    Views:
    518
    Andrey Tarasevich
    Dec 10, 2004
  4. kelvSYC
    Replies:
    6
    Views:
    7,234
    Richard Herring
    May 17, 2005
  5. Luca Forlizzi
    Replies:
    4
    Views:
    464
    Luca Forlizzi
    Nov 14, 2010
Loading...

Share This Page