Jump to content
  • Advertisement

Archived

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

madfisher

Bits to DirectX surface

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

Hi, I was wondering if there was a way to write a pointer of BYTES obtained: LPBYTE lpDIB = (LPBYTE) GlobalLock( hBitmap ); directly to a directx surface. The hBitmap is defined as a HBITMAP, but it is however a DIB. If not what is the best way for me to write the DIB to a directx surface? Thanks Marcus de Leon

Share this post


Link to post
Share on other sites
Advertisement
(a) create a texture
(b) render a quad

Alternatively, use the sprite class provided.

Direct access - IMHO not.


Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
directx 7 or 8 ?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
IMHO?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
or sometimes In My Honest Opinion
with no Humbleness implied ;-)

Share this post


Link to post
Share on other sites
Lock the target surface, and write pixel-by-pixel, converting the pixel format as you go. (most likely, you won't have a B8G8R8 format for the surface)
Edit:
oh and unlock it when you're done

- JQ
Full Speed Games. Coming soon.

[edited by - JonnyQuest on August 29, 2002 10:04:38 AM]

Share this post


Link to post
Share on other sites
How fast will writing pixel by pixel to a surface be?

Here is my overall problem. I am getting a HBITMAP as a DIB from a third party dll. Right now I am writing the HBITMAP info to a HDC using the StretchDIBits function (Can''t use BitBlt b/c it''s a DIB). The HDC is then written to a back buffer in DirectX. Then the back buffer is flipped and the graphic is displayed. These graphics are tiles for a tile based world.

This is really slow. What is the easiest way to speed this up?

NOTE: I''m also fairly new at this type of programming.

Thanks in advance.

Share this post


Link to post
Share on other sites
Also..
Can do you think it is possible to directly write the DIB I get from the 3rd party to the directX backbuffer surface?

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!