SDL&OGL - how do I figure out glTexImage2D::format ?

Started by
11 comments, last by Seriema 20 years, 8 months ago
wow, cool function! gonna try it out

about the format, my guess is that I could switch() it? if BytesPerPixel == 3 I''ll go with RGB (and hope that nobody uses "swapped" .bmp''s). and so on?..

"No lies of sugar can sweeten the sournes of reality"

}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]
[ ThumbView: Adds thumbnail support for DDS, PCX, TGA and 16 other imagetypes for Windows XP Explorer. ] [ Chocolate peanuts: Brazilian recipe for home made chocolate covered peanuts. Pure coding pleasure. ]
Advertisement
Uhm, just one thing. Doesn''t sdl describe how the pixelformat works pretty well?

http://sdldoc.csn.ul.ie/sdlpixelformat.php
quote:Original post by Seriema
wow, cool function! gonna try it out

about the format, my guess is that I could switch() it? if BytesPerPixel == 3 I''ll go with RGB (and hope that nobody uses "swapped" .bmp''s). and so on?..

"No lies of sugar can sweeten the sournes of reality"

}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]


Indeed. It was originally made to preprocess images so that blitting would occur faster (so it didn''t need to format on blit, but only once ahead of time).

I''ve had edian problems with this on my linux box, getting the Red and Blue values mixed up, which I had to swap manually...

You could use information from the link gene gave to reformat 16 bit images to a higher depth... but for the most part I don''t see why he posted that link...

This topic is closed to new replies.

Advertisement