Jump to content

  • Log In with Google      Sign In   
  • Create Account


OpenGL with Bitmaps


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 kaiel090x   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 August 2001 - 03:55 PM

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

Sponsor:

#2 GKW   Members   -  Reputation: 200

Like
Likes
Like

Posted 09 August 2001 - 05:21 PM

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

#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 09 August 2001 - 05:28 PM

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.

#4 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 09 August 2001 - 08:29 PM

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!]

#5 kaiel090x   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 August 2001 - 09:49 PM

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!]




#6 baumep   Members   -  Reputation: 288

Like
Likes
Like

Posted 10 August 2001 - 12:03 AM

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

#7 kaiel090x   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 August 2001 - 04:04 AM

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?

#8 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 10 August 2001 - 08:03 AM

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!]

#9 kaiel090x   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 August 2001 - 08:12 AM

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

#10 binary1230   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 August 2001 - 02:32 PM

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

#11 GKW   Members   -  Reputation: 200

Like
Likes
Like

Posted 10 August 2001 - 04:20 PM

There will never be access to the frame buffer in OpenGL, not in the way you want anyway. This has been discussed at length by nvidia engineers at the opengl.org forums. Ortho mode works quite well anyway.

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS