Archived

This topic is now archived and is closed to further replies.

can anyone explain this error?

This topic is 5009 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

What does this mean? error C2664: ''glBindTexture'' : cannot convert parameter 2 from ''unsigned int (void)'' to ''unsigned int'' Surely an unsigned int is an unsigned int? What''s unsigned int (void)?

Share this post


Link to post
Share on other sites
Strange, really really strange. Are you passing a pointer (/array)? (just a question you'll never know).

EDIT: looks like you are passing a function instead of a variable!

[edited by - Tree Penguin on March 24, 2004 4:15:52 PM]

Share this post


Link to post
Share on other sites
Hi Tree Penguin,

I'm passing a member function of my texture class. Now that's got me thinking!...

My call is

glBindTexture(GL_TEXTURE_2D, testtex1.GetID);

The definition of the function is:

GLuint CTexture::GetID(void) {return tex_id};

Hmm, I think that must be it.

Can't I pass a function then? I thought it'd just plug in the value returned...

[edited by - alex997 on March 24, 2004 4:19:25 PM]

Share this post


Link to post
Share on other sites
You need to add the () to make it a function call. i.e.:

glBindTexture(GL_TEXTURE_2D, testtex1.GetID());

edit: Darn you, Sneftel! Beat me by just 7 seconds.

[edited by - SiCrane on March 24, 2004 4:21:05 PM]

Share this post


Link to post
Share on other sites
actuarly you do pass a function
this glBindTexture(GL_TEXTURE_2D, testtex1.GetID);
should be this glBindTexture(GL_TEXTURE_2D, testtex1.GetID());

as it is now you pass the function testtex1.GetID to glBindTexture, not the result you get when you run the function.

- Perhaps! -




---------------------------------
For an overdose of l33tness, flashbang.nu

Share this post


Link to post
Share on other sites
DAMMIT! Of course! What a prime idiot!

Dunno what came over me, lack of sleep I guess. Ah well, won;t make that mistake again. Was just a bit flummoxed by the cryptic error message! "Missing (" might have been a better clue!

Cheers guys.

Share this post


Link to post
Share on other sites