Jump to content
  • Advertisement

Archived

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

Texture Loading without glaux library

This topic is 5706 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

Advertisement
Thanks for your answers.Now my question is, what programmers who code "real games" - commercial games use to load textures? Which way is the best? Is loading textures with glaux bad?

Share this post


Link to post
Share on other sites
Just look around and see how many games actually use bitmaps as textures - a bitmap is generally considered a large graphics format, and therefore generally not used to store larger images. Any gamewriter should write his own texture loading routines (it''s dead easy for non-compressed formats, such as dib''s, but can become very tricky when getting to images using more difficult compression algorithms - such as jpeg''s, although jpeg''s are not generally used in the game industry as they represent the lossy side of compressed image formats). You could always turn to 3rd party libraries for more difficult formats, but I strongly urge you to not use glaux and write your own bitmap loading routine - simply open up the format specification and see what each byte means - it''s like following a roadmap. Things get more complicated when you try to load RLE encoded bitmaps, so you might want to skip those for the time being, but I''m pretty cofident you won''t be using any 4 or 8 bit bitmaps in your games anyway (mostly)... Just make sure all of your textures are 24-bit, though - that way you won''t run into any surprises when loading and displaying them!

Crispy

Share this post


Link to post
Share on other sites
The simplest would be TGA since it''s only 18 bytes of header then just raw data. OK, it can be compressd (RLE, huffman, quadtree,...) but 95% of images there are just uncomressed RGB(A)

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
bmp are ok and easy but thyey need space, of course, but there is other way:
pack your bmps with rar for example download unrar.dll library (it comes with winrar) and during loading textures, just unpack that (rar routine with unrar.dll is very easy and can be found almost everywhere) and load normal bmp. Size is reduced nearly 10-15 times!
some others trick:
change some magic bytes in rar (6 bytes first for example) and most of users cant change your textures in game.
some other good packers:
tar - open source so you can include it in your code easly
lzh - as above
and dont forget delete your bmps after loading

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!