Loading textures
How can I load different sized textures, like 256x64. I'm using .raw format for files and C++. I know it's possible, because I have seen it, but I don't know how it's done..
Tiritomba
Which part of the loading is it you're having problems with? The file IO, or using OpenGL to upload the texture to the graphics card?
A .raw image should store the pixels as 3 bytes (red, green, blue) after each other. There is no header or anything, just the pixel data. All you have to do is to open the file and read the bytes into an array. The number of bytes should be 3 * width * height.
A .raw image should store the pixels as 3 bytes (red, green, blue) after each other. There is no header or anything, just the pixel data. All you have to do is to open the file and read the bytes into an array. The number of bytes should be 3 * width * height.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement