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

Reading/Editing Texture Bytes

Started by Antonym Mar 6, 2009 at 1:25 PM 0 replies 400+ views
Original Post
Antonym
Antonym
I want to use bitmap to generate some terrain using c++. The black pixels = no terrain/empty, white ones = terrain/solid. However I don't know how to get that info, how to read the bytes of the texture and know which ones are white and which ones are black. Any help/info on the subject is greatly appreciated.
bfi3d
bfi3d
parse the bitmap file and read the pixel color

or

by using DirectX, just like:
first : D3DXCreateTextureFromFile()
then : lock the texture using LockRect() and reading the color values

Topic Locked

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

Sign in to reply to this topic.