Opengl + win32, sprite sheet solutions

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
User avatar
Spikey
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 98
Joined: Sat Dec 13, 2008 6:39 am
Programming Language of Choice: C++
Location: Ottawa, Canada
Contact:

Opengl + win32, sprite sheet solutions

Post by Spikey »

My project is a 3D side scroller with 2D character sprites, made with win32 and opengl. I'm at the point where I need to crop a texture to get sprites for animation. I'm wondering what would be better. One way is to crop an existing texture to make a new texture and slap that on. Or just update the uv/rts coordinates of the object. I'll probably test both ways soon, but I guess I'm asking if anyone knows which way is more efficient/elegant/etc or any problems that might pop up. Thanks.
OverlordYertle
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 12
Joined: Fri Mar 06, 2009 8:42 pm
Favorite Gaming Platforms: Dreamcast
Programming Language of Choice: C++

Re: Opengl + win32, sprite sheet solutions

Post by OverlordYertle »

i believe that using the uv/rts coordinates is more efficient. Especially if you use display lists i don't think you'll have a problem. But any additional time it would take to pull up the coordinates i think would be outweighed by the amount of memory you'd be saving.
CC Ricers
Chaos Rift Regular
Chaos Rift Regular
Posts: 120
Joined: Sat Jan 24, 2009 1:36 am
Location: Chicago, IL

Re: Opengl + win32, sprite sheet solutions

Post by CC Ricers »

In most applications, if you can do the job with one large texture, that method is preferred. Whether you're making sprites for animations or creating 2D impostors of 3D models, using one texture in place of many small ones is quicker and less expensive on the hardware. As long as you keep them reasonable sizes (something most video cards can handle) then you're fine.
Post Reply