Bitmap Write?

Started by
4 comments, last by matrix2681 17 years, 8 months ago
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
Advertisement
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?
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
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.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
glaux has never blown up on me, but the general consensus on gamedev is that it's broken... I guess tempting fate isn't smart, and I've been only lucky so far ;)

I'll give DevIL a shot and see what happens.

Thanks guys,
Michael

This topic is closed to new replies.

Advertisement