Jump to content
  • Advertisement
Sign in to follow this  
CoolGames

OpenGL OpenGL fastest 2D bitmaps drawing

This topic is 4911 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

Hey guys! I want to develop a 2D game with OpenGL. I tried to use DrawPixel() to draw to the front- and backbuffer but it is way too slow. So whats the fastest way please for a simple 2D game to draw a bitmap? I dont want any kind of effects like shadows, lightning, antialising or whatever there exists. All I want to do is drawing a bitmap into one of the buffers. Thats all I need. And I dont want to use SDL! Thank you!!

Share this post


Link to post
Share on other sites
Advertisement
you need set up the ortho mode, build a quad and texture it.

go to nehe in the articles section there is plenty of examples for many platforms on how to do this.

good luck!

Share this post


Link to post
Share on other sites
This method is also quite slow, especially on laptops. Your best bet is to use DirectDraw. Any version will do. It is fast, and supported on all Windows machines above 3.1 I believe. And it is easy to use than the OpenGL method just described. I uses the blt method that you tried, but DirectDraw makes it fast!!

Share this post


Link to post
Share on other sites
While it will require a 3D accelerator, I've found glOrtho() and quads to run plenty fast on any system I've worked on. Not to mention that it leaves the door open on the entire 3D pipeline should you ever want to experiment later on.

Share this post


Link to post
Share on other sites
There are several options - the main one is to use textured quads.

Of course using textured quads means you'll be able to use transparency, partial transparency, blending, lighting etc. While these things aren't "free" (as some opengl users claim), they do come at a significantly reduced cost over trying to do them in software.

Plus Directdraw is thoroughly deprecated and can't do most of these things anyway (I believe Microsoft would have you use similar techniques with Direct3d, which IS the modern DirectX graphics API).

There is also an opengl extension for point sprites, which basically have a similar effect to using billboarding but involve throwing less geometry at the card - it's effectively an optimisation.

Mark

Share this post


Link to post
Share on other sites
What I did with my tile engine, was using ortho mode and render an optimised vertex buffer every frame. This results on high framerates here.

Share this post


Link to post
Share on other sites
Quote:
Original post by rpg_code_master
Oh, maybe it's me.

See StickyBricks to see what I did. Click demos. I blt to the whole screen with 3d models in the same scene. It runs well on PCs, but dirt slow on laptops.
Laptops are PCs. :p

Anyway, there is no blitting with textured quads. Maybe that was your problem; glDrawPixels is slooooow.

Share this post


Link to post
Share on other sites
Sign in to follow this  

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