Skip to main content
GameDev.net gamedev.net
🔒 Locked

Bitmap Write?

Started by matrix2681 Aug 18, 2006 at 10:02 PM 4 replies 1k views
Original Post
matrix2681
matrix2681
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
MARS_999
MARS_999
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...
JohnBolton
JohnBolton
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!
matrix2681
matrix2681
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.
JohnBolton
JohnBolton
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!
matrix2681
matrix2681
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.