• Advertisement
Sign in to follow this  

Where is the type FILE in OpenGL?

This topic is 4227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i have found this piece of OpenGL code below to handle textures but i find an error when compiling at the lines that contains the type FILE. The error is this: 'FILE' undeclared identifier. Where is that type FILE? void *CargaTGA(char *filename,int *tam) { GLubyte TGAheader[12]={0,0,2,0,0,0,0,0,0,0,0,0}; GLubyte TGAcompare[12]; GLubyte header[6]; GLuint bytesPerPixel; GLuint imageSize; GLuint temp,i; GLuint type=GL_RGBA; Imagen texture; GLubyte *aux; FILE *file = fopen(filename, "rb");

Share this post


Link to post
Share on other sites
Advertisement
It is not an OpenGL type - it is a C standard library type for manipulation of file streams.

If you are having a compile error, you need to include <stdio.h>, or include <cstdio> and change FILE to std::FILE or put "using namespace std;" at the top of your source file.

HTH

Share this post


Link to post
Share on other sites
ok thanks!

anyway i get the same error trying to declare a TGAHEADER variable:

TGAHEADER tgaHeader;

Where is the TGAHEADER type?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by tirengarfio
ok thanks!

anyway i get the same error trying to declare a TGAHEADER variable:

TGAHEADER tgaHeader;

Where is the TGAHEADER type?


TGAHEADER is probably created by whoever wrote that code, or some external image library, neither OpenGL , C or C++ has any standard functions, classes or structures dealing with image file formats.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement