Archived

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

GroZZleR

Blitting Sprite From Single Surface

Recommended Posts

I'm looking for a way to blit a sprite from a single surface. Basically, you have 1 bitmap file with run, jump, walk, whatever animations on it. The issue is, the sprite layout could be bigger than 512 x 512 and obviously loading anything bigger than that wouldn't be good for older video cards (hell maybe even mine =P) I believe I read somewhere, that you can load a D3D Surface (which is unlimited in size?) and then blit the texture from that, and then blit the sprite from that texture. ie.. You're playing the walk animation, so you blit all the walk animations into a single texture from your surface, than you blit the frames as neccessary for the sprite from the texture rather than the surface... (Or do you blit from the surface and "skip" the texture?) Anyone have an example on how to do that? Or an article on the matter? [edited by - GroZZleR on August 31, 2003 3:30:00 PM]

Share this post


Link to post
Share on other sites
Take a look at this:
http://www.gamedev.net/reference/articles/article1608.asp

It's not exactly what you are looking for, but I believe somewhere in this article the author loads a surface, and then copies the data to a texture to achieve color keying, and since this is what you want to do, there you have it
But I must say that if you plan to do this every frame, your program will be SLOW, since locking the surface is a slow operation...

There are 10 kinds of people: those who know binary and those who don't

[edited by - CutterSlade on August 31, 2003 12:40:23 AM]

Share this post


Link to post
Share on other sites
Actually, I think that does exactly what I want =P

He loads a surface to memory, than splices it up into a texture. And he says the surface can be any dimension, which is exactly what I was looking for =)

Thanks a bunch.

Share this post


Link to post
Share on other sites