Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Where is the type FILE?

  1. #1
    Member Contributor
    Join Date
    Apr 2007
    Posts
    80

    Where is the type FILE?

    Hi,

    i have found this piece of 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");

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2005
    Location
    Berlin, Germany
    Posts
    188

    Re: Where is the type FILE?

    FILE (and the related functions) are part of the C standard library and are defined in stdio.h.
    355/113 -- Not the famous irrational number PI, but an incredible simulation!

  3. #3
    Member Contributor
    Join Date
    Apr 2007
    Posts
    80

    Re: Where is the type FILE?

    ok thanks!

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

    TGAHEADER tgaHeader;

    Where is the TGAHEADER type?

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Where is the type FILE?

    grep -r TGAHEADER *

  5. #5
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Where is the type FILE?



    TGAHEADER is not in a standard C library but normally defined by the programmer writing the TGA image load routine.
    Look in the headers belonging to the "piece of code you found".

    Other than that, there is a website dedicated to list file formats http://www.wotsit.org/
    Read that and write your own TGA header struct if you like.

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2005
    Location
    Netherlands
    Posts
    5

    Re: Where is the type FILE?

    That looks like your using code from the tga tutorial on NeHe.

    http://nehe.gamedev.net

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: Where is the type FILE?

    Yea, that's the one used on nehe.
    The tga loader we at nehe currently have in development is a lot slimmer than that chunky code (and a lot better to).

  8. #8
    Senior Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    659

    Re: Where is the type FILE?

    Originally posted by ZbuffeR:
    grep -r TGAHEADER *
    hmmm...

    find / -name "*" -exec grep -n -H TGAHEADER {} \;

  9. #9
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Where is the type FILE?

    Originally posted by RigidBody:
    Originally posted by ZbuffeR:
    grep -r TGAHEADER *
    hmmm...

    find / -name "*" -exec grep -n -H TGAHEADER {} \;
    grep -r -n TGAHEADER /
    with 'grep (GNU grep) 2.5.1'

  10. #10
    Senior Member Frequent Contributor
    Join Date
    Aug 2004
    Location
    munich, germany
    Posts
    659

    Re: Where is the type FILE?

    Originally posted by ZbuffeR:
    Originally posted by RigidBody:
    Originally posted by ZbuffeR:
    grep -r TGAHEADER *
    hmmm...

    find / -name "*" -exec grep -n -H TGAHEADER {} \;
    grep -r -n TGAHEADER /
    with 'grep (GNU grep) 2.5.1'
    hehehe...ok

    but if i want to check only header files?

    find / -name "*.h" -exec grep -n -H TGAHEADER {} \;

Page 1 of 2 12 LastLast

Similar Threads

  1. data type FILE in kernel
    By agmegharaj in forum OpenCL
    Replies: 2
    Last Post: 09-05-2011, 09:48 PM
  2. file type
    By Hylke Donker in forum OpenGL: Basic Coding
    Replies: 23
    Last Post: 08-12-2005, 10:15 AM
  3. Replies: 12
    Last Post: 05-25-2005, 12:42 PM
  4. bitmap-type in opengl to eps file
    By koko in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 04-24-2002, 02:54 PM
  5. Type 2 and Type 3 errors
    By in forum OpenGL: macOS
    Replies: 4
    Last Post: 09-09-2000, 06:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean