Advertisement

Texture not showing up...

Started by November 19, 2001 04:40 PM
1 comment, last by NaliXL 23 years, 3 months ago
Hi there! I''m trying to re-write the Delphi-conversion by Marc Aarts of some of the tutors. He uses MFC code quite a lot, and I like to work with standard borland code a lot, plus that this way I''ll get a good understanding of the basics of OpenGL. Anyway, I''ve come to the part of texture-mapping. For afaik I''ve copied all code concerning texure-mapping. I''ve looked it over and over and over again, but I can''t find my problem. The cube is and stays white, no errors reported from within the program. Can anyone help me with this one by downloading it and checking out what''s wrong? Thanks a lot. Here''s some info that might be handy... 1. There are 2 units, the one that loads at program-startup is only a menu to select resolution, quality etc. The other one contains the OpenGL code. 2. The comments are still very poor and will most times not be correct (anymore). 3. The InitializeOpenGl procedure inits all options, the Drawingcode procedure contains the code that defines the cube that should be textured, FPStimerTimer contains the main loop that updates the viewport. The LoadGLTextures procedure is the last procedure in the code. The glBindTexture and glGenTextures procedures are almost on top of the program. 4. Please remind that this is work-in-progress by a OpenGL newbie and an Delphi-intermediate.... 5. It all can be downloaded at http://home.hetnet.nl/~babipanghang/glframe.zip Thanks a big lot! JP
Newbie programmers think programming is hard.Amature programmers think programming is easy.Professional programmers know programming is hard.
I dont have delphi so I cant compile your code but I believe it has something to do with the way you load the texture try:

1) use a boolean to check auxDIBImageLoad is returing something and build in some error checking to see if its generating any internal errors (these will not be easy to pick up on if your not looking for them, compiler wont do it)
2) enable gl_texture_2d inside your drawing code (possible this might work)

of far as I can I see your code should be working however I am not familar with some of semantics delphi uses for opengl, try using C semantics for loading textures (see lesson 5)

Advertisement
Thanks for your reply. I haven''t got time to try it right away, but as soon as I''ve tried, I''ll tell ya what it does.

You said you don''t have delphi. If you''re interrested : the Personal Edition, which is fairly complete, is available for free download at borland.com. The only thing they ask in return is that you register it. If you''re using Linux, you can try Kylix Personal Edition, also free.

Thanks again for your reply,

NaliXL.

This topic is closed to new replies.

Advertisement