Using textures to draw terrains

Started by
0 comments, last by Big_Al482 22 years, 9 months ago
I started reading OpenGL Game Programming (excellent book by the way), and I got a little stuck on chapter 8 with the terrain demo. Although I understand how it works, I tried to make my own terrain by making a simple grayscale 32x32 bitmap in Photoshop and loading it in. However, my program (and even the demo in the book) isn''t able to properly read the bitmap when I make it in photoshop, but it can read the terrain2.bmp that came with the demo program. Even when I edit the bitmap in photoshop and save it, it doesn''t work. But, when I edit it in Paint, it works fine. I tried editing it in photoshop and making my own in photoshop and then resaving it with Paint, but it still didn''t work. My guess is that Photoshop does something different in the bitmap header which the LoadBitmapFile() function the book gives you can''t handle (maybe RLE compression or something...) Anyway, my question: does anyone know how to either fix this in photoshop, or know of a decent graphics editing program that will work with the demo program (if you can''t tell...I really do not want to use paint to draw terrains....) Thanks
Advertisement
Hmm, the bitmap function should work. Make sure that you''re saving it as a 24-bit BMP, even though it''s just gray data. The function won''t load any other type of BMP (sorry, ran out of time ).

If doing that still doesn''t work, then make another post here and if I get a chance I''ll check it out.

Kevin

Admin for GameDev.net.

This topic is closed to new replies.

Advertisement