Texture Loading without glaux library
Can anybody tell me any simple way of texture loading without glaux library(im doing the program in openGL+winapi)?
A tutorial perhaps?
http://nehe.gamedev.net
here you are, here it is.
"take a look around" - limp bizkit
www.google.com
here you are, here it is.
"take a look around" - limp bizkit
www.google.com
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?
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
Crispy
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.
You should never let your fears become the boundaries of your dreams.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement