lesson 6 : too many textures ??

Started by
4 comments, last by PlumeProg 21 years, 7 months ago
Hello I just finished lesson 6 on texture mapping, and as suggested, I tried to modify the code to put my own textures on the cube. Works fine with 1 or 2 texture, but when I try loading more than 2, I get all sorts of errors. Sometimes, I can''t register class, some other time, the app will run but it will get extremely laggy, never displaying anything. What''s wrong ?
Advertisement
Did you raise the texture and TextureImage arrays to the amount of textures you are using? If not, then you will get errors.
I did.

I ran the prog with debbug and it looks like all the textures are loading correctly. I get to the main loop (with the message pump,dispatch, etc). It''s just that the prog run without ever displaying anything.

I''ve also tried doing the same with nehe code and I get an assertion failed on dbgheap.c

any idea ?

b.t.w. I''m using vc++6 (with the visual c++ code of the lesson)
You''ll have to post some of your code for anyone to see the problem. Post your loading section first.

---
Make it work.
Make it fast.

"I’m happy to share what I can, because I’m in it for the love of programming. The Ferraris are just gravy, honest!" --John Carmack: Forward to Graphics Programming Black Book
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
Thnaks, but I found my problem : I was using multiple calls to LoadGLTextures (with some modifications) to load multiples textures, but I let the glGenTextures() call in this function.

So I ended creating new texture list every time

very bad...

thanks anyway
Multiple calls to gen textures is perfectly fine; so long as you do not re-use numbers.

This topic is closed to new replies.

Advertisement