help in primary expressiong

the error was expected primary expression before ',' token

this is my first time encountering this error so i dont know what to do!
i already search the google for similar error but didn't find the solution that i need,
you can find the code in here
http://pastebin.com/ZpgTwBrf
the error was in line 67
1
2
3
4
5
6
7
8
9
10
11
12
  unsigned int loadTexture(const char* filename)
{
        SDL_Surface* img = SDL_LoadBMP(filename);
        unsigned int id;
        glGenTextures(1, &id);
        glBindTexture(GL_TEXTURE_2D, id);
    ☼   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img->w, img->h, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, img->pixels);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
        SDL_FreeSurface(img);
        return id;
}
closed account (o3hC5Di1)
Hi there,

Did your compiler give any more information than that? A character number, a snippet of which comma it is referring to or any additional info? It's always best to just copy-paste the compiler output so we can see the exact error.

My guess would be that either one of the constants does not exist, or you are using a data member of img which does not exist (assuming img is a valid object in the first place, i.e. it didn't fail to initialize.

All the best,
NwN
im using code::blocks

no it didn't give any more information, after compiling this is the only error that i got
c:\User\user\... 65 error: expected primary-expression before ',' token


the img exist .. i copy paste that code from thecplusplusguy the code works for him! so i don't know what to do to fix it

thank you for the help!

Topic archived. No new replies allowed.