Jump to content
  • Advertisement

Archived

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

nomadman2003

Fastest way to display 2D image

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

What is the fastest way to display an image? I''d assume using the 3d card would be the fastest but does this mean I have to make it a texture on a primitive? What about glBitmap/glDrawPixels, do I still use the vid card with those? I''m working on a menu (GUI) and HUD system that are 2D images. Any help is appreciated.

Share this post


Link to post
Share on other sites
Advertisement
I''ve always thought ''blitting'' was the fastest way. Perferablly with a hand-coded assembly based blitter that access raw video/screen memory.

Also, perhaps look at the blitting functions in OpenGL or DirectX.

Perhaps try these URLs (+ google "blit" or "fastblit") ...

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=29
http://www.dcc.unicamp.br/~lmarcos/courses/mc603/redbook/chapter10.html

Ok?

Dan

Share this post


Link to post
Share on other sites
Thanks dan, yeah Im familiar with the windows blitter api (i.e. bitblt) you think thats faster than hardware? Sure would be a solution I'm familiar with, but this is my first 3d game and I wanted as much speed as possible.

I'll set it up using windows api and see if thats fast enough.

(and, yes, I do know windows api makes it platform dependent and thats fine)

NOMAD

[edited by - nomadman2003 on April 15, 2004 5:10:17 PM]

Share this post


Link to post
Share on other sites
If you insist on using OpenGL then rendering a screen-aligned textured quad and using glTexSubImage2D to copy the image data to the texture is faster than glDrawPixels on the implementations I''ve tried it on.

Share this post


Link to post
Share on other sites
In both OpenGL and Direct3D, the fastest way to get bits on the screen is to use TexSubImage2D() to upload to a texture, and then draw a quad (or, for D3D, two triangles) with this texture on it. It''s significantly faster than DrawPixels() or StretchBlt().

Share this post


Link to post
Share on other sites
Thank you both, I read the man page for glTexSubImage2D, and have a question. Is this faster than regular texturing?

The page says it "redefines a contiguous subregion of an existing two-dimensional texture image" can I generate the full texture and use the glTexSubImage2D command with the full range of the image, to trick it into going faster? Or do I need to combine my textures into one and use this to texture part with parts of the full texture image?

Also, is it the level of detail you sacrifice in using this over glTexImage2D? So in other words its like blitting a mip-map version of a glTexImage2D? If so do I need to make mipmaps of the texture I''m doing this with?

Thanks again,
NOMAD

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!