Jump to content
  • Advertisement

Archived

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

Amir Vaxman

Texture mapping simply doesn't work!

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

Hello, I tried to perform texture mapping in an openGL program, been doing what the tutorials said, and even copying from examples. But yet, it simply doesn''t work! I get, instead of a textured polygon, a polygon colored in its former color. Now, I think it has something to do with, maybe, one of these: 1. when I call glGetTextures, it doesn''t provide me back with any new ID! why is that? 2. I might not be doing something I should have been doing before trying to define the texture - change of some variables? some registers? defining a valid viewport before, or something? I simply don''t have a clue. If someone ran into a similiar problem, or knows why this happens, please give me a hand here. Thanks in Advance, Amir

Share this post


Link to post
Share on other sites
Advertisement
I can''t, it''s not understandable (part of a big program, using lots of unfamiliar variables). I will try, if no one could give me a general solution..

Thanks in Advance,
Amir

Share this post


Link to post
Share on other sites
You may have either written to memory that doesn''t exist, or done something else weird... make sure you use GenTextures ONCE only, check your arrays, and do stuff. It''s almost definitely the loading/creation of the texture objects that''s causing the problem.

Share this post


Link to post
Share on other sites
1. Yes, I ment glGenTextures, sorry :-)

2. I tried to bind the texture, as written how-to, but I believe the problem is as early as (1), that doesn''t produce an ID.

3. "You may have either written to memory that doesn''t exist, or done something else weird... make sure you use GenTextures ONCE only" - is openGL accumulative even after closing the application? how can I trace errors?

4. It''s a 64*64.

5. "Make sure you have a valid context before you tries to call any other opengl command" - what does that mean? can''t I upload a texture before using the "wglCreateContext" and such?

Share this post


Link to post
Share on other sites
quote:
Original post by Amir Vaxman
5. "Make sure you have a valid context before you tries to call any other opengl command" - what does that mean? can''t I upload a texture before using the "wglCreateContext" and such?


exactly. you must have a valid context before using opengl.

"What is darkness? It doesn''t exist where there''s light, and without light, it''s nothing..."

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!