sprites....

Started by
4 comments, last by Boder 17 years, 12 months ago
hello there... i just wonder, if we can load sprites (.bmp or .png) with no background... without using masking technique... and of course using openGL library :D thanks... [Edited by - PG on May 1, 2006 7:35:16 AM]
Advertisement
Well if You don't want to use any masking technique like alpha testing or blending then You can't.
if (time() == $) { $ = 0; }
Sure. Create a texture and render the sprite in glOrtho mode as a textured quad.

You WILL want to use an alpha test. That IS what tells OpenGL to apply transparency to your sprite, otherwise it's a big rectangular block. In the case of a png though, the alpha channel might take care of it.
You can try writing a function that iterates through each pixel in your image file , and blits each pixel except the ones of a specific colour. (I don't recommend it though :D)
hehe.. thanks...
i once think about iterating for each pixels.. but i have to understand each kind of image format.. (whew..) it's kinda takes a lot of time hihi...
Once you have loaded the image into uncompressed color data, you don't need to worry about the format (as long as you know the bits per channel).

TGA is a good replacement for BMP, it will store your alpha channel so you don't have to do pixel manipulation.

This topic is closed to new replies.

Advertisement