PDA

View Full Version : The fastest way to draw pixels using OpenGL?



joda
11-13-2002, 09:05 AM
Hey!

Im currently working with OpenGL to draw 2D at 24 fps using images stored on disk. Im using C++ arrays which is dynamically allocated to store the framebuffer data. To draw the pixels Im using glDrawPixels.

Everything works fine but I need more speed, I want to be able to draw fullscreen images like 1280x700....my current setup is to slow for this, what is the best way to do something like this? Do I need a faster machine or is there a better way to draw pixels using OpenGL?

Thanks!

Mike

SirKnight
11-13-2002, 09:10 AM
How about using your bitmap data as a texture and plastering it onto some quads or something? A.K.A. Texture Mapping.

-SirKnight

SirKnight
11-13-2002, 09:11 AM
Oh yeah and if your 2D thingys are like animating you will need glCopyTexSubImage or something.

-SirKnight

joda
11-13-2002, 09:20 AM
You can think of my 2D data app as a movie player or something, nothing advanced, the only thing I need is to be able to zoom +/- which works fine glPixelZoom and glViewport.....no prob.

Do you have a code sample of the texture app? Something simple.....

Thanks for the reply!

- Joda

SirKnight
11-13-2002, 09:27 AM
Ah, I think NeHe has just the tutorials for you. He has a few different articles about texture mapping and even one about playing an avi on an object like it was a texture; pretty cool stuff. The URL is http://nehe.gamedev.net but gamedev.net seems to be down right now, well for me it is. Maybe it will work for you. http://www.opengl.org/discussion_boards/ubb/biggrin.gif

-SirKnight

joda
11-13-2002, 09:36 AM
Yeah, got no connection but I'll check the AVI tutorial, sounds like its exactly what I need, a example not using glDrawPixels......

Thanks for the link!

- Joda