Loading a map from a texture

Started by
11 comments, last by MajorShredd 18 years, 1 month ago
Quote:Original post by daniel_i_l
So what do you recommend?
Thanks.


Cut Nehe's image loader code in half.
You only want the first part, where it reads the image file.
The second part, where it sends the data to OpenGL you should throw away.

After reading the file, copy the data into your own Map Structure.
Your own Map Structure will be custom tailored to give you easy access to the data you need, and it should be saved long after the image file itself is closed.
Live happily ever after.


The Details of Implementation are left as an exercise for the reader... I do not use NeHe's code so I am not familiar with the specifics of what lines need to be changed.
Advertisement
Ah I see well I wasn't understanding him I just figured he was placing it into some sort of array, and couldn't figure out how to get the data out of it. Yeah its bad to place things into video memory if your not going to be using it for texturing and actually to begin with shouldn't you always load it into some structure on system memory before loading it into video memory anyhow especially when you want to do things such as mipmapping and manipulate the way an image looks before storing it onto the card's memory. Atleast that is my understanding.
Best advice possible (and I'm surprised nobody mentioned this) - if you're a beginner, learn to write your own code before using someone else's. Not only will you get better at solving problems, but you will (surprisingly) save yourself headaches!

This topic is closed to new replies.

Advertisement