Jump to content
  • Advertisement

Archived

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

kaiel090x

OpenGL OpenGL with Bitmaps

This topic is 6220 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make a 2d game using bitmaps in OpenGL. I dont need to know how to do it, I just want to know if its possible.You can email me at kaiel090x@hotmail.com. I would be thankful for a response any time soon. ~ from the depths of the ocean

Share this post


Link to post
Share on other sites
Advertisement
I know I could make a 2d game with opengl. Bitmaps included. I don''t know about you though. You could always give it the old college try.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thanks? Im guessing that means it possible to use bitmaps is OpenGL, and your arrogant and believe your the only one who can do it? Your response confused me, correct me if I''m wrong about you. Thank you for telling me its possible.

Share this post


Link to post
Share on other sites
Thanks. i was just wondering because I just learned C++, and I baught the book Game Programming in OpenGL. But I didnt know if after I learned openGL I''d be able to make the current 2d(bitmap)game Im trying to make. What about like charecter movement, there are two steps per direction the charecter walks, left foot and right foot, could I use a gif or two bitmaps?

quote:
Original post by Null and Void
Yes, 2D in OpenGL is pretty easy. Treat the bitmaps just like textures, use an orthographic project matrix, and texture some quads .

[Resist Windows XP''s Invasive Production Activation Technology!]


Share this post


Link to post
Share on other sites
As far as I know all images (.jpg, .gif, .tif, ...) are stored internally (i.e. in ram) as (uncompressed) bitmaps. You might take an animated .gif for your sprite but you will have to decompress it to be able to load it as a texture for your quads.
Opengl can''t handle .gifs itself so the benefit of an animated .gif is only to store disk space (not in ram). And You have the "problem" that you have to find and learn a library to be able to load and decompress gifs. And .gifs are even copyrighted (in the worst case compu$erve might even sue you if you go commercial).
My suggestion is to store all your sprites animations in one big bitmap and upload that bitmap to texture memory. This is faster than having many small textures for each animation and you don''t have to mess with a new api.
If you really want to store your sprites in a compressed format you may use the .png format which has a better compression than gif (even for true color images), no loss of quality (as with .jpgs) and is absoluteley free of charges.
Hope that helped ;-)

baumep

Share this post


Link to post
Share on other sites
I think I understand. So I should have one bitmap with every single ''image'' in it. And load it as a texture. What do you mean I would have to learn a new library though?

Share this post


Link to post
Share on other sites
Thank you very much, everyone who has responded to me. Thank you Null and Viod. You sound like you know what your doing so I will take your advice.

quote:
Original post by Null and Void
He''s saying that to load GIF''s you''d have to go off on a tangent and learn how to decompress them (using LZO the compression algorithm), which would take much longer to learn than using texture coordinates to reference different parts of the same images as frames.

[Resist Windows XP''s Invasive Production Activation Technology!]




~ from the depths of the ocean

Share this post


Link to post
Share on other sites
Just to go off on a tangent here...

I understand that to do 2d easily you culd just texture some quads in an orthographic projection, but if all images are just 2d and always facing the same direction, it seems like a waste of CPU to make it do all the 3d calculations for an image that really doesnt need to be transformed in 3d at all.

Does anyone know if there is some way to bypass the 3d part, and just put your own pixels directly into the screen? Maybe somehow to lock the memory that OpenGL is drawing to and use it yourself?

As an example, something like a menu in a game, or like a 2-d cockpit. Just where the 3d stuff is drawn, and you want to overwrite some of it with your own pixels.

Any ideas?

~Dom

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!