Problems with Display-List
hi again.
since the response from my last post "Sprites using Display-Lists" i decided to repost.
o.k. i have bitmaps the contain multiple textures
i.e. [mask][texture1][texture2]...[texturen]
i load it with nehe''s code but with a struct that returns
the size in addition to the texture id.
then i make the display-list
and when i draw it with a bitmap with 2 textures
it works o.k. but with any bitmap with more it does not
work!
what am i doing wrong???
any help is appreciated!!!
thanks
int LoadSprite(SPRITE_HANDLE &Sprite, char *Filename)
{
FILE_INFO Info;
if (!LoadBMP (Info, Filename))
return false;
Sprite.Texture = Info.Texture;
Sprite.sizeX = Info.sizeX;
Sprite.sizeY = Info.sizeY;
Sprite.Number_Of_Images = Sprite.sizeX / Sprite.sizeY;
Sprite.List=glGenLists(Sprite.Number_Of_Images);
float Size = float (Sprite.sizeY / 20.0);
float cx_max = float(1/float(Sprite.Number_Of_Images));
for (int loop=0; loop == 0)
SetBlending (true, GL_DST_COLOR,GL_ZERO);
else
SetBlending (true, GL_ONE,GL_ONE);
}
glCallList (Sprite.List+Index);
glPopAttrib ();
SetBlending (false, 0,0);
SetDepthTest (true, GL_EQUAL);
glDisable(GL_TEXTURE_2D);
glPopMatrix ();
}
</i>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement