Sign in to follow this  
matrix2681

Bitmap Write?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this