Sprites In Ogl

Started by
6 comments, last by thewideweb 22 years, 8 months ago
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
Advertisement
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
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.
Or, of course, you can use texture coordinates.

[Resist Windows XP''s Invasive Production Activation Technology!]
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
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.
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).
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
It is foolish for a wise man to be silent, but wise for a fool.

This topic is closed to new replies.

Advertisement