Jump to content
  • Advertisement

Archived

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

mtrneo3

funky texture prob

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

first off, SDL is heaven sent and everyone should go download it and donate billions of dollars. with that said, i am wondering about a texturing problem i am having. I wrote a class to hold a texture object, and when i compile and run, i get no errors, except that the texture is missing from the cube. I think the prob is in the code i use to retrieve the texture itself to use in glBindTexture:
Texture::GetTexture()
{
  return (*this->texture);
}

...

glBindTexture(GL_TEXTURE_2D, box.GetTexture());
  
i simply dont see the problem, but when i run, the box is just white. any ideas, suggestions, voodoo miracles? thanx in advance ''Can I go back?'' ''No. But if you could, would you really want to?'' - mr. neo [edited by - mtrneo3 on July 1, 2002 5:21:35 PM]

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by mtrneo3

glBindTexture(GL_TEXTURE_2D, box.GetTexture);





There''s your problem.
Without the () your using the address of the function, not the return value of the function.

So change it to:

glBindTexture(GL_TEXTURE_2D, box.GetTexture());

That should fix your problem

Share this post


Link to post
Share on other sites
quote:
There''s your problem.
Without the () your using the address of the function, not the return value of the function.


while i appriciate that, it was a typo... sorry. i fixed it in the origanal. thanks tho.

the problem still exists, however, so any other ideas.


''''Can I go back?''''
''''No. But if you could, would you really want to?''''

- mr. neo

Share this post


Link to post
Share on other sites
Hi Mr. Neo

quote:
Original post by mtrneo3

.....


Texture::GetTexture()
{
return (*this->texture);
}

...




Shouldn''t it be either ''*this.texture'' or ''this->texture''?

Or could it be that texture was never probably set to the desired value? Maybe through such a simple mistake as the texture file being placed in the wrong directory ect.? Or maybe you forgot to enable texture mapping in your ini-code or something.

It''s a little hard to guess what the error might be without seing more of the code.

Regards

nicba

Share this post


Link to post
Share on other sites
yea i figured it out last night. the constructor function didnt properly set the texture filename to a real file, so when i was creating the texture i had no image :/.

thankx for the help, i feel really stupid...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!