Archived

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

thewideweb

Sprites In Ogl

Recommended Posts

thewideweb    122
I am probably going to be moving from directx to opengl because I will be porting some stuff to linux. I was wondering if there is a way to do sprites in opengl? I imagine that I would have to use ortographic (or however you spell it) projection because I''m making 2d games only. But, it is my understanding that there are no surfaces to work with in ogl, so how in the world do you load multiple frames from a bitmap to animate on screen? Any online tutorials or suggestions would be greatly appreciated. Thanks

Share this post


Link to post
Share on other sites
mittens    1323
All you have to do is load in various .bmps or .tgas (assuming you know how to do one, or both), and then make a texture mapped quad. Nothing special. If you need more help... Look at lesson 9 on NeHe''s site. It is exactly what you are looking for.

------------------------------
Trent (ShiningKnight)
E-mail me
Shining Darkness- A division of Chromesphere Studios

Share this post


Link to post
Share on other sites
core114    122
in opengl you can use bitmaps, or different parts of a texture, or multiple textures to do animations.
its like using a bunch of small surfaces for ddraw.

Share this post


Link to post
Share on other sites
thewideweb    122
I know that you can load bitmaps onto opengl quads, but that is just one frame. Is there a way to load in multiple frames from the same bitmap image and then animate it? And can you do transparency?

Thanks

Share this post


Link to post
Share on other sites
thewideweb    122
Im reading lesson 9 now and its just what i was looking for! thanks I also like that when I run the opengl program, I can still do other stuff in the background, while directx takes over the entire system.

Share this post


Link to post
Share on other sites
bobatefrei    122
If you are making 2d games only and you don''t care about special effects (rotozoom, alpha blending...), it may be easier to use SDL to convert a DirectX code to Linux (and a lot of OS).

Share this post


Link to post
Share on other sites
TheRealMAN11    142
I am currently about to out two image management libraries for loading images (they can also save). They are both open source and both can be used with openGL. You would only need these if you did not feel like writing your own loading functions.

DevIL
glBMP

DevIL supports more formats but it needs extra files to run on the enduser''s computer.

glBMP only supports four formats (bmp, tga, png, and jpg) but it requires nothing but OpenGL to run on the enduser''s pc.



Matthew
WebMaster
www.Matt-Land.com

Share this post


Link to post
Share on other sites