L luv this place... only here can you get so much help to sch lil question... God blesss gamedev
(possible?) problem with glGenTextures in Delphi
November 30, 2001 11:11 PM
Hi,
I''ve had a similar problem before where glGenTextures() would give me 0 as the id for the texture (and thus, no texture).
I was using NeHe''s basecode and if I had a separate class that would store the world information. Anyway, when I initialized the World object (as a global in main.cpp), it would try to generate the textures I needed. But, glGenTextures() would always give me 0.
What I did to fix this was call glTextures() after my OpenGL screen was set up and ready to go. And it worked =)
So, I think that you have to have your OpenGL screen set up before you can call glGenTexture(). Well, I''m not entirely sure of this, but it worked for me.
I''m not sure how your code is set up (too lazy to download it and take a look =P) but it''s worth a shot to try it this way.
--
cybrgod
I''ve had a similar problem before where glGenTextures() would give me 0 as the id for the texture (and thus, no texture).
I was using NeHe''s basecode and if I had a separate class that would store the world information. Anyway, when I initialized the World object (as a global in main.cpp), it would try to generate the textures I needed. But, glGenTextures() would always give me 0.
What I did to fix this was call glTextures() after my OpenGL screen was set up and ready to go. And it worked =)
So, I think that you have to have your OpenGL screen set up before you can call glGenTexture(). Well, I''m not entirely sure of this, but it worked for me.
I''m not sure how your code is set up (too lazy to download it and take a look =P) but it''s worth a shot to try it this way.
--
cybrgod
FINALLY FINALLY FINALLY!!!
The problem of not gettin textures has been resolved. I''d like to thank you guys VERY VERY VERY much for all your support and help the past few weeks. The problem was very simple, but difficult to find :
In my program, I first ran the procedure to configure OpenGL (with among other the (gl_enable (GL_TEXTURE_2D)
statement in it. and THEN the procedure to open the viewport, assuming that OpenGL would store my values and apply it. But it seems it doesn''t, and since all tutorials up to this one worked with my conversion, I overlooked the fact that that could be wrong (i didn''t discover my problem until I looked over my code completely, laying every line of code beside the ones in Marc Aart''s conversion.
So that''s it. One heck of a thread by just one stupid very small error of me, with big consequences. I apologize for keeping you guys busy with something that wasn''t going wrong at all.
Thanks a lot,
NaliXL.
The problem of not gettin textures has been resolved. I''d like to thank you guys VERY VERY VERY much for all your support and help the past few weeks. The problem was very simple, but difficult to find :
In my program, I first ran the procedure to configure OpenGL (with among other the (gl_enable (GL_TEXTURE_2D)

So that''s it. One heck of a thread by just one stupid very small error of me, with big consequences. I apologize for keeping you guys busy with something that wasn''t going wrong at all.
Thanks a lot,
NaliXL.
Newbie programmers think programming is hard.Amature programmers think programming is easy.Professional programmers know programming is hard.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement