Bitmap Write?
Heya,
I'm working on a terrain editor that reads info from a bitmap and uses the alpha channel of each pixel to generate the heightmap (a'la NeHe #45). I want to expand it to be able to update the bitmap file but I don't know how. Is there a simple way to change the data in a bitmap?
Thanks for your time,
Michael Fritzius
Modelmaker Project
If I read you right, you want to load the data use it, edit it, and then update the file? Well save the bitmap data you have to a file with the updated info. Look around the net for a .bmp tutorial that saves them. "Beginning OpenGL game programming book" covers this...
Does the library you use to read the bitmap file also have functions to write a bitmap file?
Quote:Original post by JohnBolton
Does the library you use to read the bitmap file also have functions to write a bitmap file?
Not from what I've seen. I'm using stuff in glaux and haven't seen anything that looks like it would write. So far I've got auxDIBimageload in use.
I don't recommend using glaux. I has problems.
The alternative is to learn how to load and save images, and write the code yourself (google "opengl save image"), or use a library that supports loading and saving images (for example, DevIL).
Probably the best thing to do is to learn how it's done and use a library. The advantages of using a library like DevIL are that you can load and save many different file formats, and the code is already written and debugged for you.
The alternative is to learn how to load and save images, and write the code yourself (google "opengl save image"), or use a library that supports loading and saving images (for example, DevIL).
Probably the best thing to do is to learn how it's done and use a library. The advantages of using a library like DevIL are that you can load and save many different file formats, and the code is already written and debugged for you.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement