type declaration

M

Michael Sgier

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
....
 
H

Howard

Michael Sgier said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,690
Latest member
MacGyver

Latest Threads

Top