Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gimp

OpenGL [OPENGL] My RAW file turns to mush as a texture?

This topic is 6389 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is some code I''m using to load my raw file:
  
		SetBitDepth(24);
		SetWidth(256);
		SetHeight(256);
		SetAlphaDepth(0);
		Data.resize(DefaultFontSize * (GetBitDepth()/8));

		for (unsigned long i=0; i<DefaultFontSize; i++)
		{
			Data[i] = DefaultFont[i];
			Data[i+1] = DefaultFont[i];
			Data[i+2] = DefaultFont[i];
		}
  
DefaultFont has the raw file information in it. The data is a 256*256*8bit image. I''m loading it to a 24 bit image just for simplicity. This ''setup'' of the texture information is pretty much mirroring my bmp loader except that the bmp loader flips the image once loaded. Is there something about the raw file format that I''m not aware of? byte ordering etc? The image appears to be like static, not upside down or back to front... Many thanks Chris

Share this post


Link to post
Share on other sites
Advertisement
There is no ordering in a raw file. You do what ever the hell you want that is why you shouldn''t use them unless you made them. The bitmap loader you copied from is for loading a 24 bpp bitmap. You are loading a 8 bpp image. Is all the pixel data for your raw image packed into one byte 3 red, 3 green, 2 blue? Is it using a lookup table? That is the problem with raw files. You just don''t know.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
for (unsigned long i=0; i = DefaultFont[i]; Data[i+1] = DefaultFont[i]; Data[i+2] = DefaultFont[i]; }

shouldnt that be someit like
Data[ i*3 +0 ] Data[ i*3 +1 ] Data[ i*3 +2 ]

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!